public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Revert "arm64: uaccess: implement unsafe accessors"
Date: Wed, 10 Oct 2018 17:53:17 +0100	[thread overview]
Message-ID: <20181010165316.GB212880@arrakis.emea.arm.com> (raw)
In-Reply-To: <20181010155544.19125-1-james.morse@arm.com>

On Wed, Oct 10, 2018 at 04:55:44PM +0100, James Morse wrote:
> This reverts commit a1f33941f7e103bcf471eaf8461b212223c642d6.
> 
> The unsafe accessors allow the PAN enable/disable calls to be made
> once for a group of accesses. Adding these means we can now have
> sequences that look like this:
> 
> | user_access_begin();
> | unsafe_put_user(static-value, x, err);
> | unsafe_put_user(helper-that-sleeps(), x, err);
> | user_access_end();
> 
> Calling schedule() without taking an exception doesn't switch the
> PSTATE or TTBRs. We can switch out of a uaccess-enabled region, and
> run other code with uaccess enabled for a different thread.
> 
> We can also switch from uaccess-disabled code back into this region,
> meaning the unsafe_put_user()s will fault.
> 
> For software-PAN, threads that do this will get stuck as
> handle_mm_fault() will determine the page has already been mapped in,
> but we fault again as the page tables aren't loaded.
> 
> To solve this we need code in __switch_to() that save/restores the
> PAN state.
> 
> Signed-off-by: James Morse <james.morse@arm.com>
> CC: Julien Thierry <julien.thierry@arm.com>
> Acked-by: Mark Rutland <mark.rutland@arm.com>

Applied. Thanks.

-- 
Catalin

      parent reply	other threads:[~2018-10-10 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 15:55 [PATCH] Revert "arm64: uaccess: implement unsafe accessors" James Morse
2018-10-10 16:27 ` Julien Thierry
2018-10-10 16:53 ` Catalin Marinas [this message]

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=20181010165316.GB212880@arrakis.emea.arm.com \
    --to=catalin.marinas@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox