aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/entry/entry_32.S5
-rw-r--r--arch/x86/entry/entry_64_compat.S10
-rw-r--r--arch/x86/include/asm/cpufeature.h1
-rw-r--r--arch/x86/xen/enlighten.c4
4 files changed, 13 insertions, 7 deletions
diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 3eb572ed3d7a..0870825a9568 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -308,8 +308,9 @@ sysenter_past_esp:
308 308
309 movl %esp, %eax 309 movl %esp, %eax
310 call do_fast_syscall_32 310 call do_fast_syscall_32
311 testl %eax, %eax 311 /* XEN PV guests always use IRET path */
312 jz .Lsyscall_32_done 312 ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
313 "jmp .Lsyscall_32_done", X86_FEATURE_XENPV
313 314
314/* Opportunistic SYSEXIT */ 315/* Opportunistic SYSEXIT */
315 TRACE_IRQS_ON /* User mode traces as IRQs on. */ 316 TRACE_IRQS_ON /* User mode traces as IRQs on. */
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index c3201830a85e..402e34a21559 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -121,8 +121,9 @@ sysenter_flags_fixed:
121 121
122 movq %rsp, %rdi 122 movq %rsp, %rdi
123 call do_fast_syscall_32 123 call do_fast_syscall_32
124 testl %eax, %eax 124 /* XEN PV guests always use IRET path */
125 jz .Lsyscall_32_done 125 ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
126 "jmp .Lsyscall_32_done", X86_FEATURE_XENPV
126 jmp sysret32_from_system_call 127 jmp sysret32_from_system_call
127 128
128sysenter_fix_flags: 129sysenter_fix_flags:
@@ -200,8 +201,9 @@ ENTRY(entry_SYSCALL_compat)
200 201
201 movq %rsp, %rdi 202 movq %rsp, %rdi
202 call do_fast_syscall_32 203 call do_fast_syscall_32
203 testl %eax, %eax 204 /* XEN PV guests always use IRET path */
204 jz .Lsyscall_32_done 205 ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
206 "jmp .Lsyscall_32_done", X86_FEATURE_XENPV
205 207
206 /* Opportunistic SYSRET */ 208 /* Opportunistic SYSRET */
207sysret32_from_system_call: 209sysret32_from_system_call:
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index e4f8010f22e0..f7ba9fbf12ee 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -216,6 +216,7 @@
216#define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */ 216#define X86_FEATURE_PAUSEFILTER ( 8*32+13) /* AMD filtered pause intercept */
217#define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */ 217#define X86_FEATURE_PFTHRESHOLD ( 8*32+14) /* AMD pause filter threshold */
218#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */ 218#define X86_FEATURE_VMMCALL ( 8*32+15) /* Prefer vmmcall to vmcall */
219#define X86_FEATURE_XENPV ( 8*32+16) /* "" Xen paravirtual guest */
219 220
220 221
221/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */ 222/* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 5774800ff583..d315151411e5 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1886,8 +1886,10 @@ EXPORT_SYMBOL_GPL(xen_hvm_need_lapic);
1886 1886
1887static void xen_set_cpu_features(struct cpuinfo_x86 *c) 1887static void xen_set_cpu_features(struct cpuinfo_x86 *c)
1888{ 1888{
1889 if (xen_pv_domain()) 1889 if (xen_pv_domain()) {
1890 clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS); 1890 clear_cpu_bug(c, X86_BUG_SYSRET_SS_ATTRS);
1891 set_cpu_cap(c, X86_FEATURE_XENPV);
1892 }
1891} 1893}
1892 1894
1893const struct hypervisor_x86 x86_hyper_xen = { 1895const struct hypervisor_x86 x86_hyper_xen = {