diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:32:08 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:08 -0500 |
commit | e801f864ec7e5b149bd05337800e419f408523bb (patch) | |
tree | cdab4ec9635926756f58398469621031a2f34ae4 /include/asm-x86/paravirt.h | |
parent | 4a8c4c4e10d1bc2c3bd80caabb6a76a66849f7e8 (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/paravirt.h')
-rw-r--r-- | include/asm-x86/paravirt.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h index 7d1c126e2249..e8fbf742d425 100644 --- a/include/asm-x86/paravirt.h +++ b/include/asm-x86/paravirt.h | |||
@@ -127,6 +127,8 @@ struct pv_cpu_ops { | |||
127 | void (*irq_enable_syscall_ret)(void); | 127 | void (*irq_enable_syscall_ret)(void); |
128 | void (*iret)(void); | 128 | void (*iret)(void); |
129 | 129 | ||
130 | void (*swapgs)(void); | ||
131 | |||
130 | struct pv_lazy_ops lazy_mode; | 132 | struct pv_lazy_ops lazy_mode; |
131 | }; | 133 | }; |
132 | 134 | ||
@@ -1228,6 +1230,13 @@ static inline unsigned long __raw_local_irq_save(void) | |||
1228 | call *pv_cpu_ops+PV_CPU_read_cr0; \ | 1230 | call *pv_cpu_ops+PV_CPU_read_cr0; \ |
1229 | pop %edx; pop %ecx | 1231 | pop %edx; pop %ecx |
1230 | #else | 1232 | #else |
1233 | #define SWAPGS \ | ||
1234 | PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \ | ||
1235 | PV_SAVE_REGS; \ | ||
1236 | call *pv_cpu_ops+PV_CPU_swapgs; \ | ||
1237 | PV_RESTORE_REGS \ | ||
1238 | ) | ||
1239 | |||
1231 | #define GET_CR2_INTO_RCX \ | 1240 | #define GET_CR2_INTO_RCX \ |
1232 | call *pv_mmu_ops+PV_MMU_read_cr2; \ | 1241 | call *pv_mmu_ops+PV_MMU_read_cr2; \ |
1233 | movq %rax, %rcx; \ | 1242 | movq %rax, %rcx; \ |