Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932553AbbBBQOd (ORCPT ); Mon, 2 Feb 2015 11:14:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59961 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932338AbbBBQOV (ORCPT ); Mon, 2 Feb 2015 11:14:21 -0500 Message-ID: <54CFA24C.4080806@redhat.com> Date: Mon, 02 Feb 2015 17:14:04 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Wincy Van CC: "gleb@kernel.org" , "Zhang, Yang Z" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Wanpeng Li , Jan Kiszka Subject: Re: [PATCH v4 6/6] KVM: nVMX: Enable nested posted interrupt processing References: <54CF5971.8090407@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 34 On 02/02/2015 16:33, Wincy Van wrote: > static void vmx_accomp_nested_posted_intr(struct kvm_vcpu *vcpu) > { > struct vcpu_vmx *vmx = to_vmx(vcpu); > > if (is_guest_mode(vcpu) && > vmx->nested.posted_intr_nv != -1 && > pi_test_on(vmx->nested.pi_desc)) > kvm_apic_set_irr(vcpu, > vmx->nested.posted_intr_nv); > } > > Then we will get an nested-vmexit in vmx_check_nested_events, that > posted intr will be handled by L1 immediately. > This mechanism will also emulate the hardware's behavior: If a posted > intr was not accomplished by hardware, we will get an interrupt with > POSTED_INTR_NV. Yes. > Would this be better? I think you do not even need a new bit. You can use KVM_REQ_EVENT and (to complete my suggestion, which was not enough) do the above in vmx_check_nested_events. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/