Replace direct 'movl' instructions for DS, ES, FS, and GS read in
__show_regs() with the savesegment() helper. This improves
readability, consistency, and ensures proper handling of
segment registers on x86_64.
No functional change intended.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://patch.msgid.link/20260330085938.67985-2-ubizjak@gmail.com
return;
}
- asm("movl %%ds,%0" : "=r" (ds));
- asm("movl %%es,%0" : "=r" (es));
- asm("movl %%fs,%0" : "=r" (fsindex));
- asm("movl %%gs,%0" : "=r" (gsindex));
+ savesegment(ds, ds);
+ savesegment(es, es);
+ savesegment(fs, fsindex);
+ savesegment(gs, gsindex);
rdmsrq(MSR_FS_BASE, fs);
rdmsrq(MSR_GS_BASE, gs);