diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:31 -0500 |
commit | 7818a1e0294debee02d5135e17b89f28b8871887 (patch) | |
tree | 251473910cddc3c2889407cde8f6f962dc14e88f /include/asm-x86/processor_32.h | |
parent | ca241c75037b32e0216a68e39ad2801d04fa1f87 (diff) |
x86: provide 64-bit with a load_sp0 function.
Paravirt guests need to inform the underlying hypervisor whenever the sp0
tss field changes. i386 already has such a function, and we use it for
x86_64 too. There's an unnecessary (for 64-bit) msr handling part in the original
version, and it is placed around an ifdef. Making no more sense in
processor_32.h, it is moved to the common header
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/processor_32.h')
-rw-r--r-- | include/asm-x86/processor_32.h | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h index 57b345bc3c74..53037d1a6ae6 100644 --- a/include/asm-x86/processor_32.h +++ b/include/asm-x86/processor_32.h | |||
@@ -278,26 +278,6 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
278 | 278 | ||
279 | #define KSTK_ESP(task) (task_pt_regs(task)->sp) | 279 | #define KSTK_ESP(task) (task_pt_regs(task)->sp) |
280 | 280 | ||
281 | static inline void native_load_sp0(struct tss_struct *tss, struct thread_struct *thread) | ||
282 | { | ||
283 | tss->x86_tss.sp0 = thread->sp0; | ||
284 | /* This can only happen when SEP is enabled, no need to test "SEP"arately */ | ||
285 | if (unlikely(tss->x86_tss.ss1 != thread->sysenter_cs)) { | ||
286 | tss->x86_tss.ss1 = thread->sysenter_cs; | ||
287 | wrmsr(MSR_IA32_SYSENTER_CS, thread->sysenter_cs, 0); | ||
288 | } | ||
289 | } | ||
290 | |||
291 | #ifdef CONFIG_PARAVIRT | ||
292 | #include <asm/paravirt.h> | ||
293 | #else | ||
294 | |||
295 | static inline void load_sp0(struct tss_struct *tss, struct thread_struct *thread) | ||
296 | { | ||
297 | native_load_sp0(tss, thread); | ||
298 | } | ||
299 | #endif /* CONFIG_PARAVIRT */ | ||
300 | |||
301 | /* generic versions from gas */ | 281 | /* generic versions from gas */ |
302 | #define GENERIC_NOP1 ".byte 0x90\n" | 282 | #define GENERIC_NOP1 ".byte 0x90\n" |
303 | #define GENERIC_NOP2 ".byte 0x89,0xf6\n" | 283 | #define GENERIC_NOP2 ".byte 0x89,0xf6\n" |