aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2013-05-28 15:49:44 +0400
committerWill Deacon <will.deacon@arm.com>2015-06-01 16:39:54 +0100
commitbc0b99a2a74047707db73ba057743febf458fd90 (patch)
treea6b34223e1d2390ed2593cb1083fd47c8b79c681
parente9b96f5e412b192e62453fcb3902d26adffb109e (diff)
downloadkvmtool-bc0b99a2a74047707db73ba057743febf458fd90.tar.gz
kvm tools: Filter out CPU vendor string
Ingo Molnar reports unhandled MSR reads on an AMD machine: [1709265.368464] kvm: 25706: cpu6 unhandled rdmsr: 0xc0010048 [1709265.397161] kvm: 25706: cpu7 unhandled rdmsr: 0xc0010048 [1709265.425774] kvm: 25706: cpu8 unhandled rdmsr: 0xc0010048 processor : 11 vendor_id : AuthenticAMD cpu family : 16 model : 8 model name : AMD Engineering Sample stepping : 0 cpu MHz : 2400.000 cache size : 512 KB physical id : 1 siblings : 6 core id : 5 cpu cores : 6 apicid : 21 initial apicid : 13 fpu : yes fpu_exception : yes cpuid level : 5 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save pausefilter bogomips : 4800.01 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 48 bits physical, 48 bits virtual power management: ts ttp tm stc 100mhzsteps hwpstate and Asias He reports guest not booting on an AMD machine: processor : 0 vendor_id : AuthenticAMD cpu family : 21 model : 1 model name : AMD Opteron(TM) Processor 6274 stepping : 2 microcode : 0x6000626 cpu MHz : 2200.034 cache size : 2048 KB physical id : 0 siblings : 16 core id : 0 cpu cores : 8 apicid : 32 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid amd_dcm aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext perfctr_core perfctr_nb arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold bogomips : 4400.06 TLB size : 1536 4K pages clflush size : 64 cache_alignment : 64 address sizes : 48 bits physical, 48 bits virtual power management: ts ttp tm 100mhzsteps hwpstate cpb If CPU vendor string is not filetered in case of host AMD machine we get unhandled MSR reads. Thus provide own string and kernel will use generic CPU init. Reported-by: Ingo Molnar <mingo@kernel.org> CC: Sasha Levin <sasha.levin@oracle.com> Tested-by: Asias He <asias@redhat.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> [ penberg@kernel.org: improve changelog ] Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--x86/cpuid.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/x86/cpuid.c b/x86/cpuid.c
index 4c140f0c..72ab983c 100644
--- a/x86/cpuid.c
+++ b/x86/cpuid.c
@@ -12,6 +12,7 @@
static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)
{
+ unsigned int signature[3];
unsigned int i;
/*
@@ -21,6 +22,13 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)
struct kvm_cpuid_entry2 *entry = &kvm_cpuid->entries[i];
switch (entry->function) {
+ case 0:
+ /* Vendor name */
+ memcpy(signature, "LKVMLKVMLKVM", 12);
+ entry->ebx = signature[0];
+ entry->ecx = signature[1];
+ entry->edx = signature[2];
+ break;
case 1:
/* Set X86_FEATURE_HYPERVISOR */
if (entry->index == 0)