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] [day] [month] [year] [list]
Message-ID: <aFOjm8pHuWTceIiD@kernel.org>
Date: Thu, 19 Jun 2025 08:43:55 +0300
From: Mike Rapoport <rppt@...nel.org>
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>,
	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>,
	Alexander Gordeev <agordeev@...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 v6] mm/percpu: Conditionally define _shared_alloc_tag via
 CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU

On Wed, Jun 18, 2025 at 09:58:09AM +0800, Hao Ge wrote:
> 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>
> Acked-by: Alexander Gordeev <agordeev@...ux.ibm.com> # s390
> Signed-off-by: Hao Ge <gehao@...inos.cn>

Acked-by: Mike Rapoport (Microsoft) <rppt@...nel.org>

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ