public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org
Subject: [bug report] KVM: x86: enable event window in inject_pending_event
Date: Wed, 3 Jun 2020 13:34:15 +0300	[thread overview]
Message-ID: <20200603103415.GC1845750@mwanda> (raw)

Hello Paolo Bonzini,

The patch c9d40913ac5a: "KVM: x86: enable event window in
inject_pending_event" from May 22, 2020, leads to the following
static checker warning:

	arch/x86/kvm/x86.c:10530 kvm_can_do_async_pf()
	warn: signedness bug returning '(-16)'

arch/x86/kvm/x86.c
 10516  bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu)
 10517  {
 10518          if (unlikely(!lapic_in_kernel(vcpu) ||
 10519                       kvm_event_needs_reinjection(vcpu) ||
 10520                       vcpu->arch.exception.pending))
 10521                  return false;
 10522  
 10523          if (kvm_hlt_in_guest(vcpu->kvm) && !kvm_can_deliver_async_pf(vcpu))
 10524                  return false;
 10525  
 10526          /*
 10527           * If interrupts are off we cannot even use an artificial
 10528           * halt state.
 10529           */
 10530          return kvm_arch_interrupt_allowed(vcpu);
 10531  }

The svm_nmi_allowed() used to return false because interrupts aren't
allowed but now it returns -EBUSY so it returns true/allowed.

regards,
dan carpenter

             reply	other threads:[~2020-06-03 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 10:34 Dan Carpenter [this message]
2020-06-03 11:25 ` [bug report] KVM: x86: enable event window in inject_pending_event Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200603103415.GC1845750@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox