[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/cpu: Fix common cpuid faulting probing for AMD and Hygon



commit 6bdbc321f2c26049e8f6f35db85bb6f7f0f1ee93
Author:     Pu Wen <puwen@xxxxxxxx>
AuthorDate: Thu Apr 4 21:45:42 2019 +0800
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jun 6 15:28:20 2019 +0100

    x86/cpu: Fix common cpuid faulting probing for AMD and Hygon
    
    There is no MSR_INTEL_PLATFORM_INFO for AMD and Hygon families. Read
    this MSR will stop the Xen initialization process in some Hygon
    systems or produce GPF(0). So directly return false in the function
    probe_cpuid_faulting() if !cpu_has_hypervisor.
    
    Signed-off-by: Pu Wen <puwen@xxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    [Rebase over 0cd074144cb "x86/cpu: Renumber X86_VENDOR_* to form a bitmap"]
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/common.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 4eee12da23..31294927a1 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -113,6 +113,14 @@ bool __init probe_cpuid_faulting(void)
        uint64_t val;
        int rc;
 
+       /*
+        * Don't bother looking for CPUID faulting if we aren't virtualised on
+        * AMD or Hygon hardware - it won't be present.
+        */
+       if ((boot_cpu_data.x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) &&
+           !cpu_has_hypervisor)
+               return false;
+
        if ((rc = rdmsr_safe(MSR_INTEL_PLATFORM_INFO, val)) == 0)
                raw_msr_policy.plaform_info.cpuid_faulting =
                        val & MSR_PLATFORM_INFO_CPUID_FAULTING;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.