selftests/powerpc: ptrace-pkey: Don't update expected UAMOR value
BugLink: https://bugs.launchpad.net/bugs/1892899 [ Upstream commit3563b9bea0
] With commit4a4a5e5d2a
("powerpc/pkeys: key allocation/deallocation must not change pkey registers") we are not updating UAMOR on key allocation. So don't update the expected uamor value in the test. Fixes:4a4a5e5d2a
("powerpc/pkeys: key allocation/deallocation must not change pkey registers") Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200709032946.881753-23-aneesh.kumar@linux.ibm.com Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
This commit is contained in:
parent
567b7c2938
commit
4e7ea359b4
|
@ -101,15 +101,20 @@ static int child(struct shared_info *info)
|
|||
*/
|
||||
info->invalid_amr = info->amr2 | (~0x0UL & ~info->expected_uamor);
|
||||
|
||||
/*
|
||||
* if PKEY_DISABLE_EXECUTE succeeded we should update the expected_iamr
|
||||
*/
|
||||
if (disable_execute)
|
||||
info->expected_iamr |= 1ul << pkeyshift(pkey1);
|
||||
else
|
||||
info->expected_iamr &= ~(1ul << pkeyshift(pkey1));
|
||||
|
||||
info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3));
|
||||
/*
|
||||
* We allocated pkey2 and pkey 3 above. Clear the IAMR bits.
|
||||
*/
|
||||
info->expected_iamr &= ~(1ul << pkeyshift(pkey2));
|
||||
info->expected_iamr &= ~(1ul << pkeyshift(pkey3));
|
||||
|
||||
info->expected_uamor |= 3ul << pkeyshift(pkey1) |
|
||||
3ul << pkeyshift(pkey2);
|
||||
/*
|
||||
* Create an IAMR value different from expected value.
|
||||
* Kernel will reject an IAMR and UAMOR change.
|
||||
|
|
Loading…
Reference in New Issue