Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20240830130150.8568-2-will@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Marc Zyngier and committed by
Will Deacon
0ba5b4ba 7c626ce4

+8
+2
arch/arm/include/asm/hypervisor.h
··· 7 7 void kvm_init_hyp_services(void); 8 8 bool kvm_arm_hyp_service_available(u32 func_id); 9 9 10 + static inline void kvm_arch_init_hyp_services(void) { }; 11 + 10 12 #endif
+4
arch/arm64/include/asm/hypervisor.h
··· 7 7 void kvm_init_hyp_services(void); 8 8 bool kvm_arm_hyp_service_available(u32 func_id); 9 9 10 + static inline void kvm_arch_init_hyp_services(void) 11 + { 12 + }; 13 + 10 14 #endif
+2
drivers/firmware/smccc/kvm_guest.c
··· 39 39 40 40 pr_info("hypervisor services detected (0x%08lx 0x%08lx 0x%08lx 0x%08lx)\n", 41 41 res.a3, res.a2, res.a1, res.a0); 42 + 43 + kvm_arch_init_hyp_services(); 42 44 } 43 45 44 46 bool kvm_arm_hyp_service_available(u32 func_id)