From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: mlevitsk@redhat.com
Subject: [PATCH 2/3] KVM: SVM: set IRR in svm_deliver_interrupt
Date: Fri, 11 Feb 2022 06:01:16 -0500 [thread overview]
Message-ID: <20220211110117.2764381-3-pbonzini@redhat.com> (raw)
In-Reply-To: <20220211110117.2764381-1-pbonzini@redhat.com>
SVM has to set IRR for both the AVIC and the software-LAPIC case,
so pull it up to the common function that handles both configurations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
arch/x86/kvm/svm/avic.c | 2 --
arch/x86/kvm/svm/svm.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
index 4d1baf5c8f6a..1e1890721634 100644
--- a/arch/x86/kvm/svm/avic.c
+++ b/arch/x86/kvm/svm/avic.c
@@ -670,8 +670,6 @@ int svm_deliver_avic_intr(struct kvm_vcpu *vcpu, int vec)
if (!vcpu->arch.apicv_active)
return -1;
- kvm_lapic_set_irr(vec, vcpu->arch.apic);
-
/*
* Pairs with the smp_mb_*() after setting vcpu->guest_mode in
* vcpu_enter_guest() to ensure the write to the vIRR is ordered before
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index 52e4130110f3..cd769ff8af16 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -3304,8 +3304,8 @@ static void svm_deliver_interrupt(struct kvm_lapic *apic, int delivery_mode,
{
struct kvm_vcpu *vcpu = apic->vcpu;
+ kvm_lapic_set_irr(vector, apic);
if (svm_deliver_avic_intr(vcpu, vector)) {
- kvm_lapic_set_irr(vector, apic);
kvm_make_request(KVM_REQ_EVENT, vcpu);
kvm_vcpu_kick(vcpu);
} else {
--
2.31.1
next prev parent reply other threads:[~2022-02-11 11:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 11:01 [PATCH 0/3] KVM: SVM: fix race between interrupt delivery and AVIC inhibition Paolo Bonzini
2022-02-11 11:01 ` [PATCH 1/3] KVM: SVM: extract avic_ring_doorbell Paolo Bonzini
2022-02-11 16:44 ` Sean Christopherson
2022-02-11 11:01 ` Paolo Bonzini [this message]
2022-02-11 16:45 ` [PATCH 2/3] KVM: SVM: set IRR in svm_deliver_interrupt Sean Christopherson
2022-02-11 11:01 ` [PATCH 3/3] KVM: SVM: fix race between interrupt delivery and AVIC inhibition Paolo Bonzini
2022-02-11 17:11 ` Sean Christopherson
2022-02-11 17:28 ` Paolo Bonzini
2022-02-11 17:35 ` Sean Christopherson
2022-02-23 12:15 ` Maxim Levitsky
2022-02-23 12:16 ` [PATCH 0/3] " Maxim Levitsky
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=20220211110117.2764381-3-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@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
all inboxes | Powered by JetHome®