Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-10-16 13:16:11 +0200
committerJoerg Roedel <jroedel@suse.de>2019-10-16 13:16:31 +0200
commit6272e47bd598b2af075ae8075f8a6e37882750e7 (patch)
tree53820fe4ee6679a0792b44346af043c4a72f4de0
parent229110518c9455450f3b94162ac7406f049e1bd8 (diff)
KVM: x86: change kvm_mmu_page_get_gfn BUG_ON to WARN_ON
(bsc#1117665).
-rw-r--r--patches.suse/kvm-x86-change-kvm_mmu_page_get_gfn-bug_on-to-warn_on40
-rw-r--r--series.conf1
2 files changed, 41 insertions, 0 deletions
diff --git a/patches.suse/kvm-x86-change-kvm_mmu_page_get_gfn-bug_on-to-warn_on b/patches.suse/kvm-x86-change-kvm_mmu_page_get_gfn-bug_on-to-warn_on
new file mode 100644
index 0000000000..d4aa9d69b4
--- /dev/null
+++ b/patches.suse/kvm-x86-change-kvm_mmu_page_get_gfn-bug_on-to-warn_on
@@ -0,0 +1,40 @@
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Sun, 30 Jun 2019 08:36:21 -0400
+Subject: KVM: x86: change kvm_mmu_page_get_gfn BUG_ON to WARN_ON
+Git-commit: e9f2a760b158551bfbef6db31d2cae45ab8072e5
+Patch-mainline: v5.3-rc1
+References: bsc#1117665
+
+Note that in such a case it is quite likely that KVM will BUG_ON
+in __pte_list_remove when the VM is closed. However, there is no
+immediate risk of memory corruption in the host so a WARN_ON is
+enough and it lets you gather traces for debugging.
+
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Acked-by: Joerg Roedel <jroedel@suse.de>
+---
+ arch/x86/kvm/mmu.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/arch/x86/kvm/mmu.c
++++ b/arch/x86/kvm/mmu.c
+@@ -1009,10 +1009,16 @@ static gfn_t kvm_mmu_page_get_gfn(struct
+
+ static void kvm_mmu_page_set_gfn(struct kvm_mmu_page *sp, int index, gfn_t gfn)
+ {
+- if (sp->role.direct)
+- BUG_ON(gfn != kvm_mmu_page_get_gfn(sp, index));
+- else
++ if (!sp->role.direct) {
+ sp->gfns[index] = gfn;
++ return;
++ }
++
++ if (WARN_ON(gfn != kvm_mmu_page_get_gfn(sp, index)))
++ pr_err_ratelimited("gfn mismatch under direct page %llx "
++ "(expected %llx, got %llx)\n",
++ sp->gfn,
++ kvm_mmu_page_get_gfn(sp, index), gfn);
+ }
+
+ /*
diff --git a/series.conf b/series.conf
index b15ce7b72f..416feca9d2 100644
--- a/series.conf
+++ b/series.conf
@@ -24115,6 +24115,7 @@
patches.suse/kvm-x86-do-not-release-the-page-inside-mmu_set_spte
patches.suse/kvm-x86-make-fnamefetch-and-_direct_map-more-similar
patches.suse/kvm-x86-remove-now-unneeded-hugepage-gfn-adjustment
+ patches.suse/kvm-x86-change-kvm_mmu_page_get_gfn-bug_on-to-warn_on
patches.suse/kvm-x86-unconditionally-enable-irqs-in-guest-context
patches.suse/9p-virtio-Add-cleanup-path-in-p9_virtio_init.patch
patches.suse/9p-xen-Add-cleanup-path-in-p9_trans_xen_init.patch