public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@openvz.org>
To: Pekka Enberg <penberg@kernel.org>
Cc: mingo@kernel.org, sasha.levin@oracle.com, asias@redhat.com,
	kvm@vger.kernel.org, Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [patch 2/2] tools: lkvm - Filter out cpu vendor string
Date: Tue, 28 May 2013 15:49:44 +0400	[thread overview]
Message-ID: <20130528115058.538288937@openvz.org> (raw)
In-Reply-To: 20130528114942.157262069@openvz.org

[-- Attachment #1: kvm-cpuid --]
[-- Type: text/plain, Size: 1371 bytes --]

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 <mingo@kernel.org>
CC: Pekka Enberg <penberg@kernel.org>
CC: Sasha Levin <sasha.levin@oracle.com>
CC: Asias He <asias@redhat.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@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)


  parent reply	other threads:[~2013-05-28 11:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28 11:49 [patch 0/2] A few fixes for make and cpuid Cyrill Gorcunov
2013-05-28 11:49 ` [patch 1/2] tools: lkvm - Dont generate deps and verion file on clean target Cyrill Gorcunov
2013-05-28 11:49 ` Cyrill Gorcunov [this message]
2013-06-06 12:03   ` [patch 2/2] tools: lkvm - Filter out cpu vendor string Pekka Enberg
2013-06-06 12:06     ` Cyrill Gorcunov
2013-06-06 13:39     ` Asias He
2013-06-07  8:17     ` Asias He
2013-06-07 11:06       ` Pekka Enberg
2013-06-07 12:20         ` Asias He
2013-06-07 13:39           ` Asias He
2013-06-08 11:48             ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130528115058.538288937@openvz.org \
    --to=gorcunov@openvz.org \
    --cc=asias@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=penberg@kernel.org \
    --cc=sasha.levin@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox