From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2] KVM: x86: Inject pending interrupt even if pending nmi exist Date: Wed, 23 Mar 2016 19:22:21 +0100 Message-ID: <56F2DEDD.5060600@redhat.com> References: <7CC7D3013F4B10479273CE019E6A8C7A3ED90C@BPXM15GP.gisp.nec.co.jp> <56F297A7.1030309@redhat.com> <20160323172159.GA22164@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Yuki Shibuya , "kvm@vger.kernel.org" , Jan Kiszka , Nobuo Yoshida To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:32955 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751430AbcCWSWY (ORCPT ); Wed, 23 Mar 2016 14:22:24 -0400 Received: by mail-wm0-f68.google.com with SMTP id u125so6274691wmg.0 for ; Wed, 23 Mar 2016 11:22:24 -0700 (PDT) In-Reply-To: <20160323172159.GA22164@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 23/03/2016 18:21, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > > > + * nmi pending counter is cleared to prevent skipping > > > + * injectable pending interrupts. > > > + */ > > > + if (vcpu->arch.nmi_pending && kvm_cpu_has_injectable_intr(vcpu= ) > > > + && kvm_x86_ops->interrupt_allowed(vcpu)) > > > + vcpu->arch.nmi_pending =3D 0; > >=20 > > I am not sure I understand this. Why is it safe to drop nmi_pendin= g? >=20 > NMIs are latched (queue length 1) and therefore cannot be pending aft= er > an injection. I think we want to do it unconditionally. If that is right, process_nmi would be the place where you'd limit the queue to 1. Paolo