On 30/05/2017 15:36, Radim Krčmář wrote: >> - if (atomic_read(&vcpu->arch.nmi_queued)) >> + if (kvm_test_request(KVM_REQ_NMI, vcpu) || >> + (vcpu->arch.nmi_pending && > I think the logic should be > > if ((kvm_test_request(KVM_REQ_NMI, vcpu) || vcpu->arch.nmi_pending) && > kvm_x86_ops->nmi_allowed(vcpu)) > > because there is no reason to resume the VCPU if we cannot inject. KVM_REQ_NMI would be processed anyway, and would clear nmi_queued. Of course, it would very soon go back to sleep. Even before Yanying's patch, nmi_queued > 0 would have woken up the vCPU in this manner. So I'm applying the patch. Thanks! Paolo