From: Uros Bizjak Date: Mon, 30 Mar 2026 08:59:22 +0000 (+0200) Subject: x86/process/32: Use correct type for 'gs' variable in __show_regs() to avoid zero... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6829f19810e96903d7b532145c3d1701b4d9a0f6;p=thirdparty%2Fkernel%2Flinux.git x86/process/32: Use correct type for 'gs' variable in __show_regs() to avoid zero-extension Change the type of 'gs' variable in __show_regs() from 'unsigned short' to 'unsigned int'. This prevents unwanted zero-extension when storing the 16-bit segment register into a wider general purpose register. The code improves from: 50: 8c ee mov %gs,%esi 52: 0f b7 f6 movzwl %si,%esi ... be: 89 74 24 14 mov %esi,0x14(%esp) to: 50: 8c ef mov %gs,%edi ... bb: 89 7c 24 14 mov %edi,0x14(%esp) No functional change intended. Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: H. Peter Anvin Cc: Linus Torvalds Link: https://patch.msgid.link/20260330085938.67985-3-ubizjak@gmail.com --- diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 3ef15c2f152f7..168dabf9853fb 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -61,7 +61,7 @@ void __show_regs(struct pt_regs *regs, enum show_regs_mode mode, { unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; unsigned long d0, d1, d2, d3, d6, d7; - unsigned short gs; + unsigned int gs; savesegment(gs, gs);