mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@hygon.cn>
Acked-by: Jan Beulich <jbeulich@suse.com>
[Rebase over 0cd074144c "x86/cpu: Renumber X86_VENDOR_* to form a bitmap"]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
d698382a5e
commit
6bdbc321f2
1 file changed
+8
@@ -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;
|
||||
|
||||