On 16/09/2015 14:32, Jan Kiszka wrote:
BTW, what will happen if allocate_vpid runs out of free slots andThe return value of vmx_secondary_exec_control will not have
returns 0? Will we always fail then...?
SECONDARY_EXEC_ENABLE_VPID, so it's okay. However, I think
we need this in the nested VPID patches:
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index c23482cda1a7..e6859b45b00b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9456,7 +9460,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
else
vmcs_write64(TSC_OFFSET, vmx->nested.vmcs01_tsc_offset);
- if (enable_vpid) {
+ if (vmx->nested.vpid02) {
/*
* There is no direct mapping between vpid02 and vpid12, the
* vpid02 is per-vCPU for L0 and reused while the value of