From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912AbdBGSQE (ORCPT ); Tue, 7 Feb 2017 13:16:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753925AbdBGSQC (ORCPT ); Tue, 7 Feb 2017 13:16:02 -0500 Date: Tue, 7 Feb 2017 19:16:00 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 2/6] kvm: nVMX: move nested events check to kvm_vcpu_running Message-ID: <20170207181559.GB31091@potion> References: <1482164232-130035-1-git-send-email-pbonzini@redhat.com> <1482164232-130035-3-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1482164232-130035-3-git-send-email-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 07 Feb 2017 18:16:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-12-19 17:17+0100, Paolo Bonzini: > vcpu_run calls kvm_vcpu_running, not kvm_arch_vcpu_runnable, > and the former does not call check_nested_events. > > Once KVM_REQ_EVENT is removed from the APICv interrupt injection > path, however, this would leave no place to trigger a vmexit > from L2 to L1, causing a missed interrupt delivery while in guest > mode. This is caught by the "ack interrupt on exit" test in > vmx.flat. > > [This does not change the calls to check_nested_events in > inject_pending_event. That is material for a separate cleanup.] > > Signed-off-by: Paolo Bonzini > --- I think we should now remove the call to check_nested_events() from inject_pending_event() and we could also call it in vcpu_enter_guest() directly. Still, Reviewed-by: Radim Krčmář arch/x86/kvm/x86.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index d5a5fc2f8758..32e5f54a8eba 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -6920,6 +6920,9 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) > > static inline bool kvm_vcpu_running(struct kvm_vcpu *vcpu) > { > + if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) > + kvm_x86_ops->check_nested_events(vcpu, false); > + > return (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE && > !vcpu->arch.apf.halted); > } > @@ -8286,9 +8289,6 @@ static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) > > int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) > { > - if (is_guest_mode(vcpu) && kvm_x86_ops->check_nested_events) > - kvm_x86_ops->check_nested_events(vcpu, false); > - > return kvm_vcpu_running(vcpu) || kvm_vcpu_has_events(vcpu); > } > > -- > 1.8.3.1 > > > -- > 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