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.

Reply via email to