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:
Pu Wen authored and Andrew Cooper committed 2019-06-06 15:28:20 +01:00
1 parent d698382a5e
commit 6bdbc321f2
1 file changed
+8
+8
View File
@@ -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;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.