[PATCH] Fix tst-pkey expectations on pkey_get

Lucas A. M. Magalhaes lamm@linux.ibm.com
Wed Feb 12 16:46:00 GMT 2020


> >> Thanks.  Is the patch really correct for 32-bit userspace?
> >> 
> >
> > Thanks for pointing it out. Even in 32-bit mode the mtspr will effect all
> > 64 bits and there is no 32 bit limitation for AMR. I will try to setup
> > a 32 bit userspace machine with pkeys enabled to test this out.
> 
> Thanks.  We may have to tweak the constraints a little bit, though.
> 

Actually there is a problem in this regard we may encounter.  We cannot
ensure that in a context change the upper bits of the GPR will remain
the same. We could either

1. Restrict the usage of the upper pkeys on 32bits.  Maybe the kernel
already restrict already on pkey_alloc.

2. Make it ppc64 specific.

> >> On x86, the hardware has write-disable and read-write-disable flags
> >> instead, which matches the original UAPI interfaces.  This is why no
> >> translation is necessary.
> >
> > Excuse my ignorance. How this translation problem influences the signal
> > handling behaviour?
> 
> The signal handling behavior is just different.  If I recall correctly,
> x86 always resets PKRU to a mostly-disable value, while POWER inherits
> the AMR value from the interrupted thread.  The POWER behavior seems
> more useful to me, but that depends on what the programmer tries to do.
> 

What do you suggest for this.  To change x86 behavior or too change the
test to accept both behaviors?

> I think I have posted x86 patches for changing the behavior, too.
> 

I could not find it.



More information about the Libc-alpha mailing list