linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* pkeys on POWER: Default AMR, UAMOR values
@ 2018-05-18 13:17 Florian Weimer
  2018-05-18 14:35 ` Andy Lutomirski
  2018-05-18 17:44 ` Ram Pai
  0 siblings, 2 replies; 8+ messages in thread
From: Florian Weimer @ 2018-05-18 13:17 UTC (permalink / raw)
  To: linuxppc-dev, linux-mm, Ram Pai, Dave Hansen, Andy Lutomirski

I'm working on adding POWER pkeys support to glibc.  The coding work is 
done, but I'm faced with some test suite failures.

Unlike the default x86 configuration, on POWER, existing threads have 
full access to newly allocated keys.

Or, more precisely, in this scenario:

* Thread A launches thread B
* Thread B waits
* Thread A allocations a protection key with pkey_alloc
* Thread A applies the key to a page
* Thread A signals thread B
* Thread B starts to run and accesses the page

Then at the end, the access will be granted.

I hope it's not too late to change this to denied access.

Furthermore, I think the UAMOR value is wrong as well because it 
prevents thread B at the end to set the AMR register.  In particular, if 
I do this

* a?| (as before)
* Thread A signals thread B
* Thread B sets the access rights for the key to PKEY_DISABLE_ACCESS
* Thread B reads the current access rights for the key

then it still gets 0 (all access permitted) because the original UAMOR 
value inherited from thread A prior to the key allocation masks out the 
access right update for the newly allocated key.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-19  5:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 13:17 pkeys on POWER: Default AMR, UAMOR values Florian Weimer
2018-05-18 14:35 ` Andy Lutomirski
2018-05-18 17:44 ` Ram Pai
2018-05-18 19:39   ` Andy Lutomirski
2018-05-18 21:13     ` Florian Weimer
2018-05-19  0:52       ` Ram Pai
2018-05-19  5:15         ` Florian Weimer
2018-05-18 21:09   ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).