[PATCH v1 20/20] selftests: mm: make protection_keys test work on arm64

Dave Hansen dave.hansen at intel.com
Tue Oct 3 09:46:36 PDT 2023


On 9/27/23 07:01, Joey Gouly wrote:
> The encoding of the pkey register differs on arm64, than on x86/ppc. On those
> platforms, a bit in the register is used to disable permissions, for arm64, a
> bit enabled in the register indicates that the permission is allowed.
> 
> This drops two asserts of the form:
> 	 assert(read_pkey_reg() <= orig_pkey_reg);
> Because on arm64 this doesn't hold, due to the encoding.
> 
> The pkey must be reset to both access allow and write allow in the signal
> handler. pkey_access_allow() works currently for PowerPC as the
> PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE have overlapping bits set.
> 
> Access to the uc_mcontext is abstracted, as arm64 has a different structure.

This all looks sane enough.  Welcome to the pkey party! :)

Acked-by: Dave Hansen <dave.hansen at linux.intel.com>



More information about the linux-arm-kernel mailing list