[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250301014114.fasws3rh5ubxobbe@jpoimboe>
Date: Fri, 28 Feb 2025 17:41:14 -0800
From: Josh Poimboeuf <jpoimboe@...nel.org>
To: "Paul E. McKenney" <paulmck@...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 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:
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