kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <levinsasha928@gmail.com>
To: penberg@kernel.org, mingo@elte.hu, gorcunov@gmail.com,
	asias.hejun@gmail.com
Cc: kvm@vger.kernel.org, Sasha Levin <levinsasha928@gmail.com>
Subject: [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid
Date: Fri, 15 Jun 2012 13:34:16 +0200	[thread overview]
Message-ID: <1339760057-17969-1-git-send-email-levinsasha928@gmail.com> (raw)

We need to set the HYPERVISOR flag to let the kernel know we're running
under a hypervisor.

This makes the kernel enable all sorts of para-virtualization options
such as kvm-clock.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/x86/cpuid.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/x86/cpuid.c b/tools/kvm/x86/cpuid.c
index 75f3b4d..6a20dd0 100644
--- a/tools/kvm/x86/cpuid.c
+++ b/tools/kvm/x86/cpuid.c
@@ -21,6 +21,10 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)
 		struct kvm_cpuid_entry2 *entry = &kvm_cpuid->entries[i];
 
 		switch (entry->function) {
+		case 1:
+			if (entry->index == 0)
+				entry->ecx |= (1<<31);
+			break;
 		case 6:
 			/* Clear presence of IA32_ENERGY_PERF_BIAS */
 			entry->ecx = entry->ecx & ~(1 << 3);
-- 
1.7.8.6


             reply	other threads:[~2012-06-15 11:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 11:34 Sasha Levin [this message]
2012-06-15 11:34 ` [PATCH 2/2] kvm tools: support 9p flush command Sasha Levin
2012-06-20  7:23   ` Pekka Enberg
2012-06-15 11:38 ` [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid Cyrill Gorcunov
2012-06-20  7:23   ` Pekka Enberg
2012-06-20  7:37     ` Cyrill Gorcunov
2012-06-20  7:59       ` 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=1339760057-17969-1-git-send-email-levinsasha928@gmail.com \
    --to=levinsasha928@gmail.com \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).