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

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

 



On 1/19/24 7:02 AM, 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) {

   No need for {} around single statement.

> +				reserve_exception_space(0x400, VECTORSPACING * 64);
> +			}
>  		} else {
>  			c->cputype = CPU_BMIPS4350;
>  			__cpu_name[cpu] = "Broadcom BMIPS4350";
> @@ -1598,7 +1600,9 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
>  			__cpu_name[cpu] = "Broadcom BMIPS5000";
>  		set_elf_platform(cpu, "bmips5000");
>  		c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI;
> -		reserve_exception_space(0x1000, VECTORSPACING * 64);
> +		if (cpu == 0) {

  Ditto.

> +			reserve_exception_space(0x1000, VECTORSPACING * 64);
> +		}
>  		break;
>  	}
>  }
[...]

MBR, Sergey




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

  Powered by Linux