Thread (5 messages) flat view 5 messages, 2 authors, 2017-02-20

Re: [PATCH] powerpc/mm/hugetlb: Filter out hugepage size not supported by page table layout

From: Aneesh Kumar K.V <hidden>
Date: 2017-02-20 03:32:22


On Monday 20 February 2017 02:35 AM, Benjamin Herrenschmidt wrote:
On Sun, 2017-02-19 at 15:48 +0530, Aneesh Kumar K.V wrote:
quoted
+#ifdef CONFIG_PPC_BOOK3S_64
+       /*
+        * We need to make sure that for different page sizes reported by
+        * firmware we only add hugetlb support for page sizes that can be
+        * supported by linux page table layout.
+        * For now we have
+        * Radix: 2M
+        * Hash: 16M and 16G
+        */
+       if (radix_enabled()) {
+               if (mmu_psize != MMU_PAGE_2M)
+                       return -EINVAL;
+       } else {
+               if (mmu_psize != MMU_PAGE_16M && mmu_psize != MMU_PAGE_16G)
+                       return -EINVAL;
+       }
Hash could support others...
On book3s 64 ? I had the above within #ifdef.
Same with radix and PUD level pages.
Yes, but gigantic hugepage is not yet supported. Once we add that we will
add MMU_PAGE_1G here.

Why do we need that ? Won't FW provide separate properties for hash and
radix page sizes anyway ?
To avoid crashes like the one reported in the commit message due to 
buggy firmware ? Also
It can serve as an easy way to understand what hugepage sizes are 
supported by different platforms.
I am yet to figure out what the FSL_BOOK3E and PPC_8xx #ifdef above that 
hunk is all about. Having
the supported hugepage size clearly verified against makes it easy ?

-aneesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help