Re: [PATCH] KVM: nVMX: emulate the INVVPID instruction

From: Bandan Das
Date: Thu Sep 24 2015 - 11:45:38 EST


Paolo Bonzini <pbonzini@xxxxxxxxxx> writes:
...
>> @@ -7189,7 +7189,28 @@ static int handle_invept(struct kvm_vcpu *vcpu)
>>
>> static int handle_invvpid(struct kvm_vcpu *vcpu)
>> {
>> - kvm_queue_exception(vcpu, UD_VECTOR);
>> + u32 vmx_instruction_info;
>> + unsigned long type;
>> +
>> + if (!nested_vmx_check_permission(vcpu))
>> + return 1;
>> +
>> + vmx_instruction_info = vmcs_read32(VMX_INSTRUCTION_INFO);
>> + type = kvm_register_readl(vcpu, (vmx_instruction_info >> 28) & 0xf);
>> +
>> + switch (type) {
>> + case VMX_VPID_EXTENT_INDIVIDUAL_ADDR:
>> + case VMX_VPID_EXTENT_SINGLE_CONTEXT:
>> + case VMX_VPID_EXTENT_ALL_CONTEXT:
>> + vmx_flush_tlb(vcpu);
>> + nested_vmx_succeed(vcpu);
>> + break;
>> + default:
>> + nested_vmx_failInvalid(vcpu);
>> + break;
>> + }
>> +
>> + skip_emulated_instruction(vcpu);
>> return 1;
>> }
>>
>>
>
> This is not enough. You need to add a VPID argument to
> vpid_sync_vcpu_single, and inline vmx_flush_tlb in handle_invvpid so
> that it can use the new VPID argument of vpid_sync_vcpu_single.
>
> Note that the "all context" variant can be mapped to
> vpid_sync_vcpu_single with vpid02 as the argument (a nice side effect of
> your vpid02 design).
>
> However, I have applied the patch to kvm/queue. Please send the changes
> separately, and I will squash them in the existing VPID patch.

Please don't do this. It's making it really difficult to review these
patches individually :( Why not let them get some review time before
applying them all together ?


> Paolo
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/