]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 11:13:42 +0000 (13:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 11:13:42 +0000 (13:13 +0200)
added patches:
powerpc-mm-radix-use-the-right-page-size-for-vmemmap-mapping.patch

queue-4.9/powerpc-mm-radix-use-the-right-page-size-for-vmemmap-mapping.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/powerpc-mm-radix-use-the-right-page-size-for-vmemmap-mapping.patch b/queue-4.9/powerpc-mm-radix-use-the-right-page-size-for-vmemmap-mapping.patch
new file mode 100644 (file)
index 0000000..c6d72ea
--- /dev/null
@@ -0,0 +1,58 @@
+From 89a3496e0664577043666791ec07fb731d57c950 Mon Sep 17 00:00:00 2001
+From: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
+Date: Mon, 1 Jul 2019 20:04:42 +0530
+Subject: powerpc/mm/radix: Use the right page size for vmemmap mapping
+
+From: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
+
+commit 89a3496e0664577043666791ec07fb731d57c950 upstream.
+
+We use mmu_vmemmap_psize to find the page size for mapping the vmmemap area.
+With radix translation, we are suboptimally setting this value to PAGE_SIZE.
+
+We do check for 2M page size support and update mmu_vmemap_psize to use
+hugepage size but we suboptimally reset the value to PAGE_SIZE in
+radix__early_init_mmu(). This resulted in always mapping vmemmap area with
+64K page size.
+
+Fixes: 2bfd65e45e87 ("powerpc/mm/radix: Add radix callbacks for early init routines")
+Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/mm/pgtable-radix.c |   16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+--- a/arch/powerpc/mm/pgtable-radix.c
++++ b/arch/powerpc/mm/pgtable-radix.c
+@@ -287,14 +287,6 @@ void __init radix__early_init_devtree(vo
+       mmu_psize_defs[MMU_PAGE_64K].shift = 16;
+       mmu_psize_defs[MMU_PAGE_64K].ap = 0x5;
+ found:
+-#ifdef CONFIG_SPARSEMEM_VMEMMAP
+-      if (mmu_psize_defs[MMU_PAGE_2M].shift) {
+-              /*
+-               * map vmemmap using 2M if available
+-               */
+-              mmu_vmemmap_psize = MMU_PAGE_2M;
+-      }
+-#endif /* CONFIG_SPARSEMEM_VMEMMAP */
+       return;
+ }
+@@ -337,7 +329,13 @@ void __init radix__early_init_mmu(void)
+ #ifdef CONFIG_SPARSEMEM_VMEMMAP
+       /* vmemmap mapping */
+-      mmu_vmemmap_psize = mmu_virtual_psize;
++      if (mmu_psize_defs[MMU_PAGE_2M].shift) {
++              /*
++               * map vmemmap using 2M if available
++               */
++              mmu_vmemmap_psize = MMU_PAGE_2M;
++      } else
++              mmu_vmemmap_psize = mmu_virtual_psize;
+ #endif
+       /*
+        * initialize page table size
index a3a4b4425dd337c09d0fa3a8c200e4e4cfa454d6..50a42a0eb87be427fefe0a81791dfc82b2825456 100644 (file)
@@ -32,3 +32,4 @@ crypto-talitos-hmac-snoop-no-afeu-mode-requires-sw-icv-checking.patch
 drm-mediatek-mtk_drm_drv.c-add-of_node_put-before-goto.patch
 nvmem-use-the-same-permissions-for-eeprom-as-for-nvmem.patch
 x86-build-add-wnoaddress-of-packed-member-to-realmode_cflags-to-silence-gcc9-build-warning.patch
+powerpc-mm-radix-use-the-right-page-size-for-vmemmap-mapping.patch