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

Benjamin Herrenschmidt benh at kernel.crashing.org
Mon Feb 20 08:05:54 AEDT 2017


On Sun, 2017-02-19 at 15:48 +0530, Aneesh Kumar K.V wrote:
> +#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... Same with radix and PUD level pages.

Why do we need that ? Won't FW provide separate properties for hash and
radix page sizes anyway ?

Ben.



More information about the Linuxppc-dev mailing list