ANDROID: KVM: arm64: Use 32-bit function ID for PSCI MEM_PROTECT call

The PSCI specification defines only a 32-bit function ID for the
MEM_PROTECT call used to protect against cold reboot attacks.

Fix the pKVM hypervisor invocation of MEM_PROTECT to use the 32-bit
function ID instead of the unallocated 64-bit flavour.

[ qperret: dropped the change to include/uapi/linux/psci.h as the 32 bit
  variant of the call have been introduced upstream by 3137f2e600
  ("firmware/psci: Add debugfs support to ease debugging") ]

Bug: 260316363
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I675a57419064f7f006960ca5370e9dc2d5279a90
Signed-off-by: Quentin Perret <qperret@google.com>
This commit is contained in:
Will Deacon 2022-11-24 11:38:28 +00:00 committed by Quentin Perret
parent 8260bd357c
commit fe3157f328

View file

@ -236,7 +236,7 @@ static u64 psci_mem_protect(s64 offset)
return cnt;
if (!cnt || !new)
psci_call(PSCI_1_1_FN64_MEM_PROTECT, offset < 0 ? 0 : 1, 0, 0);
psci_call(PSCI_1_1_FN_MEM_PROTECT, offset < 0 ? 0 : 1, 0, 0);
cnt = new;
return cnt;