FROMLIST: firmware/smccc: Call arch-specific hook on discovering KVM services

arm64 will soon require its own callback to initialise services
that are only availably on this architecture. Introduce a hook
that can be overloaded by the architecture.

Link: https://lore.kernel.org/r/20211004174849.2831548-12-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Bug: 209580772
Change-Id: I743e1786df1477b3c9fab0fe2e5ea52a7dcdf01f
Signed-off-by: Will Deacon <willdeacon@google.com>
This commit is contained in:
Marc Zyngier 2021-10-04 18:48:44 +01:00 committed by Will Deacon
parent f4c9f74c6b
commit 8e3a834c92
3 changed files with 6 additions and 0 deletions

View File

@ -6,5 +6,6 @@
void kvm_init_hyp_services(void);
bool kvm_arm_hyp_service_available(u32 func_id);
void kvm_arm_init_hyp_services(void);
#endif

View File

@ -6,5 +6,6 @@
void kvm_init_hyp_services(void);
bool kvm_arm_hyp_service_available(u32 func_id);
void kvm_arm_init_hyp_services(void);
#endif

View File

@ -9,6 +9,8 @@
#include <asm/hypervisor.h>
void __weak kvm_arm_init_hyp_services(void) {}
static DECLARE_BITMAP(__kvm_arm_hyp_services, ARM_SMCCC_KVM_NUM_FUNCS) __ro_after_init = { };
void __init kvm_init_hyp_services(void)
@ -38,6 +40,8 @@ void __init kvm_init_hyp_services(void)
pr_info("hypervisor services detected (0x%08lx 0x%08lx 0x%08lx 0x%08lx)\n",
res.a3, res.a2, res.a1, res.a0);
kvm_arm_init_hyp_services();
}
bool kvm_arm_hyp_service_available(u32 func_id)