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:36 +0100
commitbc40d41180ffd6ef662055fb5c09df09a36bae02 (patch)
treed800b9f1e642b179a9df98f014465fb666cf85fa
parent56106d6d95c27b5aeb4cffc0773629bafad7e7d4 (diff)
KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB
memory backing (bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-Fix-VRMA-initialization-with-2MB-o.patch59
-rw-r--r--series.conf1
2 files changed, 60 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-Fix-VRMA-initialization-with-2MB-o.patch b/patches.arch/KVM-PPC-Book3S-HV-Fix-VRMA-initialization-with-2MB-o.patch
new file mode 100644
index 0000000000..aae2fd6997
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-Fix-VRMA-initialization-with-2MB-o.patch
@@ -0,0 +1,59 @@
+From debd574f4195e205ba505b25e19b2b797f4bcd94 Mon Sep 17 00:00:00 2001
+From: Paul Mackerras <paulus@ozlabs.org>
+Date: Fri, 2 Mar 2018 15:38:04 +1100
+Subject: [PATCH] KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB
+ memory backing
+
+References: bsc#1061840
+Patch-mainline: v4.16-rc5
+Git-commit: debd574f4195e205ba505b25e19b2b797f4bcd94
+
+The current code for initializing the VRMA (virtual real memory area)
+for HPT guests requires the page size of the backing memory to be one
+of 4kB, 64kB or 16MB. With a radix host we have the possibility that
+the backing memory page size can be 2MB or 1GB. In these cases, if the
+guest switches to HPT mode, KVM will not initialize the VRMA and the
+guest will fail to run.
+
+In fact it is not necessary that the VRMA page size is the same as the
+backing memory page size; any VRMA page size less than or equal to the
+backing memory page size is acceptable. Therefore we now choose the
+largest page size out of the set {4k, 64k, 16M} which is not larger
+than the backing memory page size.
+
+Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kvm/book3s_hv.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
+index 89707354c2ef..b4a538b29da5 100644
+--- a/arch/powerpc/kvm/book3s_hv.c
++++ b/arch/powerpc/kvm/book3s_hv.c
+@@ -3656,15 +3656,17 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
+ goto up_out;
+
+ psize = vma_kernel_pagesize(vma);
+- porder = __ilog2(psize);
+
+ up_read(&current->mm->mmap_sem);
+
+ /* We can handle 4k, 64k or 16M pages in the VRMA */
+- err = -EINVAL;
+- if (!(psize == 0x1000 || psize == 0x10000 ||
+- psize == 0x1000000))
+- goto out_srcu;
++ if (psize >= 0x1000000)
++ psize = 0x1000000;
++ else if (psize >= 0x10000)
++ psize = 0x10000;
++ else
++ psize = 0x1000;
++ porder = __ilog2(psize);
+
+ senc = slb_pgsize_encoding(psize);
+ kvm->arch.vrma_slb_v = senc | SLB_VSID_B_1T |
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index cdb8d940fb..5dce7943c3 100644
--- a/series.conf
+++ b/series.conf
@@ -13730,6 +13730,7 @@
patches.arch/0001-arm64-Relax-ARM_SMCCC_ARCH_WORKAROUND_1-discovery.patch
patches.arch/KVM-PPC-Book3S-Fix-compile-error-that-occurs-with-so.patch
patches.arch/KVM-PPC-Book3S-HV-Fix-handling-of-large-pages-in-rad.patch
+ patches.arch/KVM-PPC-Book3S-HV-Fix-VRMA-initialization-with-2MB-o.patch
patches.arch/KVM-PPC-Book3S-HV-Fix-guest-time-accounting-with-VIR.patch
patches.drivers/IB-mlx5-Fix-incorrect-size-of-klms-in-the-memory-reg.patch
patches.drivers/IB-mlx5-Avoid-passing-an-invalid-QP-type-to-firmware.patch