All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve.Capper@arm.com (Steve Capper)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] arm64: mm: Copy over arch_get_unmapped_area
Date: Wed, 17 Oct 2018 14:52:45 +0000	[thread overview]
Message-ID: <20181017145235.raigvrlxwherivzp@capper-debian.cambridge.arm.com> (raw)
In-Reply-To: <20180907140439.5ji2c2fdxhvzzv32@capper-debian.cambridge.arm.com>

On Fri, Sep 07, 2018 at 03:04:39PM +0100, Steve Capper wrote:
> On Fri, Sep 07, 2018 at 02:15:32AM -0400, Jon Masters wrote:
> > On 08/29/2018 08:45 AM, Steve Capper wrote:
> > 
> > > In order to support 52-bit VAs for userspace we need to alter the mmap
> > > area choosing logic to give 52-bit VAs where "high" addresses are
> > > requested.
> > 
> > <snip>
> > 
> > > +unsigned long
> > > +arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
> > > +			  const unsigned long len, const unsigned long pgoff,
> > > +			  const unsigned long flags)
> > 
> > <snip>
> > 
> > > +	/* requested length too big for entire address space */
> > > +	if (len > TASK_SIZE - mmap_min_addr)
> > > +		return -ENOMEM;
> > > +
> > > +	if (flags & MAP_FIXED)
> > > +		return addr;
> > 
> > arch/x86/mm/mmap.c:
> > 
> >  *  With 5-level paging this request would be granted and result in a
> >  *  mapping which crosses the border of the 47-bit virtual address
> >  *  space. If the application cannot handle addresses above 47-bit this
> >  *  will lead to misbehaviour and hard to diagnose failures.
> >  *
> >  * Therefore ignore address hints which would result in a mapping
> >  * crossing the 47-bit virtual address boundary.
> > 
> > You'll probably want something similar above.
> >
> 
> Thanks Jon, I'll roll this into a future patch.
>

Hi Jon,
Going through this again, I believe the logic in the core code
arch_get_unmapped_area_topdown and arch_get_unmapped_area has equivalent
checks to mmap_address_hint_valid (if we substitute TASK_SIZE for a
limit depending on hint address).

Cheers,
-- 
Steve

  reply	other threads:[~2018-10-17 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-29 12:45 [PATCH 0/5] 52-bit userspace VAs Steve Capper
2018-08-29 12:45 ` [PATCH 1/5] arm64: mm: Introduce DEFAULT_MAP_WINDOW Steve Capper
2018-08-29 12:45 ` [PATCH 2/5] arm64: mm: introduce 52-bit userspace support Steve Capper
2018-09-21 17:40   ` Catalin Marinas
2018-09-27 13:50     ` Steve Capper
2018-09-27 14:48       ` Steve Capper
2018-10-01 10:28         ` Catalin Marinas
2018-10-01 10:50           ` Steve Capper
2018-08-29 12:45 ` [PATCH 3/5] arm64: mm: Copy over arch_get_unmapped_area Steve Capper
2018-09-07  6:15   ` Jon Masters
2018-09-07 14:04     ` Steve Capper
2018-10-17 14:52       ` Steve Capper [this message]
2018-08-29 12:45 ` [PATCH 4/5] arm64: mmap: Allow for "high" 52-bit VA allocations Steve Capper
2018-09-21 17:11   ` Catalin Marinas
2018-08-29 12:45 ` [PATCH 5/5] arm64: mm: Activate 52-bit userspace VA support Steve Capper
2018-09-07  6:22 ` [PATCH 0/5] 52-bit userspace VAs Jon Masters
2018-09-07 13:59   ` Steve Capper

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=20181017145235.raigvrlxwherivzp@capper-debian.cambridge.arm.com \
    --to=steve.capper@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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.