summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/kvm_pkvm.h
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2023-05-23 13:18:20 +0300
committerOliver Upton <oliver.upton@linux.dev>2023-06-02 00:34:50 +0300
commitbc3888a0f4e979ecf9dd8c33a84b8da8cc130790 (patch)
tree8e82812248a4ce48682e680402ecc8b85454ae7f /arch/arm64/include/asm/kvm_pkvm.h
parent12bdce4f41197a1a97ba1c711f77d557841e13d9 (diff)
downloadlinux-bc3888a0f4e979ecf9dd8c33a84b8da8cc130790.tar.xz
KVM: arm64: Allocate pages for hypervisor FF-A mailboxes
The FF-A proxy code needs to allocate its own buffer pair for communication with EL3 and for forwarding calls from the host at EL1. Reserve a couple of pages for this purpose and use them to initialise the hypervisor's FF-A buffer structure. Co-developed-by: Andrew Walbran <qwandor@google.com> Signed-off-by: Andrew Walbran <qwandor@google.com> Signed-off-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20230523101828.7328-4-will@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/include/asm/kvm_pkvm.h')
-rw-r--r--arch/arm64/include/asm/kvm_pkvm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_pkvm.h b/arch/arm64/include/asm/kvm_pkvm.h
index 01129b0d4c68..2b495ec59deb 100644
--- a/arch/arm64/include/asm/kvm_pkvm.h
+++ b/arch/arm64/include/asm/kvm_pkvm.h
@@ -106,4 +106,12 @@ static inline unsigned long host_s2_pgtable_pages(void)
return res;
}
+#define KVM_FFA_MBOX_NR_PAGES 1
+
+static inline unsigned long hyp_ffa_proxy_pages(void)
+{
+ /* A page each for the hypervisor's RX and TX mailboxes. */
+ return 2 * KVM_FFA_MBOX_NR_PAGES;
+}
+
#endif /* __ARM64_KVM_PKVM_H__ */