summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorNadav Har'El <nyh@il.ibm.com>2011-05-25 23:16:10 +0300
committerAvi Kivity <avi@redhat.com>2011-07-12 11:45:19 +0300
commit7b8050f570a03718d21fc8662c54586192ea2dac (patch)
treedd8ca0722d30e4639b3e73a33b05b4bb5ab0a373 /arch/x86/kvm
parent7991825b8558a719eb7cfb93c4458d767ae1f2eb (diff)
downloadop-kernel-dev-7b8050f570a03718d21fc8662c54586192ea2dac.zip
op-kernel-dev-7b8050f570a03718d21fc8662c54586192ea2dac.tar.gz
KVM: nVMX: Add VMX to list of supported cpuid features
If the "nested" module option is enabled, add the "VMX" CPU feature to the list of CPU features KVM advertises with the KVM_GET_SUPPORTED_CPUID ioctl. Qemu uses this ioctl, and intersects KVM's list with its own list of desired cpu features (depending on the -cpu option given to qemu) to determine the final list of features presented to the guest. Signed-off-by: Nadav Har'El <nyh@il.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/vmx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index afc1f06..a600fd7 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6299,6 +6299,8 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu)
static void vmx_set_supported_cpuid(u32 func, struct kvm_cpuid_entry2 *entry)
{
+ if (func == 1 && nested)
+ entry->ecx |= bit(X86_FEATURE_VMX);
}
/*
OpenPOWER on IntegriCloud