Skip to content

Commit 203d891

Browse files
Brian Gerstsuryasaimadhu
authored andcommitted
x86/asm: Merge load_gs_index()
Merge the 32- and 64-bit implementations of load_gs_index(). Signed-off-by: Brian Gerst <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Andy Lutomirski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3a24a60 commit 203d891

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

arch/x86/include/asm/segment.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,6 @@ static inline void __loadsegment_fs(unsigned short value)
350350
#define savesegment(seg, value) \
351351
asm("mov %%" #seg ",%0":"=r" (value) : : "memory")
352352

353-
/*
354-
* x86-32 user GS accessors. This is ugly and could do with some cleaning up.
355-
*/
356-
#ifdef CONFIG_X86_32
357-
# define load_gs_index(v) loadsegment(gs, (v))
358-
#endif /* X86_32 */
359-
360353
#endif /* !__ASSEMBLY__ */
361354
#endif /* __KERNEL__ */
362355

arch/x86/include/asm/special_insns.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,15 @@ static inline void wbinvd(void)
184184
native_wbinvd();
185185
}
186186

187-
#ifdef CONFIG_X86_64
188187

189188
static inline void load_gs_index(unsigned int selector)
190189
{
190+
#ifdef CONFIG_X86_64
191191
native_load_gs_index(selector);
192-
}
193-
192+
#else
193+
loadsegment(gs, selector);
194194
#endif
195+
}
195196

196197
#endif /* CONFIG_PARAVIRT_XXL */
197198

0 commit comments

Comments
 (0)