From fe3157f3286b8486e25733c9442f1f46e22102ae Mon Sep 17 00:00:00 2001 From: Will Deacon Date: Thu, 24 Nov 2022 11:38:28 +0000 Subject: [PATCH] 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 3137f2e60098 ("firmware/psci: Add debugfs support to ease debugging") ] Bug: 260316363 Signed-off-by: Will Deacon Change-Id: I675a57419064f7f006960ca5370e9dc2d5279a90 Signed-off-by: Quentin Perret --- arch/arm64/kvm/hyp/nvhe/psci-relay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/psci-relay.c b/arch/arm64/kvm/hyp/nvhe/psci-relay.c index 4b26298e7927..0fa155323e19 100644 --- a/arch/arm64/kvm/hyp/nvhe/psci-relay.c +++ b/arch/arm64/kvm/hyp/nvhe/psci-relay.c @@ -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;