[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200710164625.GA23719@lst.de>
Date: Fri, 10 Jul 2020 18:46:25 +0200
From: Christoph Hellwig <hch@....de>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Christoph Hellwig <hch@....de>, linux-kernel@...r.kernel.org
Subject: Re: user_access_{save,restore}() semantics
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!
Powered by blists - more mailing lists