All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	paulus@samba.org, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/mm/hugetlb: Filter out hugepage size not supported by page table layout
Date: Mon, 20 Feb 2017 09:02:03 +0530	[thread overview]
Message-ID: <fdc5f84d-f337-24e6-e116-e34cf6ff722b@linux.vnet.ibm.com> (raw)
In-Reply-To: <1487538354.23576.158.camel@kernel.crashing.org>



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:
>> +#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

  reply	other threads:[~2017-02-20  3:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 10:18 [PATCH] powerpc/mm/hugetlb: Filter out hugepage size not supported by page table layout Aneesh Kumar K.V
2017-02-19 21:05 ` Benjamin Herrenschmidt
2017-02-20  3:32   ` Aneesh Kumar K.V [this message]
2017-02-20  3:35     ` Benjamin Herrenschmidt
2017-02-20  5:36       ` Aneesh Kumar K.V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fdc5f84d-f337-24e6-e116-e34cf6ff722b@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.