Aymeric Vincent | 14 Apr 2004 13:01
Picon

SRR1 bits in signal trampolines


Hi,

when I run "startx", the X server immediately dies as soon as it gets a 
SIGALRM, which is as soon as it gets started.

    248 XFree86  PSIG  SIGALRM caught handler=0x18ae57c mask=())
    248 XFree86  CALL  compat_16___sigreturn14(0xffffe7e0)
    248 XFree86  RET   compat_16___sigreturn14 -1 errno 22 Invalid 
argument
    248 XFree86  CALL  exit(0x16)

The problem is with the following test in 
powerpc/powerpc/compat_16_machdep.c:compat_16_sys___sigreturn14():

   if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 &PSL_USERSTATIC))
     return (EINVAL);

and/or with this definition in powerpc/include/psl.h:

/*
  * A user is not allowed to change any MSR bits except the following:
  */
#define PSL_USERSTATIC 
(~(PSL_VEC|PSL_FP|PSL_FE0|PSL_FE1|PSL_LE|PSL_SE|PSL_BE))

SRR1 can have bits 1-4 and 10-15 modified depending on the exception 
taken. In my case, a printf() shows that bit 2 (0x40000000) gets set in 
sc.sc_frame.srr1. I don't know why it does now and why it didn't 
before, but the fact is that it does, and the documentation says we 
(Continue reading)

Aymeric Vincent | 20 Apr 2004 17:42
Picon

Re: SRR1 bits in signal trampolines


	Hi,

for the record, it looks like Matt Thomas was working on this issue 
because he committed fixes for this without noticing my e-mail.

  Aymeric

Aymeric Vincent wrote:

> The problem is with the following test in 
> powerpc/powerpc/compat_16_machdep.c:compat_16_sys___sigreturn14():
>
>   if ((sc.sc_frame.srr1 & PSL_USERSTATIC) != (tf->srr1 
> &PSL_USERSTATIC))
>     return (EINVAL);


Gmane