If cpuvendor string is not filetered in case of host
amd machine we get unhandled msr reads

| [1709265.368464] kvm: 25706: cpu6 unhandled rdmsr: 0xc0010048
| [1709265.397161] kvm: 25706: cpu7 unhandled rdmsr: 0xc0010048
| [1709265.425774] kvm: 25706: cpu8 unhandled rdmsr: 0xc0010048

thus provide own string and kernel will use generic cpu init.

Reported-by: Ingo Molnar <mi...@kernel.org>
CC: Pekka Enberg <penb...@kernel.org>
CC: Sasha Levin <sasha.le...@oracle.com>
CC: Asias He <as...@redhat.com>
Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org>
---
 tools/kvm/x86/cpuid.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: linux-2.6.git/tools/kvm/x86/cpuid.c
===================================================================
--- linux-2.6.git.orig/tools/kvm/x86/cpuid.c
+++ linux-2.6.git/tools/kvm/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_cpui
                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)

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to