aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-03-23 12:01:29 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:32 -0400
commit919818abc2ca0721f1cd296fbc24601d9044f993 (patch)
tree5209e4b316177c9125786a37354a41c517799a5b /arch/x86/kvm/vmx.c
parent4462d21a615dfd0c0f672c10832a011d6f280d5a (diff)
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)
1202 vmx_capability.ept, vmx_capability.vpid); 1202 vmx_capability.ept, vmx_capability.vpid);
1203 } 1203 }
1204 1204
1205 if (!cpu_has_vmx_vpid())
1206 enable_vpid = 0;
1207
1205 min = 0; 1208 min = 0;
1206#ifdef CONFIG_X86_64 1209#ifdef CONFIG_X86_64
1207 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; 1210 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
@@ -2082,7 +2085,7 @@ static void allocate_vpid(struct vcpu_vmx *vmx)
2082 int vpid; 2085 int vpid;
2083 2086
2084 vmx->vpid = 0; 2087 vmx->vpid = 0;
2085 if (!enable_vpid || !cpu_has_vmx_vpid()) 2088 if (!enable_vpid)
2086 return; 2089 return;
2087 spin_lock(&vmx_vpid_lock); 2090 spin_lock(&vmx_vpid_lock);
2088 vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS); 2091 vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);