[PATCH 11/13] arm64: uaccess: remove set_fs()

Mark Rutland mark.rutland at arm.com
Mon Sep 28 05:02:28 EDT 2020


On Mon, Sep 28, 2020 at 09:04:43AM +0200, Christoph Hellwig wrote:
> > +static inline void init_hw_uaccess_state(void)
> >  {
> > +	asm(ALTERNATIVE("nop", SET_PSTATE_PAN(1), ARM64_HAS_PAN));
> > +	asm(ALTERNATIVE("nop", SET_PSTATE_UAO(0), ARM64_HAS_UAO));
> >  }
> 
> The way I read this code it is about per-task state, maybe that
> could be reflected in the name?  init_task_hw_access_state or
> init_task_uaccess_flags?

My intent writing this was that this resets the HW into the expected
ambient state common to all tasks, so I don't think about this as a
per-task thing (but I agree the transient PAN toggling for atomics means
PAN is per-task state).

I'd prefer not to put 'task' in the name as to me that implies messing
with something like task_struct or other SW state, but if you have
strong feeling about this, I think something like
init_task_hw_access_state() would be fine.

Thanks,
Mark.



More information about the linux-arm-kernel mailing list