All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid
@ 2012-06-15 11:34 Sasha Levin
  2012-06-15 11:34 ` [PATCH 2/2] kvm tools: support 9p flush command Sasha Levin
  2012-06-15 11:38 ` [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid Cyrill Gorcunov
  0 siblings, 2 replies; 7+ messages in thread
From: Sasha Levin @ 2012-06-15 11:34 UTC (permalink / raw)
  To: penberg, mingo, gorcunov, asias.hejun; +Cc: kvm, Sasha Levin

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-06-20  7:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 11:34 [PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid Sasha Levin
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.