All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/boot: Use __ASM_SIZE() to reduce ifdeffery in cpuflags.c
@ 2024-07-18  6:32 Uros Bizjak
  2024-07-18  6:35 ` H. Peter Anvin
  0 siblings, 1 reply; 10+ messages in thread
From: Uros Bizjak @ 2024-07-18  6:32 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Uros Bizjak, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H. Peter Anvin

Use __ASM_SIZE() macro to add correct insn suffix to pushf/popf.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
---
 arch/x86/boot/cpuflags.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/arch/x86/boot/cpuflags.c b/arch/x86/boot/cpuflags.c
index d75237ba7ce9..aacabe431fd5 100644
--- a/arch/x86/boot/cpuflags.c
+++ b/arch/x86/boot/cpuflags.c
@@ -2,6 +2,7 @@
 #include <linux/types.h>
 #include "bitops.h"
 
+#include <asm/asm.h>
 #include <asm/processor-flags.h>
 #include <asm/required-features.h>
 #include <asm/msr-index.h>
@@ -36,13 +37,8 @@ static int has_fpu(void)
  * compressed/ directory where it may be 64-bit code, and thus needs
  * to be 'pushfq' or 'popfq' in that case.
  */
-#ifdef __x86_64__
-#define PUSHF "pushfq"
-#define POPF "popfq"
-#else
-#define PUSHF "pushfl"
-#define POPF "popfl"
-#endif
+#define PUSHF __ASM_SIZE(pushf)
+#define POPF __ASM_SIZE(popf)
 
 int has_eflag(unsigned long mask)
 {
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-18 20:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-18  6:32 [PATCH] x86/boot: Use __ASM_SIZE() to reduce ifdeffery in cpuflags.c Uros Bizjak
2024-07-18  6:35 ` H. Peter Anvin
2024-07-18  6:46   ` Uros Bizjak
2024-07-18  6:58     ` H. Peter Anvin
2024-07-18  7:27       ` Uros Bizjak
2024-07-18  7:28         ` H. Peter Anvin
2024-07-18  8:52   ` Uros Bizjak
2024-07-18  8:55     ` H. Peter Anvin
2024-07-18  9:12       ` Uros Bizjak
2024-07-18 20:53         ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.