[PATCH 1/2] kvm tools: set the HYPERVISOR flag in cpuid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux