Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 12:36:54 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:37 +0100
commitbd58b0619be3d9582d3a2666a667049ac0647350 (patch)
tree787505330a641ab8e60d44afa05771eff2fc7b87
parent78d78921df3a25edc01369e7a45b847edc728804 (diff)
KVM: PPC: Book3S HV: Fix duplication of host SLB entries
(bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-Fix-duplication-of-host-SLB-entrie.patch91
-rw-r--r--series.conf1
2 files changed, 92 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-Fix-duplication-of-host-SLB-entrie.patch b/patches.arch/KVM-PPC-Book3S-HV-Fix-duplication-of-host-SLB-entrie.patch
new file mode 100644
index 0000000000..1c8049ae82
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-Fix-duplication-of-host-SLB-entrie.patch
@@ -0,0 +1,91 @@
+From cda4a14733138b8f15b0b69d97ec198dc41eccae Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+Date: Thu, 22 Mar 2018 09:48:54 +1100
+Subject: [PATCH] KVM: PPC: Book3S HV: Fix duplication of host SLB entries
+
+References: bsc#1061840
+Patch-mainline: v4.16
+Git-commit: cda4a14733138b8f15b0b69d97ec198dc41eccae
+
+Since commit 6964e6a4e489 ("KVM: PPC: Book3S HV: Do SLB load/unload
+with guest LPCR value loaded", 2018-01-11), we have been seeing
+occasional machine check interrupts on POWER8 systems when running
+KVM guests, due to SLB multihit errors.
+
+This turns out to be due to the guest exit code reloading the host
+SLB entries from the SLB shadow buffer when the SLB was not previously
+cleared in the guest entry path. This can happen because the path
+which skips from the guest entry code to the guest exit code without
+entering the guest now does the skip before the SLB is cleared and
+loaded with guest values, but the host values are loaded after the
+point in the guest exit path that we skip to.
+
+To fix this, we move the code that reloads the host SLB values up
+so that it occurs just before the point in the guest exit code (the
+label guest_bypass:) where we skip to from the guest entry path.
+
+Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
+Fixes: 6964e6a4e489 ("KVM: PPC: Book3S HV: Do SLB load/unload with guest LPCR value loaded")
+Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 35 +++++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 17 deletions(-)
+
+diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+index d33264697a31..f86a20270e50 100644
+--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
++++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+@@ -1557,6 +1557,24 @@ mc_cont:
+ ptesync
+ 3: stw r5,VCPU_SLB_MAX(r9)
+
++ /* load host SLB entries */
++BEGIN_MMU_FTR_SECTION
++ b 0f
++END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_RADIX)
++ ld r8,PACA_SLBSHADOWPTR(r13)
++
++ .rept SLB_NUM_BOLTED
++ li r3, SLBSHADOW_SAVEAREA
++ LDX_BE r5, r8, r3
++ addi r3, r3, 8
++ LDX_BE r6, r8, r3
++ andis. r7,r5,SLB_ESID_V@h
++ beq 1f
++ slbmte r6,r5
++1: addi r8,r8,16
++ .endr
++0:
++
+ guest_bypass:
+ stw r12, STACK_SLOT_TRAP(r1)
+ mr r3, r12
+@@ -2018,23 +2036,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
+ mtspr SPRN_LPCR,r8
+ isync
+ 48:
+- /* load host SLB entries */
+-BEGIN_MMU_FTR_SECTION
+- b 0f
+-END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_RADIX)
+- ld r8,PACA_SLBSHADOWPTR(r13)
+-
+- .rept SLB_NUM_BOLTED
+- li r3, SLBSHADOW_SAVEAREA
+- LDX_BE r5, r8, r3
+- addi r3, r3, 8
+- LDX_BE r6, r8, r3
+- andis. r7,r5,SLB_ESID_V@h
+- beq 1f
+- slbmte r6,r5
+-1: addi r8,r8,16
+- .endr
+-0:
+ #ifdef CONFIG_KVM_BOOK3S_HV_EXIT_TIMING
+ /* Finish timing, if we have a vcpu */
+ ld r4, HSTATE_KVM_VCPU(r13)
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index 5d8084bca0..fbb9ca59ee 100644
--- a/series.conf
+++ b/series.conf
@@ -14057,6 +14057,7 @@
patches.drivers/ALSA-usb-audio-Add-native-DSD-support-for-TEAC-UD-30
patches.drivers/ALSA-pcm-Use-dma_bytes-as-size-parameter-in-dma_mmap
patches.drivers/ALSA-pcm-potential-uninitialized-return-values
+ patches.arch/KVM-PPC-Book3S-HV-Fix-duplication-of-host-SLB-entrie.patch
patches.fixes/ceph-only-dirty-iter_iovec-pages-for-direct-read.patch
patches.suse/netfilter-nf_tables-add-missing-netlink-attrs-to-pol.patch
patches.drivers/lan78xx-Set-ASD-in-MAC_CR-when-EEE-is-enabled.patch