From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] Fix nmi injection failure when vcpu got blocked Date: Wed, 24 May 2017 16:34:19 +0200 Message-ID: <20170524143418.GA7778@potion> References: <1495604922-4496-1-git-send-email-ann.zhuangyanying@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: pbonzini@redhat.com, herongguang.he@huawei.com, qemu-devel@nongnu.org, arei.gonglei@huawei.com, oscar.zhangbo@huawei.com, kvm@vger.kernel.org To: Zhuangyanying Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422830AbdEXOeX (ORCPT ); Wed, 24 May 2017 10:34:23 -0400 Content-Disposition: inline In-Reply-To: <1495604922-4496-1-git-send-email-ann.zhuangyanying@huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: Please use tags in patches. We usually begin the subject with "KVM: x86:" when touching arch/x86/kvm/x86.c. 2017-05-24 13:48+0800, Zhuangyanying: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > @@ -8394,7 +8394,8 @@ static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) > if (vcpu->arch.pv.pv_unhalted) > return true; > > - if (atomic_read(&vcpu->arch.nmi_queued)) > + if (vcpu->arch.nmi_pending || > + atomic_read(&vcpu->arch.nmi_queued)) > return true; Hm, I think we've been missing '&& kvm_x86_ops->nmi_allowed(vcpu)'. The undesired resume if we have suppressed NMI is not making it much worse, but wouldn't "kvm_test_request(KVM_REQ_NMI, vcpu)" also work here? > if (kvm_test_request(KVM_REQ_SMI, vcpu)) Thanks.