From: Christoph Hellwig <hch@lst.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>, linux-kernel@vger.kernel.org
Subject: Re: user_access_{save,restore}() semantics
Date: Fri, 10 Jul 2020 18:46:25 +0200 [thread overview]
Message-ID: <20200710164625.GA23719@lst.de> (raw)
In-Reply-To: <20200710164037.GV597537@hirez.programming.kicks-ass.net>
On Fri, Jul 10, 2020 at 06:40:37PM +0200, Peter Zijlstra wrote:
> On Fri, Jul 10, 2020 at 06:15:27PM +0200, Christoph Hellwig wrote:
> > Hi Peter,
> >
> > can you explain (and maybe document while we're at it) what the
> > exact semantics of the user_access_{save,restore} helpers are?
> >
> > Reverse engineering from the commit text they seem to be about
> > saving the current uaccess state. But do they also enable/disable
> > anything?
>
> user_access_save() is like local_irq_save(), it stores the EFLAGS and
> clears AC/IF resp. user_access_restore(), like local_irq_restore(),
> simply restores the previously saved EFLAGS.
>
> So for code that had user_access_begin(),
> user_access_save()/user_access_restore() will temporarily disable
> user-access and allow calling other code.
>
> something like so?
Looks good, thanks!
prev parent reply other threads:[~2020-07-10 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 16:15 user_access_{save,restore}() semantics Christoph Hellwig
2020-07-10 16:40 ` Peter Zijlstra
2020-07-10 16:46 ` Christoph Hellwig [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=20200710164625.GA23719@lst.de \
--to=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@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.