summaryrefslogtreecommitdiffstats
path: root/include/asm-x86/processor.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 13:32:08 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:32:08 +0100
commite801f864ec7e5b149bd05337800e419f408523bb (patch)
treecdab4ec9635926756f58398469621031a2f34ae4 /include/asm-x86/processor.h
parent4a8c4c4e10d1bc2c3bd80caabb6a76a66849f7e8 (diff)
x86: adds paravirt hook for swapgs
This patch adds paravirt hook for swapgs operation, which is a privileged operation in x86_64. 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.h')
-rw-r--r--include/asm-x86/processor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index e6fa06fee72..72740c6f110 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -435,6 +435,13 @@ static inline void native_load_sp0(struct tss_struct *tss,
#endif
}
+static inline void native_swapgs(void)
+{
+#ifdef CONFIG_X86_64
+ asm volatile("swapgs" ::: "memory");
+#endif
+}
+
#ifdef CONFIG_PARAVIRT
#include <asm/paravirt.h>
#else
@@ -456,6 +463,7 @@ static inline void load_sp0(struct tss_struct *tss,
}
#define set_iopl_mask native_set_iopl_mask
+#define SWAPGS swapgs
#endif /* CONFIG_PARAVIRT */
/*