lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZWCNWkYCjMU4-Ef2@arm.com>
Date:   Fri, 24 Nov 2023 11:47:38 +0000
From:   Catalin Marinas <catalin.marinas@....com>
To:     Huang Shijie <shijie@...amperecomputing.com>
Cc:     will@...nel.org, gregkh@...uxfoundation.org, rafael@...nel.org,
        arnd@...db.de, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH v4] arm64: irq: set the correct node for VMAP stack

On Fri, Nov 24, 2023 at 11:15:13AM +0800, Huang Shijie wrote:
> In current code, init_irq_stacks() will call cpu_to_node().
> The cpu_to_node() depends on percpu "numa_node" which is initialized in:
>      arch_call_rest_init() --> rest_init() -- kernel_init()
> 	--> kernel_init_freeable() --> smp_prepare_cpus()
> 
> But init_irq_stacks() is called in init_IRQ() which is before
> arch_call_rest_init().
> 
> So in init_irq_stacks(), the cpu_to_node() does not work, it
> always return 0. In NUMA, it makes the node 1 cpu accesses the IRQ stack which
> is in the node 0.
> 
> This patch fixes it by:
>   1.) export the early_cpu_to_node(), and use it in the init_irq_stacks().
>   2.) change init_irq_stacks() to __init function.
> 
> Reviewed-by: Catalin Marinas <catalin.marinas@....com>  
> Signed-off-by: Huang Shijie <shijie@...amperecomputing.com>
> ---
> v3 --> v4:
> 	1.) keep early_cpu_to_node() as __init function.
> 	2.) change init_irq_stacks() to __init function.
> 
> ---
>  arch/arm64/kernel/irq.c    | 5 +++--
>  drivers/base/arch_numa.c   | 2 +-
>  include/asm-generic/numa.h | 2 ++
>  3 files changed, 6 insertions(+), 3 deletions(-)

Greg, Rafael - any objections to taking this patch through the arm64
tree?

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ