mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 12:14:06 +00:00
x86/gsseg: Move load_gs_index() to its own new header file
GS is a special segment on x86_64, move load_gs_index() to its own new header file to simplify header inclusion. No change in functionality. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com> Signed-off-by: Xin Li <xin3.li@intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20230112072032.35626-5-xin3.li@intel.com
This commit is contained in:
parent
df729fb05a
commit
ae53fa1870
6 changed files with 45 additions and 21 deletions
41
arch/x86/include/asm/gsseg.h
Normal file
41
arch/x86/include/asm/gsseg.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_X86_GSSEG_H
|
||||
#define _ASM_X86_GSSEG_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/asm.h>
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/alternative.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/nops.h>
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
|
||||
extern asmlinkage void asm_load_gs_index(u16 selector);
|
||||
|
||||
static inline void native_load_gs_index(unsigned int selector)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
asm_load_gs_index(selector);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_X86_64 */
|
||||
|
||||
#ifndef CONFIG_PARAVIRT_XXL
|
||||
|
||||
static inline void load_gs_index(unsigned int selector)
|
||||
{
|
||||
#ifdef CONFIG_X86_64
|
||||
native_load_gs_index(selector);
|
||||
#else
|
||||
loadsegment(gs, selector);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PARAVIRT_XXL */
|
||||
|
||||
#endif /* _ASM_X86_GSSEG_H */
|
|
@ -12,6 +12,7 @@
|
|||
#include <asm/tlbflush.h>
|
||||
#include <asm/paravirt.h>
|
||||
#include <asm/debugreg.h>
|
||||
#include <asm/gsseg.h>
|
||||
|
||||
extern atomic64_t last_mm_ctx_id;
|
||||
|
||||
|
|
|
@ -120,17 +120,6 @@ static inline void native_wbinvd(void)
|
|||
asm volatile("wbinvd": : :"memory");
|
||||
}
|
||||
|
||||
extern asmlinkage void asm_load_gs_index(u16 selector);
|
||||
|
||||
static inline void native_load_gs_index(unsigned int selector)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
local_irq_save(flags);
|
||||
asm_load_gs_index(selector);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static inline unsigned long __read_cr4(void)
|
||||
{
|
||||
return native_read_cr4();
|
||||
|
@ -184,16 +173,6 @@ static inline void wbinvd(void)
|
|||
native_wbinvd();
|
||||
}
|
||||
|
||||
|
||||
static inline void load_gs_index(unsigned int selector)
|
||||
{
|
||||
#ifdef CONFIG_X86_64
|
||||
native_load_gs_index(selector);
|
||||
#else
|
||||
loadsegment(gs, selector);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_PARAVIRT_XXL */
|
||||
|
||||
static inline void clflush(volatile void *__p)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <asm/special_insns.h>
|
||||
#include <asm/tlb.h>
|
||||
#include <asm/io_bitmap.h>
|
||||
#include <asm/gsseg.h>
|
||||
|
||||
/*
|
||||
* nop stub, which must not clobber anything *including the stack* to
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <asm/sigframe.h>
|
||||
#include <asm/sighandling.h>
|
||||
#include <asm/smap.h>
|
||||
#include <asm/gsseg.h>
|
||||
|
||||
#ifdef CONFIG_IA32_EMULATION
|
||||
#include <asm/ia32_unistd.h>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <asm/ldt.h>
|
||||
#include <asm/processor.h>
|
||||
#include <asm/proto.h>
|
||||
#include <asm/gsseg.h>
|
||||
|
||||
#include "tls.h"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue