[RFC PATCH 09/13] x86/um: nommu: signal handling

Hajime Tazaki thehajime at gmail.com
Fri Oct 25 06:04:59 PDT 2024


On Fri, 25 Oct 2024 18:30:41 +0900,
Johannes Berg wrote:
> 
> On Thu, 2024-10-24 at 21:09 +0900, Hajime Tazaki wrote:
> > This commit updates the behavior of signal handling under !MMU
> > environment. 1) the stack preparation for the signal handlers and
> > 2) retoration of stack after rt_sigreturn(2) syscall.  Those are 
> 
> typo: restoration

will fix it.

> > @@ -562,6 +574,20 @@ SYSCALL_DEFINE0(rt_sigreturn)
> >  	unsigned long sp = PT_REGS_SP(&current->thread.regs);
> >  	struct rt_sigframe __user *frame =
> >  		(struct rt_sigframe __user *)(sp - sizeof(long));
> > +#ifndef CONFIG_MMU
> > +	/**
> > +	 * we enter here with:
> > +	 *
> > +	 * __restore_rt:
> > +	 *     mov $15, %rax
> > +	 *     call *%rax (translated from syscall)
> > +	 *
> > +	 * (code is from musl libc)
> > +	 * so, stack needs to be popped of "call"ed address before
> > +	 * looking at rt_sigframe.
> > +	 */
> > +	frame = (struct rt_sigframe __user *)((unsigned long)frame + sizeof(long));
> > +#endif
> >  	struct ucontext __user *uc = &frame->uc;
> 
> you shouldn't put code in the middle of variable declarations ...
> 
> I see why, but probably just split #if/#else/#endif?

thanks, will reformat it to make it clear.

-- Hajime



More information about the linux-um mailing list