From: Paolo Bonzini <pbonzini@redhat.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: rkrcmar@redhat.com, joro@8bytes.org, jon.grimm@amd.com,
borisvk@bstnet.org
Subject: Re: [PATCH] kvm: ioapic: Introduce arch-specific check for lazy update EOI mechanism
Date: Sat, 25 Apr 2020 11:52:45 +0200 [thread overview]
Message-ID: <b051913a-10f4-81d4-6ef8-19d586db61da@redhat.com> (raw)
In-Reply-To: <1587704910-78437-1-git-send-email-suravee.suthikulpanit@amd.com>
On 24/04/20 07:08, Suravee Suthikulpanit wrote:
> commit f458d039db7e ("kvm: ioapic: Lazy update IOAPIC EOI") introduces
> the following regression on Intel VMX APICv.
>
> BUG: stack guard page was hit at 000000008f595917 \
> (stack is 00000000bdefe5a4..00000000ae2b06f5)
> kernel stack overflow (double-fault): 0000 [#1] SMP NOPTI
> RIP: 0010:kvm_set_irq+0x51/0x160 [kvm]
> Call Trace:
> irqfd_resampler_ack+0x32/0x90 [kvm]
> kvm_notify_acked_irq+0x62/0xd0 [kvm]
> kvm_ioapic_update_eoi_one.isra.0+0x30/0x120 [kvm]
> ioapic_set_irq+0x20e/0x240 [kvm]
> kvm_ioapic_set_irq+0x5c/0x80 [kvm]
> kvm_set_irq+0xbb/0x160 [kvm]
> ? kvm_hv_set_sint+0x20/0x20 [kvm]
> irqfd_resampler_ack+0x32/0x90 [kvm]
> kvm_notify_acked_irq+0x62/0xd0 [kvm]
> kvm_ioapic_update_eoi_one.isra.0+0x30/0x120 [kvm]
> ioapic_set_irq+0x20e/0x240 [kvm]
> kvm_ioapic_set_irq+0x5c/0x80 [kvm]
> kvm_set_irq+0xbb/0x160 [kvm]
> ? kvm_hv_set_sint+0x20/0x20 [kvm]
> ....
>
> This is due to the logic always force IOAPIC lazy update EOI mechanism
> when APICv is activated, which is only needed by AMD SVM AVIC.
>
> Fixes by introducing struct kvm_arch.use_lazy_eoi variable to specify
> whether the architecture needs lazy update EOI support.
You are not explaining why the same infinite loop cannot happen on AMD.
It seems to me that it is also fixed by adding a check for re-entrancy
in ioapic_lazy_update_eoi. It's easy to add one since
ioapic_lazy_update_eoi is called with the ioapic->lock taken.
Paolo
next prev parent reply other threads:[~2020-04-25 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 5:08 Suravee Suthikulpanit
2020-04-25 9:52 ` Paolo Bonzini [this message]
2020-04-30 15:28 ` Suravee Suthikulpanit
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=b051913a-10f4-81d4-6ef8-19d586db61da@redhat.com \
--to=pbonzini@redhat.com \
--cc=borisvk@bstnet.org \
--cc=jon.grimm@amd.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=suravee.suthikulpanit@amd.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®