From nobody Sun Feb 8 10:03:48 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35F062045AE; Tue, 4 Mar 2025 10:26:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741083992; cv=none; b=NqvjWyFM8aI0Hn6lHZ4/TGuBtsHDjsM+dUk9wSwUcXpF2L6DpTsdXSj5cMyaupdut13CMV+CWay93iKZ1YUlS8fieAjtOmceAYbo/TfFShgdPGRLrJhNyT8p5S6tzfNmMZ1DN90FL5Amh748Hpelyk4mTGQVZYJqoPFctguB5BE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741083992; c=relaxed/simple; bh=6uEAJ8nD7fDYMEhw/EcoWoFmQyEslDZJFKt5CsJ8GCA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=tEfBGmExVhA1b2MpjfWVJDMEnqNiR9UZVgcccHkDJAmwJDW6VvjoAjLu2EnI74TNSIL+YnTDjxV2gkb3qn+ixJB1NbaghVrJaz0lKLicihxHp/cloHLhb++7/LmAXO//944lwza7fgL8rW43aYVr80O9J3WOV1hELLBkKelJ/+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=o+3un1Ow; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=FAbl5B3+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="o+3un1Ow"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FAbl5B3+" Date: Tue, 04 Mar 2025 10:26:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1741083988; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CHHe/QlEvJCZDxnMMZ6s6iM4BrQ+XxwIJ9j9GMaOkS4=; b=o+3un1OwvZ1VKbqkwYYsnfwyhaAZwGiRofXez0ZXu6/Dd5OX6tdUa7Fnv/7T9GnLqVoQ8v fVuTLk2Y10EKoELMlSCVfIM+FXEfVq9bpGJiG6S9ZfJXR/YrG9tVxzT7PnTUUYeXzzOzWD fpoKWe8mo0zrr2BPCZx9Ai7f3YCpE+X+RPOf198L/Px+1ZSmVov8piHKb/qfq65niI7q0K p3rjCx7UXPoE/oZHlJY2FBpIXcxLLLXAwZHNFxWhv7FhjeGzk2/hbsv8gHVOE9MB4lTgIK T5K2tLEdvxgijSx4pIW7gwDWEwrqKj7Tz8ux6hFg3xQt3lVbfHtWFAyN5nl5Dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1741083988; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CHHe/QlEvJCZDxnMMZ6s6iM4BrQ+XxwIJ9j9GMaOkS4=; b=FAbl5B3+qfhNANqVrP6wcNxQ4Bx8YowQDSnwKXBG9ALdQN7OgDLpxdXkqhAPa9bQdERkpA GGnJ/OjPWe9tbIAA== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/smp: Fix mwait_play_dead() and acpi_processor_ffh_play_dead() noreturn behavior Cc: "Paul E. McKenney" , Josh Poimboeuf , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174108398752.14745.6850468204610985728.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 4e32645cd8f97a308300623f81c902747df6b97b Gitweb: https://git.kernel.org/tip/4e32645cd8f97a308300623f81c902747= df6b97b Author: Josh Poimboeuf AuthorDate: Sun, 02 Mar 2025 16:48:51 -08:00 Committer: Ingo Molnar CommitterDate: Tue, 04 Mar 2025 11:14:25 +01:00 x86/smp: Fix mwait_play_dead() and acpi_processor_ffh_play_dead() noreturn = behavior Fix some related issues (done in a single patch to avoid introducing intermediate bisect warnings): 1) The SMP version of mwait_play_dead() doesn't return, but its !SMP counterpart does. Make its calling behavior consistent by resolving the !SMP version to a BUG(). It should never be called anyway, this just enforces that at runtime and enables its callers to be marked as __noreturn. 2) While the SMP definition of mwait_play_dead() is annotated as __noreturn, the declaration isn't. Nor is it listed in tools/objtool/noreturns.h. Fix that. 3) Similar to #1, the SMP version of acpi_processor_ffh_play_dead() doesn't return but its !SMP counterpart does. Make the !SMP version a BUG(). It should never be called. 4) acpi_processor_ffh_play_dead() doesn't return, but is lacking any __noreturn annotations. Fix that. This fixes the following objtool warnings: vmlinux.o: warning: objtool: acpi_processor_ffh_play_dead+0x67: mwait_pla= y_dead() is missing a __noreturn annotation vmlinux.o: warning: objtool: acpi_idle_play_dead+0x3c: acpi_processor_ffh= _play_dead() is missing a __noreturn annotation Fixes: a7dd183f0b38 ("x86/smp: Allow calling mwait_play_dead with an arbitr= ary hint") Fixes: 541ddf31e300 ("ACPI/processor_idle: Add FFH state handling") Reported-by: Paul E. McKenney Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Tested-by: Paul E. McKenney Link: https://lore.kernel.org/r/e885c6fa9e96a61471b33e48c2162d28b15b14c5.17= 40962711.git.jpoimboe@kernel.org --- arch/x86/include/asm/smp.h | 4 ++-- arch/x86/kernel/acpi/cstate.c | 2 +- include/acpi/processor.h | 6 +++--- tools/objtool/noreturns.h | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 80f8bfd..1d3b11e 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -114,7 +114,7 @@ void wbinvd_on_cpu(int cpu); int wbinvd_on_all_cpus(void); =20 void smp_kick_mwait_play_dead(void); -void mwait_play_dead(unsigned int eax_hint); +void __noreturn mwait_play_dead(unsigned int eax_hint); =20 void native_smp_send_reschedule(int cpu); void native_send_call_func_ipi(const struct cpumask *mask); @@ -166,7 +166,7 @@ static inline struct cpumask *cpu_llc_shared_mask(int c= pu) return (struct cpumask *)cpumask_of(0); } =20 -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 */ =20 #ifdef CONFIG_DEBUG_NMI_SELFTEST diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 86c87c0..d255842 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -206,7 +206,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, } EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); =20 -void acpi_processor_ffh_play_dead(struct acpi_processor_cx *cx) +void __noreturn acpi_processor_ffh_play_dead(struct acpi_processor_cx *cx) { unsigned int cpu =3D smp_processor_id(); struct cstate_entry *percpu_entry; diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 63a37e7..d0eccbd 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -280,7 +280,7 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, struct acpi_processor_cx *cx, struct acpi_power_register *reg); void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx *cstate); -void acpi_processor_ffh_play_dead(struct acpi_processor_cx *cx); +void __noreturn acpi_processor_ffh_play_dead(struct acpi_processor_cx *cx); #else static inline void acpi_processor_power_init_bm_check(struct acpi_processor_flags @@ -301,9 +301,9 @@ static inline void acpi_processor_ffh_cstate_enter(stru= ct acpi_processor_cx { return; } -static inline void acpi_processor_ffh_play_dead(struct acpi_processor_cx *= cx) +static inline void __noreturn acpi_processor_ffh_play_dead(struct acpi_pro= cessor_cx *cx) { - return; + BUG(); } #endif =20 diff --git a/tools/objtool/noreturns.h b/tools/objtool/noreturns.h index b217489..5a4aec4 100644 --- a/tools/objtool/noreturns.h +++ b/tools/objtool/noreturns.h @@ -16,6 +16,7 @@ NORETURN(__tdx_hypercall_failed) NORETURN(__ubsan_handle_builtin_unreachable) NORETURN(__x64_sys_exit) NORETURN(__x64_sys_exit_group) +NORETURN(acpi_processor_ffh_play_dead) NORETURN(arch_cpu_idle_dead) NORETURN(bch2_trans_in_restart_error) NORETURN(bch2_trans_restart_error) @@ -34,6 +35,7 @@ NORETURN(kunit_try_catch_throw) NORETURN(machine_real_restart) NORETURN(make_task_dead) NORETURN(mpt_halt_firmware) +NORETURN(mwait_play_dead) NORETURN(nmi_panic_self_stop) NORETURN(panic) NORETURN(panic_smp_self_stop)