diff options
Diffstat (limited to 'include/asm-x86/irqflags.h')
-rw-r--r-- | include/asm-x86/irqflags.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h index c242527f970e..17e7a1701c97 100644 --- a/include/asm-x86/irqflags.h +++ b/include/asm-x86/irqflags.h | |||
@@ -111,14 +111,35 @@ static inline unsigned long __raw_local_irq_save(void) | |||
111 | #define DISABLE_INTERRUPTS(x) cli | 111 | #define DISABLE_INTERRUPTS(x) cli |
112 | 112 | ||
113 | #ifdef CONFIG_X86_64 | 113 | #ifdef CONFIG_X86_64 |
114 | #define SWAPGS swapgs | ||
115 | /* | ||
116 | * Currently paravirt can't handle swapgs nicely when we | ||
117 | * don't have a stack we can rely on (such as a user space | ||
118 | * stack). So we either find a way around these or just fault | ||
119 | * and emulate if a guest tries to call swapgs directly. | ||
120 | * | ||
121 | * Either way, this is a good way to document that we don't | ||
122 | * have a reliable stack. x86_64 only. | ||
123 | */ | ||
124 | #define SWAPGS_UNSAFE_STACK swapgs | ||
125 | |||
126 | #define PARAVIRT_ADJUST_EXCEPTION_FRAME /* */ | ||
127 | |||
114 | #define INTERRUPT_RETURN iretq | 128 | #define INTERRUPT_RETURN iretq |
115 | #define ENABLE_INTERRUPTS_SYSCALL_RET \ | 129 | #define USERGS_SYSRET64 \ |
116 | movq %gs:pda_oldrsp, %rsp; \ | 130 | swapgs; \ |
117 | swapgs; \ | 131 | sysretq; |
118 | sysretq; | 132 | #define USERGS_SYSRET32 \ |
133 | swapgs; \ | ||
134 | sysretl | ||
135 | #define ENABLE_INTERRUPTS_SYSEXIT32 \ | ||
136 | swapgs; \ | ||
137 | sti; \ | ||
138 | sysexit | ||
139 | |||
119 | #else | 140 | #else |
120 | #define INTERRUPT_RETURN iret | 141 | #define INTERRUPT_RETURN iret |
121 | #define ENABLE_INTERRUPTS_SYSCALL_RET sti; sysexit | 142 | #define ENABLE_INTERRUPTS_SYSEXIT sti; sysexit |
122 | #define GET_CR0_INTO_EAX movl %cr0, %eax | 143 | #define GET_CR0_INTO_EAX movl %cr0, %eax |
123 | #endif | 144 | #endif |
124 | 145 | ||
@@ -169,16 +190,6 @@ static inline void trace_hardirqs_fixup(void) | |||
169 | #else | 190 | #else |
170 | 191 | ||
171 | #ifdef CONFIG_X86_64 | 192 | #ifdef CONFIG_X86_64 |
172 | /* | ||
173 | * Currently paravirt can't handle swapgs nicely when we | ||
174 | * don't have a stack we can rely on (such as a user space | ||
175 | * stack). So we either find a way around these or just fault | ||
176 | * and emulate if a guest tries to call swapgs directly. | ||
177 | * | ||
178 | * Either way, this is a good way to document that we don't | ||
179 | * have a reliable stack. x86_64 only. | ||
180 | */ | ||
181 | #define SWAPGS_UNSAFE_STACK swapgs | ||
182 | #define ARCH_TRACE_IRQS_ON call trace_hardirqs_on_thunk | 193 | #define ARCH_TRACE_IRQS_ON call trace_hardirqs_on_thunk |
183 | #define ARCH_TRACE_IRQS_OFF call trace_hardirqs_off_thunk | 194 | #define ARCH_TRACE_IRQS_OFF call trace_hardirqs_off_thunk |
184 | #define ARCH_LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk | 195 | #define ARCH_LOCKDEP_SYS_EXIT call lockdep_sys_exit_thunk |