From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Ellerman Subject: Re: [PATCH] mmap.2: describe the 5level paging hack Date: Fri, 15 Feb 2019 20:13:02 +1100 Message-ID: <87sgwpct41.fsf@concordia.ellerman.id.au> References: <20190211163653.97742-1-jannh@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190211163653.97742-1-jannh@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Jann Horn , mtk.manpages@gmail.comjannh@google.com Cc: linux-arch@vger.kernel.org, linux-man@vger.kernel.org, linux-mm@kvack.org, Peter Zijlstra , Benjamin Herrenschmidt , "Aneesh Kumar K.V" , Will Deacon , linuxppc-dev@lists.ozlabs.org, Andy Lutomirski , Dave Hansen , Paul Mackerras , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Andrew Morton , linux-api@vger.kernel.org, Linus Torvalds , Thomas Gleixner , "Kirill A . Shutemov" List-Id: linux-man@vger.kernel.org Jann Horn writes: > The manpage is missing information about the compatibility hack for > 5-level paging that went in in 4.14, around commit ee00f4a32a76 ("x86/mm: > Allow userspace have mappings above 47-bit"). Add some information about > that. Thanks for doing this. > While I don't think any hardware supporting this is shipping yet (?), I > think it's useful to try to write a manpage for this API, partly to > figure out how usable that API actually is, and partly because when this > hardware does ship, it'd be nice if distro manpages had information about > how to use it. > > Signed-off-by: Jann Horn > --- > This patch goes on top of the patch "[PATCH] mmap.2: fix description of > treatment of the hint" that I just sent, but I'm not sending them in a > series because I want the first one to go in, and I think this one might > be a bit more controversial. > > It would be nice if the architecture maintainers and mm folks could have > a look at this and check that what I wrote is right - I only looked at > the source for this, I haven't tried it. > > man2/mmap.2 | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/man2/mmap.2 b/man2/mmap.2 > index 8556bbfeb..977782fa8 100644 > --- a/man2/mmap.2 > +++ b/man2/mmap.2 > @@ -67,6 +67,8 @@ is NULL, > then the kernel chooses the (page-aligned) address > at which to create the mapping; > this is the most portable method of creating a new mapping. > +On Linux, in this case, the kernel may limit the maximum address that can be > +used for allocations to a legacy limit for compatibility reasons. > If > .I addr > is not NULL, > @@ -77,6 +79,19 @@ or equal to the value specified by > and attempt to create the mapping there. > If another mapping already exists there, the kernel picks a new > address, independent of the hint. > +However, if a hint above the architecture's legacy address limit is provided > +(on x86-64: above 0x7ffffffff000, on arm64: above 0x1000000000000, on ppc64 with > +book3s: above 0x7fffffffffff or 0x3fffffffffff, depending on page size), the It doesn't depend on page size for ppc64(le). With 4K pages the user VM is always 64TB. So the only boundary for us is at 128T when using 64K pages. cheers