* [tip: x86/fpu] x86/fpu: Fully optimize out WARN_ON_FPU()
@ 2025-02-10 22:58 tip-bot2 for Eric Biggers
0 siblings, 0 replies; only message in thread
From: tip-bot2 for Eric Biggers @ 2025-02-10 22:58 UTC (permalink / raw)
To: linux-tip-commits
Cc: Sean Christopherson, Eric Biggers, Dave Hansen, x86, linux-kernel
The following commit has been merged into the x86/fpu branch of tip:
Commit-ID: ccb7735a1ea22621f21c3133e4f5f3da5fe5f5b7
Gitweb: https://git.kernel.org/tip/ccb7735a1ea22621f21c3133e4f5f3da5fe5f5b7
Author: Eric Biggers <ebiggers@google.com>
AuthorDate: Mon, 27 Jan 2025 14:45:23 -08:00
Committer: Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Mon, 10 Feb 2025 14:45:59 -08:00
x86/fpu: Fully optimize out WARN_ON_FPU()
Currently WARN_ON_FPU evaluates its argument even if
CONFIG_X86_DEBUG_FPU is disabled, which adds unnecessary instructions to
several functions, for example kernel_fpu_begin(). Fix this by using
BUILD_BUG_ON_INVALID(x) in the no-debug case rather than (void)(x).
Fixes: 83242c515881 ("x86/fpu: Make WARN_ON_FPU() more robust in the !CONFIG_X86_DEBUG_FPU case")
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20250127224523.94300-1-ebiggers%40kernel.org
---
arch/x86/kernel/fpu/internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/fpu/internal.h b/arch/x86/kernel/fpu/internal.h
index dbdb31f..975de07 100644
--- a/arch/x86/kernel/fpu/internal.h
+++ b/arch/x86/kernel/fpu/internal.h
@@ -18,7 +18,7 @@ static __always_inline __pure bool use_fxsr(void)
#ifdef CONFIG_X86_DEBUG_FPU
# define WARN_ON_FPU(x) WARN_ON_ONCE(x)
#else
-# define WARN_ON_FPU(x) ({ (void)(x); 0; })
+# define WARN_ON_FPU(x) ({ BUILD_BUG_ON_INVALID(x); 0; })
#endif
/* Used in init.c */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-02-10 22:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-10 22:58 [tip: x86/fpu] x86/fpu: Fully optimize out WARN_ON_FPU() tip-bot2 for Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®