[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027125045.GX4067720@noisy.programming.kicks-ass.net>
Date: Mon, 27 Oct 2025 13:50:45 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Waiman Long <longman@...hat.com>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: x86/smpboot: Question regarding native_play_dead() __noreturn
warning
On Mon, Oct 27, 2025 at 01:23:02PM +0100, Thorsten Blum wrote:
> Hi,
>
> I just came across this comment in arch/x86/kernel/smpboot.c:
>
> /*
> * native_play_dead() is essentially a __noreturn function, but it can't
> * be marked as such as the compiler may complain about it.
> */
> void native_play_dead(void) {
> ...
> }
>
> and when I mark native_play_dead() as __noreturn, neither gcc nor clang
> complain about it.
>
> The commit message 2743fe89d4d4 ("x86/idle: Disable IBRS when CPU is
> offline to improve single-threaded performance") says:
>
> "Add a comment to say that native_play_dead() is a __noreturn function,
> but it can't be marked as such to avoid confusion about the missing
> MSR restoration code."
>
> Unfortunately, that doesn't really help me either. Can someone explain
> what the issue was and if the comment is still valid? Otherwise, I'd
> like to submit a patch adding __noreturn and removing the comment.
I'm not sure either, it wasn't there in v2 but appeared in v3.
v2: 20230620140625.1001886-3-longman@...hat.com
v3: 20230622003603.1188364-2-longman@...hat.com
The difference is that v2 tried to restore the msr after 'play_dead'
which is silly, since it would never reach that code. v3 removed that
dead restore code and added the confusing comment.
There is a clue here though:
20230622054053.uy577qezu5a65buc@...ble
Josh suggests play_dead() should be marked noreturn (which it is in
current kernels).
Waiman then replies:
921e1b98-af36-1f51-5abe-dea36425b706@...hat.com
which is utterly confused again.
Powered by blists - more mailing lists