From: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
To: "Boris V." <borisvk@bstnet.org>, kvm@vger.kernel.org
Subject: Re: KVM Kernel 5.6+, BUG: stack guard page was hit at
Date: Thu, 23 Apr 2020 18:54:39 +0700 [thread overview]
Message-ID: <d9c000ab-3288-ecc3-7a3f-e7bac963a398@amd.com> (raw)
In-Reply-To: <fd793edf-a40f-100e-d1ba-a1147659cf17@bstnet.org>
Boris,
On 4/22/20 12:43 PM, Boris V. wrote:
> Hello,
>
> when running qemu with GPU passthrough it crashes with 5.6 and also 5.7-rc kernels, it works with 5.5 and lower.
> Without GPU passthrough I don't see this crash.
> With bisecting, I found commit that causes this BUG.
> It seems bad commit is f458d039db7e8518041db4169d657407e3217008, if I revert this patch it works.
Could you please try the following patch?
Thanks,
Suravee
--- BEGIN PATCH ---
commit 5a605d65a71583195f64d42f39a29c771e2c763a
Author: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Date: Thu Apr 23 06:40:11 2020 -0500
kvm: ioapic: Introduce arch-specific check for lazy update EOI mechanism
commit f458d039db7e ("kvm: ioapic: Lazy update IOAPIC EOI") introduces
a regression on Intel VMX APICv since it always force IOAPIC lazy update
EOI mechanism when APICv is activated, which is needed to support AMD
SVM AVIC.
Fixes by introducing struct kvm_arch.use_lazy_eoi variable to specify
whether the architecture needs lazy update EOI support.
Fixes: f458d039db7e ("kvm: ioapic: Lazy update IOAPIC EOI")
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
arch/x86/include/asm/kvm_host.h | 2 ++
arch/x86/kvm/ioapic.c | 3 +++
arch/x86/kvm/svm.c | 1 +
3 files changed, 6 insertions(+)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index f15e5b3..a760ebd 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -980,6 +980,8 @@ struct kvm_arch {
struct kvm_pmu_event_filter *pmu_event_filter;
struct task_struct *nx_lpage_recovery_thread;
+
+ bool use_lazy_eoi;
};
struct kvm_vm_stat {
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 750ff0b..baee8793 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -188,6 +188,9 @@ static void ioapic_lazy_update_eoi(struct kvm_ioapic *ioapic, int irq)
struct kvm_vcpu *vcpu;
union kvm_ioapic_redirect_entry *entry = &ioapic->redirtbl[irq];
+ if (!ioapic->kvm->arch.use_lazy_eoi)
+ return;
+
kvm_for_each_vcpu(i, vcpu, ioapic->kvm) {
if (!kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
entry->fields.dest_id,
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 13a5bb4..a3d45ec 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2267,6 +2267,7 @@ static int svm_create_vcpu(struct kvm_vcpu *vcpu)
svm_init_osvw(vcpu);
vcpu->arch.microcode_version = 0x01000065;
+ vcpu->kvm->arch.use_lazy_eoi = true;
return 0;
---- END PATCH ---
next prev parent reply other threads:[~2020-04-23 11:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-22 5:43 KVM Kernel 5.6+, BUG: stack guard page was hit at Boris V.
2020-04-23 11:54 ` Suravee Suthikulpanit [this message]
2020-04-23 15:33 ` Boris V.
2020-04-24 1:13 ` Suravee Suthikulpanit
2020-04-27 5:12 ` Suravee Suthikulpanit
2020-04-27 17:44 ` Boris V.
2020-04-30 17:21 ` Suravee Suthikulpanit
2020-04-30 18:59 ` Boris V.
-- strict thread matches above, loose matches on Subject: below --
2020-04-21 18:50 Boris V.
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=d9c000ab-3288-ecc3-7a3f-e7bac963a398@amd.com \
--to=suravee.suthikulpanit@amd.com \
--cc=borisvk@bstnet.org \
--cc=kvm@vger.kernel.org \
/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