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: <aFFos/pmtkur+Vmd@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Date: Tue, 17 Jun 2025 15:08:03 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Hao Ge <hao.ge@...ux.dev>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Mike Rapoport <rppt@...nel.org>,
        Richard Henderson <richard.henderson@...aro.org>,
        Matt Turner <mattst88@...il.com>, Dennis Zhou <dennis@...nel.org>,
        Tejun Heo <tj@...nel.org>, Christoph Lameter <cl@...ux.com>,
        Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>,
        Kent Overstreet <kent.overstreet@...ux.dev>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, linux-alpha@...r.kernel.org,
        linux-s390@...r.kernel.org, Hao Ge <gehao@...inos.cn>
Subject: Re: [PATCH v5 1/1] mm/percpu: Conditionally define _shared_alloc_tag
 via CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU

On Tue, Jun 17, 2025 at 03:10:52PM +0800, Hao Ge wrote:

Hi Hao,

> From: Hao Ge <gehao@...inos.cn>
> 
> Recently discovered this entry while checking kallsyms on ARM64:
> ffff800083e509c0 D _shared_alloc_tag
> 
> If ARCH_NEEDS_WEAK_PER_CPU is not defined(it is only defined for
> s390 and alpha architectures), there's no need to statically define
> the percpu variable _shared_alloc_tag.
> 
> Therefore, we need to implement isolation for this purpose.
> 
> When building the core kernel code for s390 or alpha architectures,
> ARCH_NEEDS_WEAK_PER_CPU remains undefined (as it is gated
> by #if defined(MODULE)). However, when building modules for these
> architectures, the macro is explicitly defined.
> 
> Therefore, we remove all instances of ARCH_NEEDS_WEAK_PER_CPU from
> the code and introduced CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU to
> replace the relevant logic. We can now conditionally define the perpcu
> variable _shared_alloc_tag based on CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU.
> This allows architectures (such as s390/alpha) that require weak
> definitions for percpu variables in modules to include the definition,
> while others can omit it via compile-time exclusion.
> 
> Suggested-by: Suren Baghdasaryan <surenb@...gle.com>
> Signed-off-by: Hao Ge <gehao@...inos.cn>
> ---
>  arch/alpha/Kconfig              | 1 +
>  arch/alpha/include/asm/percpu.h | 5 ++---
>  arch/s390/Kconfig               | 1 +
>  arch/s390/include/asm/percpu.h  | 5 ++---
>  include/linux/alloc_tag.h       | 6 +++---
>  include/linux/percpu-defs.h     | 7 ++++---
>  lib/alloc_tag.c                 | 2 ++
>  mm/Kconfig                      | 7 +++++++
>  8 files changed, 22 insertions(+), 12 deletions(-)
...

Acked-by: Alexander Gordeev <agordeev@...ux.ibm.com> # s390

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ