diff options
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index cede9ad3dc6e..b1ea52156362 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -193,8 +193,22 @@ static inline void native_set_iopl_mask(unsigned mask) | |||
193 | #endif | 193 | #endif |
194 | } | 194 | } |
195 | 195 | ||
196 | static inline void native_load_sp0(struct tss_struct *tss, | ||
197 | struct thread_struct *thread) | ||
198 | { | ||
199 | tss->x86_tss.sp0 = thread->sp0; | ||
200 | #ifdef CONFIG_X86_32 | ||
201 | /* Only happens when SEP is enabled, no need to test "SEP"arately */ | ||
202 | if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) { | ||
203 | tss->x86_tss.ss1 = thread->sysenter_cs; | ||
204 | wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); | ||
205 | } | ||
206 | #endif | ||
207 | } | ||
196 | 208 | ||
197 | #ifndef CONFIG_PARAVIRT | 209 | #ifdef CONFIG_PARAVIRT |
210 | #include <asm/paravirt.h> | ||
211 | #else | ||
198 | #define __cpuid native_cpuid | 212 | #define __cpuid native_cpuid |
199 | #define paravirt_enabled() 0 | 213 | #define paravirt_enabled() 0 |
200 | 214 | ||
@@ -206,6 +220,12 @@ static inline void native_set_iopl_mask(unsigned mask) | |||
206 | #define set_debugreg(value, register) \ | 220 | #define set_debugreg(value, register) \ |
207 | native_set_debugreg(register, value) | 221 | native_set_debugreg(register, value) |
208 | 222 | ||
223 | static inline void load_sp0(struct tss_struct *tss, | ||
224 | struct thread_struct *thread) | ||
225 | { | ||
226 | native_load_sp0(tss, thread); | ||
227 | } | ||
228 | |||
209 | #define set_iopl_mask native_set_iopl_mask | 229 | #define set_iopl_mask native_set_iopl_mask |
210 | #endif /* CONFIG_PARAVIRT */ | 230 | #endif /* CONFIG_PARAVIRT */ |
211 | 231 | ||