From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: [patch 2/2] tools: lkvm - Filter out cpu vendor string Date: Tue, 28 May 2013 15:49:44 +0400 Message-ID: <20130528115058.538288937@openvz.org> References: <20130528114942.157262069@openvz.org> Cc: mingo@kernel.org, sasha.levin@oracle.com, asias@redhat.com, kvm@vger.kernel.org, Cyrill Gorcunov To: Pekka Enberg Return-path: Received: from mail-lb0-f169.google.com ([209.85.217.169]:64361 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933225Ab3E1LvC (ORCPT ); Tue, 28 May 2013 07:51:02 -0400 Received: by mail-lb0-f169.google.com with SMTP id 10so7695522lbf.0 for ; Tue, 28 May 2013 04:51:00 -0700 (PDT) Content-Disposition: inline; filename=kvm-cpuid Sender: kvm-owner@vger.kernel.org List-ID: 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 CC: Pekka Enberg CC: Sasha Levin CC: Asias He Signed-off-by: Cyrill Gorcunov --- 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)