Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 919818ab authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: VMX: Zero the vpid module parameter if vpid is not supported



This allows reading back how the hardware is configured.

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 4462d21a
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1202,6 +1202,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
		      vmx_capability.ept, vmx_capability.vpid);
		      vmx_capability.ept, vmx_capability.vpid);
	}
	}


	if (!cpu_has_vmx_vpid())
		enable_vpid = 0;

	min = 0;
	min = 0;
#ifdef CONFIG_X86_64
#ifdef CONFIG_X86_64
	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
	min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
@@ -2082,7 +2085,7 @@ static void allocate_vpid(struct vcpu_vmx *vmx)
	int vpid;
	int vpid;


	vmx->vpid = 0;
	vmx->vpid = 0;
	if (!enable_vpid || !cpu_has_vmx_vpid())
	if (!enable_vpid)
		return;
		return;
	spin_lock(&vmx_vpid_lock);
	spin_lock(&vmx_vpid_lock);
	vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);
	vpid = find_first_zero_bit(vmx_vpid_bitmap, VMX_NR_VPIDS);