mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
x86/segment: Use MOVL when reading segment registers
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. Example: 4e4: 66 8c c0 mov %es,%ax 4e7: 66 89 83 80 0b 00 00 mov %ax,0xb80(%rbx) 4e4: 8c c0 mov %es,%eax 4e6: 66 89 83 80 0b 00 00 mov %ax,0xb80(%rbx) Also, use the %k0 modifier which generates the SImode (signed integer) register name for the target register. [ bp: Extend and clarify commit message. ] Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com> Tested-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/20260105090422.6243-1-ubizjak@gmail.com
This commit is contained in:
parent
59cac9d52b
commit
53ed3d91a1
1 changed files with 1 additions and 1 deletions
|
|
@ -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__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue