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

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

 



On Tue, Jan 23, 2024 at 09:47:57AM +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 APs is
> too late since memblock is unavailable at that time.
> 
> So, reserve exception vector ONLY by BP.
> 
> Suggested-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
> Signed-off-by: Huang Pei <huangpei@xxxxxxxxxxx>
> ---
>  arch/mips/kernel/traps.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
> index 246c6a6b0261..5b778995d448 100644
> --- a/arch/mips/kernel/traps.c
> +++ b/arch/mips/kernel/traps.c
> @@ -2007,7 +2007,13 @@ unsigned long vi_handlers[64];
>  
>  void reserve_exception_space(phys_addr_t addr, unsigned long size)
>  {
> -	memblock_reserve(addr, size);
> +	/*
> +	 * reserve exception space on CPUs other than CPU0
> +	 * is too late, since memblock is unavailable when APs
> +	 * up
> +	 */
> +	if (smp_processor_id() == 0)
> +		memblock_reserve(addr, size);
>  }
>  
>  void __init *set_except_vector(int n, void *addr)
> -- 
> 2.30.2

applied to mips-fixes.

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