summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity2009-03-23 17:01:29 +0100
committerAvi Kivity2009-06-10 10:48:32 +0200
commit919818abc2ca0721f1cd296fbc24601d9044f993 (patch)
tree5209e4b316177c9125786a37354a41c517799a5b /arch/x86/kvm/vmx.c
parentKVM: VMX: Annotate module parameters as __read_mostly (diff)
downloadkernel-qcow2-linux-919818abc2ca0721f1cd296fbc24601d9044f993.tar.gz
kernel-qcow2-linux-919818abc2ca0721f1cd296fbc24601d9044f993.tar.xz
kernel-qcow2-linux-919818abc2ca0721f1cd296fbc24601d9044f993.zip
KVM: VMX: Zero the vpid module parameter if vpid is not supported
This allows reading back how the hardware is configured. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index f4b6c4bcee29..9b97c8e3cfd1 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1202,6 +1202,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
vmx_capability.ept, vmx_capability.vpid);
}
+ if (!cpu_has_vmx_vpid())
+ enable_vpid = 0;
+
min = 0;
#ifdef CONFIG_X86_64
min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
@@ -2082,7 +2085,7 @@ static void allocate_vpid(struct vcpu_vmx *vmx)
int vpid;
vmx->vpid = 0;
- if (!enable_vpid || !cpu_has_vmx_vpid())
+ if (!enable_vpid)
return;
spin_lock(&vmx_vpid_lock);
vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);