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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f039afdc-22e5-4f6a-9550-bd28dd0f8686@paulmck-laptop>
Date: Sat, 1 Mar 2025 04:18:14 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: patryk.wlazlyn@...ux.intel.com, artem.bityutskiy@...ux.intel.com,
	dave.hansen@...ux.intel.com, gautham.shenoy@....com,
	rafael.j.wysocki@...el.com, linux-kernel@...r.kernel.org,
	sfr@...b.auug.org.au, peterz@...radead.org
Subject: Re: [BUG objtool,x86] Missing __noreturn annotation in
 acpi_processor_ffh_play_dead()

On Fri, Feb 28, 2025 at 05:41:14PM -0800, Josh Poimboeuf wrote:
> On Fri, Feb 28, 2025 at 04:33:23PM -0800, Paul E. McKenney wrote:
> > Aha!  The tools/objtool/noreturns.h is either new to me or was forgotten
> > by me.  ;-)
> > 
> > This does indeed handle the objtool warnings for CONFIG_SMP=y builds,
> > so thank you!
> > 
> > But for CONFIG_SMP=n builds, I get the following:
> > 
> > arch/x86/kernel/acpi/cstate.c: In function ‘acpi_processor_ffh_play_dead’:
> > arch/x86/kernel/acpi/cstate.c:216:1: error: ‘noreturn’ function does return [-Werror
> > 
> > And in this build configuration, it does look like mwait_play_dead is an
> > empty static inline function.  I could imagine making that __noreturn be
> > a CPP macro, but I could also imagine making mwait_play_dead() refrain
> > from returning.
> 
> "play_dead" is an SMP thing and should never be called on non-SMP.  And
> it's a very good idea for noreturn behavior to be consistent across
> configs anyway.
> 
> So yeah, I think it's as simple:

And that passes my tests, thank you!

Tested-by: Paul E. McKenney <paulmck@...nel.org>

> diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
> index 80f8bfd83fc7..32990e7396e0 100644
> --- a/arch/x86/include/asm/smp.h
> +++ b/arch/x86/include/asm/smp.h
> @@ -166,7 +166,7 @@ static inline struct cpumask *cpu_llc_shared_mask(int cpu)
>  	return (struct cpumask *)cpumask_of(0);
>  }
>  
> -static inline void mwait_play_dead(unsigned int eax_hint) { }
> +static inline void __noreturn mwait_play_dead(unsigned int eax_hint) { BUG(); }
>  #endif /* CONFIG_SMP */
>  
>  #ifdef CONFIG_DEBUG_NMI_SELFTEST

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ