From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756937AbbIXPpf (ORCPT ); Thu, 24 Sep 2015 11:45:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42976 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755460AbbIXPpd (ORCPT ); Thu, 24 Sep 2015 11:45:33 -0400 From: Bandan Das To: Paolo Bonzini Cc: Wanpeng Li , Jan Kiszka , Wincy Van , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: nVMX: emulate the INVVPID instruction References: <56026541.7030000@redhat.com> Date: Thu, 24 Sep 2015 11:45:31 -0400 In-Reply-To: <56026541.7030000@redhat.com> (Paolo Bonzini's message of "Wed, 23 Sep 2015 10:39:29 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paolo Bonzini 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@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html