From: Bandan Das <bsd@redhat.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
chao.zhou@intel.com
Subject: Re: [PATCH] KVM: x86: call irq notifiers with directed EOI
Date: Wed, 18 Mar 2015 16:50:13 -0400 [thread overview]
Message-ID: <jpgpp86owsa.fsf@redhat.com> (raw)
In-Reply-To: <1426703902-16818-1-git-send-email-rkrcmar@redhat.com> ("Radim \=\?utf-8\?B\?S3LEjW3DocWZIidz\?\= message of "Wed, 18 Mar 2015 19:38:22 +0100")
Radim Krčmář <rkrcmar@redhat.com> writes:
> kvm_ioapic_update_eoi() wasn't called if directed EOI was enabled.
> We need to do that for irq notifiers. (Like with edge interrupts.)
>
> Fix it by skipping EOI broadcast only.
>
> Bug: https://bugzilla.kernel.org/show_bug.cgi?id=82211
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> ---
> arch/x86/kvm/ioapic.c | 4 +++-
> arch/x86/kvm/lapic.c | 3 +--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
> index b1947e0f3e10..46d4449772bc 100644
> --- a/arch/x86/kvm/ioapic.c
> +++ b/arch/x86/kvm/ioapic.c
> @@ -422,6 +422,7 @@ static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
> struct kvm_ioapic *ioapic, int vector, int trigger_mode)
> {
> int i;
> + struct kvm_lapic *apic = vcpu->arch.apic;
>
> for (i = 0; i < IOAPIC_NUM_PINS; i++) {
> union kvm_ioapic_redirect_entry *ent = &ioapic->redirtbl[i];
> @@ -443,7 +444,8 @@ static void __kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu,
> kvm_notify_acked_irq(ioapic->kvm, KVM_IRQCHIP_IOAPIC, i);
> spin_lock(&ioapic->lock);
>
> - if (trigger_mode != IOAPIC_LEVEL_TRIG)
> + if (trigger_mode != IOAPIC_LEVEL_TRIG ||
> + kvm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI)
> continue;
>
> ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG);
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index bd4e34de24c7..4ee827d7bf36 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -833,8 +833,7 @@ int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2)
>
> static void kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector)
> {
> - if (!(kvm_apic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI) &&
> - kvm_ioapic_handles_vector(apic->vcpu->kvm, vector)) {
> + if (kvm_ioapic_handles_vector(apic->vcpu->kvm, vector)) {
> int trigger_mode;
> if (apic_test_vector(vector, apic->regs + APIC_TMR))
> trigger_mode = IOAPIC_LEVEL_TRIG;
Works on my Xen 4.4 L1 setup with Intel E5 v2 host. Without this patch,
L1 panics as reported in the bug referenced above.
Tested-by: Bandan Das<bsd@redhat.com>
next prev parent reply other threads:[~2015-03-18 20:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 18:38 [PATCH] KVM: x86: call irq notifiers with directed EOI Radim Krčmář
2015-03-18 19:37 ` Bandan Das
2015-03-18 20:16 ` Radim Krčmář
2015-03-18 20:50 ` Bandan Das [this message]
2015-03-19 17:24 ` Paolo Bonzini
2015-03-19 19:42 ` Radim Krčmář
2015-03-19 21:44 ` Marcelo Tosatti
2015-03-20 14:43 ` Radim Krčmář
2015-03-23 23:27 ` Marcelo Tosatti
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=jpgpp86owsa.fsf@redhat.com \
--to=bsd@redhat.com \
--cc=chao.zhou@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@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;
as well as URLs for NNTP newsgroup(s).