mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
selftests/powerpc: Fix pkey access right updates
The Power ISA mandates that all writes to the Authority Mask Register (AMR) must always be preceded as well as succeeded by a context synchronizing instruction. This makes sure that the tests follow this requirement when attempting to update a pkey's access rights. Signed-off-by: Sandipan Das <sandipan@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200604125610.649668-2-sandipan@linux.ibm.com
This commit is contained in:
committed by
Michael Ellerman
parent
105fb38124
commit
828ca4320d
@@ -57,6 +57,12 @@
|
||||
#define SPRN_PPR 896 /* Program Priority Register */
|
||||
#define SPRN_AMR 13 /* Authority Mask Register - problem state */
|
||||
|
||||
#define set_amr(v) asm volatile("isync;" \
|
||||
"mtspr " __stringify(SPRN_AMR) ",%0;" \
|
||||
"isync" : \
|
||||
: "r" ((unsigned long)(v)) \
|
||||
: "memory")
|
||||
|
||||
/* TEXASR register bits */
|
||||
#define TEXASR_FC 0xFE00000000000000
|
||||
#define TEXASR_FP 0x0100000000000000
|
||||
|
||||
Reference in New Issue
Block a user