From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v2] KVM: x86: Inject pending interrupt even if pending nmi exist Date: Wed, 23 Mar 2016 18:21:59 +0100 Message-ID: <20160323172159.GA22164@potion.brq.redhat.com> References: <7CC7D3013F4B10479273CE019E6A8C7A3ED90C@BPXM15GP.gisp.nec.co.jp> <56F297A7.1030309@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Yuki Shibuya , "kvm@vger.kernel.org" , Jan Kiszka , Nobuo Yoshida To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35195 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbcCWRWD (ORCPT ); Wed, 23 Mar 2016 13:22:03 -0400 Content-Disposition: inline In-Reply-To: <56F297A7.1030309@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-03-23 14:18+0100, Paolo Bonzini: > On 23/03/2016 06:08, Yuki Shibuya wrote: >> + /* If nmi pending > 0 and injectable interrupts exist, >> + * 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 = 0; > > I am not sure I understand this. Why is it safe to drop nmi_pending? NMIs are latched (queue length 1) and therefore cannot be pending after an injection. I think we want to do it unconditionally. > Can we instead do something like this in vcpu_enter_guest? (We should, even if it doesn't fix the bug. Maskable interrupts can be injected while NMIs are blocked.) What the hell is 2.6.32 doing, though?