]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/cpu: Use cpu_has_sep for configuring the SYSENTER MSRs
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 26 Apr 2019 10:19:07 +0000 (11:19 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:37 +0000 (10:35 +0100)
Currently, configuration of the SYSENTER MSRs are behind a vendor check for
Intel and Centaur, but this misses Zhaoxin.

Use the feature bit, rather than a vendor check.  cpu_has_sep is cleared early
for AMD processors, which can't use SYSENTER/SYSEXIT when operating in long
mode.

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/suspend.c
xen/arch/x86/x86_64/traps.c

index 9e69bf2b8b27cef54f9543c26d5979b4101cfea4..ba9d2e13a781aa64ec0a4dac4e846983a8c88f27 100644 (file)
@@ -27,11 +27,13 @@ void save_rest_processor_state(void)
     rdmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
     rdmsrl(MSR_CSTAR, saved_cstar);
     rdmsrl(MSR_LSTAR, saved_lstar);
-    if ( boot_cpu_data.x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR) )
+
+    if ( cpu_has_sep )
     {
         rdmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
         rdmsrl(MSR_IA32_SYSENTER_EIP, saved_sysenter_eip);
     }
+
     if ( cpu_has_xsave )
         saved_xcr0 = get_xcr0();
 }
@@ -51,7 +53,7 @@ void restore_rest_processor_state(void)
     wrgsbase(saved_gs_base);
     wrmsrl(MSR_SHADOW_GS_BASE, saved_kernel_gs_base);
 
-    if ( boot_cpu_data.x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR) )
+    if ( cpu_has_sep )
     {
         /* Recover sysenter MSRs */
         wrmsrl(MSR_IA32_SYSENTER_ESP, saved_sysenter_esp);
index 44af765e3e6c6df94ee11eec19d25082e16d6a3f..cb4bf0a271e1bc9cbb1811a96362f0e0279ad6bf 100644 (file)
@@ -334,7 +334,7 @@ void subarch_percpu_traps_init(void)
                                    (unsigned long)lstar_enter);
     stub_va += offset;
 
-    if ( boot_cpu_data.x86_vendor & (X86_VENDOR_INTEL | X86_VENDOR_CENTAUR) )
+    if ( cpu_has_sep )
     {
         /* SYSENTER entry. */
         wrmsrl(MSR_IA32_SYSENTER_ESP, stack_bottom);