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: <ZjUA4vRP_kLmCF6L@FVFF77S0Q05N>
Date: Fri, 3 May 2024 16:21:06 +0100
From: Mark Rutland <mark.rutland@....com>
To: Anshuman Khandual <anshuman.khandual@....com>
Cc: Puranjay Mohan <puranjay@...nel.org>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>, Sumit Garg <sumit.garg@...aro.org>,
	Stephen Boyd <swboyd@...omium.org>,
	Douglas Anderson <dianders@...omium.org>,
	"Peter Zijlstra (Intel)" <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	bpf@...r.kernel.org, puranjay12@...il.com
Subject: Re: [PATCH v2 1/2] arm64/arch_timer: include <linux/percpu.h>

On Fri, May 03, 2024 at 02:37:45PM +0530, Anshuman Khandual wrote:
> 
> 
> On 5/2/24 18:04, Puranjay Mohan wrote:
> > arch_timer.h includes linux/smp.h to use DEFINE_PER_CPU() and it works
> > because smp.h includes percpu.h. The next commit will remove percpu.h
> > from smp.h and it will break this usage.
> > 
> > Explicitly include percpu.h and remove smp.h
> 
> But this particular change does not seem to be necessary for changing
> raw_smp_processor_id() as current_thread_info()->cpu being done in the
> later patch ? You might still leave header <asm/percpu.h> inclusion in
> arch/arm64/include/asm/smp.h while dropping the per cpu cpu_number ?

Why would that be preferable?

The general rule is that if a file uses something explicitly, it should include
the relevant header directly rather than something that happens to transitively
include that header.

We made a mistake and included the wrong header in commit:

  6acc71ccac7187fc ("arm64: arch_timer: Allows a CPU-specific erratum to only affect a subset of CPUs")

.. so we should fix that regardless of the next patch.

The point of the next patch is to effectively revert commit:

  57c82954e77fa12c ("arm64: make cpu number a percpu variable")

.. and reverting that means we should stop including <asm/percpu.h> from
<asm/smp.h>; anything depending on that is already doing something wrong, and
leaving the include there only serves to paper over bugs.

Mark.

> 
> > 
> > Signed-off-by: Puranjay Mohan <puranjay@...nel.org>
> > ---
> >  arch/arm64/include/asm/arch_timer.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
> > index 934c658ee947..f5794d50f51d 100644
> > --- a/arch/arm64/include/asm/arch_timer.h
> > +++ b/arch/arm64/include/asm/arch_timer.h
> > @@ -15,7 +15,7 @@
> >  #include <linux/bug.h>
> >  #include <linux/init.h>
> >  #include <linux/jump_label.h>
> > -#include <linux/smp.h>
> > +#include <linux/percpu.h>
> >  #include <linux/types.h>
> >  
> >  #include <clocksource/arm_arch_timer.h>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ