public inbox for linux-hyperv@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v2 1/3] x86: Use MOVL when reading segment registers
@ 2026-01-05  9:02 Uros Bizjak
  2026-01-05  9:02 ` [PATCH RESEND v2 2/3] x86/hyperv: Use savesegment() instead of inline asm() to save " Uros Bizjak
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Uros Bizjak @ 2026-01-05  9:02 UTC (permalink / raw)
  To: linux-hyperv, x86, linux-kernel
  Cc: Uros Bizjak, Michael Kelley, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, H. Peter Anvin

Use MOVL when reading segment registers to avoid 0x66 operand-size
override insn prefix. The segment value is always 16-bit and gets
zero-extended to the full 32-bit size.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Tested-by: Michael Kelley <mhklinux@outlook.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/include/asm/segment.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h
index f59ae7186940..9f5be2bbd291 100644
--- a/arch/x86/include/asm/segment.h
+++ b/arch/x86/include/asm/segment.h
@@ -348,7 +348,7 @@ static inline void __loadsegment_fs(unsigned short value)
  * Save a segment register away:
  */
 #define savesegment(seg, value)				\
-	asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
+	asm("movl %%" #seg ",%k0" : "=r" (value) : : "memory")
 
 #endif /* !__ASSEMBLER__ */
 #endif /* __KERNEL__ */
-- 
2.52.0


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

end of thread, other threads:[~2026-01-19 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05  9:02 [PATCH RESEND v2 1/3] x86: Use MOVL when reading segment registers Uros Bizjak
2026-01-05  9:02 ` [PATCH RESEND v2 2/3] x86/hyperv: Use savesegment() instead of inline asm() to save " Uros Bizjak
2026-01-19 16:22   ` H. Peter Anvin
2026-01-05  9:02 ` [PATCH RESEND v2 3/3] x86/hyperv: Remove ASM_CALL_CONSTRAINT with VMMCALL insn Uros Bizjak
2026-01-19 16:23   ` H. Peter Anvin
2026-01-19 16:22 ` [PATCH RESEND v2 1/3] x86: Use MOVL when reading segment registers H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox