Skip to content

Commit df729fb

Browse files
H. Peter Anvin (Intel)Ingo Molnar
authored andcommitted
x86/gsseg: Make asm_load_gs_index() take an u16
Let GCC know that only the low 16 bits of load_gs_index() argument actually matter. It might allow it to create slightly better code. However, do not propagate this into the prototypes of functions that end up being paravirtualized, to avoid unnecessary changes. Signed-off-by: H. Peter Anvin (Intel) <[email protected]> Signed-off-by: Xin Li <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5a91f12 commit df729fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/x86/entry/entry_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ _ASM_NOKPROBE(common_interrupt_return)
782782

783783
/*
784784
* Reload gs selector with exception handling
785-
* edi: new selector
785+
* di: new selector
786786
*
787787
* Is in entry.text as it shouldn't be instrumented.
788788
*/

arch/x86/include/asm/special_insns.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static inline void native_wbinvd(void)
120120
asm volatile("wbinvd": : :"memory");
121121
}
122122

123-
extern asmlinkage void asm_load_gs_index(unsigned int selector);
123+
extern asmlinkage void asm_load_gs_index(u16 selector);
124124

125125
static inline void native_load_gs_index(unsigned int selector)
126126
{

0 commit comments

Comments
 (0)