Re: [PATCH 1/2] MIPS: reserve exception vector space ONLY ONCE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 19, 2024 at 05:15:02PM +0100, Thomas Bogendoerfer wrote:
> On Fri, Jan 19, 2024 at 12:02:39PM +0800, Huang Pei wrote:
> > "cpu_probe" is called both by BP and APs, but reserving exception vector
> > (like 0x0-0x1000) called by "cpu_probe" need once and calling on BPs is
> > too late since memblock is unavailable at that time.
> > 
> > So, reserve exception vector ONLY by BP.
> > 
> > Signed-off-by: Huang Pei <huangpei@xxxxxxxxxxx>
> > ---
> >  arch/mips/kernel/cpu-probe.c | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> > index b406d8bfb15a..6939d0de2a03 100644
> > --- a/arch/mips/kernel/cpu-probe.c
> > +++ b/arch/mips/kernel/cpu-probe.c
> > @@ -1581,7 +1581,9 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
> >  			__cpu_name[cpu] = "Broadcom BMIPS4380";
> >  			set_elf_platform(cpu, "bmips4380");
> >  			c->options |= MIPS_CPU_RIXI;
> > -			reserve_exception_space(0x400, VECTORSPACING * 64);
> > +			if (cpu == 0) {
> > +				reserve_exception_space(0x400, VECTORSPACING * 64);
> > +			}
> 
> why not do a 
> 
> if (smp_processor_id() == 0)
> 	memblock_reserve(...)
> 		
> in reserve_exception_space() ?

This is better, I will include this in V6
> 
> Thomas.
> 
> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]





[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux