Re: Sleeping in user_access section

2018-11-27 Thread H. Peter Anvin
On 11/23/18 3:57 AM, Julien Thierry wrote: > > On x86, the EFLAGS.AC bit is also saved upon exception and I think it is > cleared upon exception entry so there is implicit exit from the > user_access mode when taking exception/interrupt. > No, it is restored, not cleared. In summary: on excepti

Re: Sleeping in user_access section

2018-11-23 Thread Russell King - ARM Linux
On Fri, Nov 23, 2018 at 11:57:31AM +, Julien Thierry wrote: > > > On 23/11/18 10:50, Russell King - ARM Linux wrote: > >On Fri, Nov 23, 2018 at 01:57:12AM -0800, h...@zytor.com wrote: > >>You should never call a sleeping function from a user_access section. > >>It is intended for very limited

Re: Sleeping in user_access section

2018-11-23 Thread Julien Thierry
On 23/11/18 10:50, Russell King - ARM Linux wrote: On Fri, Nov 23, 2018 at 01:57:12AM -0800, h...@zytor.com wrote: You should never call a sleeping function from a user_access section. It is intended for very limited regions. So, what happens if the "unsafe" user access causes a page fault

Re: Sleeping in user_access section

2018-11-23 Thread Russell King - ARM Linux
On Fri, Nov 23, 2018 at 01:57:12AM -0800, h...@zytor.com wrote: > You should never call a sleeping function from a user_access section. > It is intended for very limited regions. So, what happens if the "unsafe" user access causes a page fault that ends up sleeping? -- RMK's Patch system: http:/

Re: Sleeping in user_access section

2018-11-23 Thread Julien Thierry
On 23/11/18 09:57, h...@zytor.com wrote: On November 23, 2018 1:27:02 AM PST, Julien Thierry wrote: Hi, I made an attempt at implementing the user_access_begin()/user_access_end() macros along with the get/put_user_unsafe() for arm64 by toggling the status of PAN (more or less similar to x

Re: Sleeping in user_access section

2018-11-23 Thread hpa
On November 23, 2018 1:27:02 AM PST, Julien Thierry wrote: >Hi, > >I made an attempt at implementing the >user_access_begin()/user_access_end() macros along with the >get/put_user_unsafe() for arm64 by toggling the status of PAN (more or >less similar to x86's STAC/CTAC). > >With a small mista

Sleeping in user_access section

2018-11-23 Thread Julien Thierry
Hi, I made an attempt at implementing the user_access_begin()/user_access_end() macros along with the get/put_user_unsafe() for arm64 by toggling the status of PAN (more or less similar to x86's STAC/CTAC). With a small mistake in my patch, we realized that directly calling function that co