[PATCHv4 14/17] arm64: uaccess: remove set_fs()

Mark Rutland mark.rutland at arm.com
Tue Dec 1 07:30:37 EST 2020


On Thu, Nov 26, 2020 at 06:42:26PM +0000, James Morse wrote:
> On 13/11/2020 12:49, Mark Rutland wrote:
> > Now that the uaccess primitives dont take addr_limit into acccount, we
> 
> (account)

I've fixed that up locally.

[...]

> > @@ -193,8 +193,7 @@ struct pt_regs {
> >  	s32 syscallno;
> >  	u32 unused2;
> >  #endif
> > -
> > -	u64 orig_addr_limit;
> > +	u64 sdei_ttbr1;
> >  	/* Only valid when ARM64_HAS_IRQ_PRIO_MASKING is enabled. */
> >  	u64 pmr_save;
> >  	u64 stackframe[2];
> 
> Hmmm,

> >  	/*
> > -	 * Use reg->interrupted_regs.addr_limit to remember whether to unmap
> > -	 * the kernel on exit.
> > +	 * Remember whether to unmap the kernel on exit.
> >  	 */
> > -1:	str	x4, [x1, #(SDEI_EVENT_INTREGS + S_ORIG_ADDR_LIMIT)]
> > +1:	str	x4, [x1, #(SDEI_EVENT_INTREGS + S_SDEI_TTBR1)]
> >  
> >  #ifdef CONFIG_RANDOMIZE_BASE
> >  	adr	x4, tramp_vectors + PAGE_SIZE
> > @@ -1023,7 +1010,7 @@ NOKPROBE(__sdei_asm_entry_trampoline)
> >   * x4: struct sdei_registered_event argument from registration time.
> >   */
> >  SYM_CODE_START(__sdei_asm_exit_trampoline)
> > -	ldr	x4, [x4, #(SDEI_EVENT_INTREGS + S_ORIG_ADDR_LIMIT)]
> > +	ldr	x4, [x4, #(SDEI_EVENT_INTREGS + S_SDEI_TTBR1)]
> >  	cbnz	x4, 1f
> >  
> >  	tramp_unmap_kernel	tmp=x4
> 
> Ah, that. This was previously abusing orig_addr_limit as the space was already there, and
> if you squint....
>
> Now it seems odd to waste that space in every pt_regs given its only needed in here, but
> its still needed for padding. If more padding ever turns up I'll add cleaning this up to
> my todo list.

Mhmm. For now, I've added a comment to the commit message to point out
what going on here.

> Acked-by: James Morse <james.morse at arm.com>

Thanks!

Mark.



More information about the linux-arm-kernel mailing list