Skip to content

Commit 0ba5b4b

Browse files
Marc Zyngierwilldeacon
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 7c626ce commit 0ba5b4b

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

arch/arm/include/asm/hypervisor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
void kvm_init_hyp_services(void);
88
bool kvm_arm_hyp_service_available(u32 func_id);
99

10+
static inline void kvm_arch_init_hyp_services(void) { };
11+
1012
#endif

arch/arm64/include/asm/hypervisor.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77
void kvm_init_hyp_services(void);
88
bool kvm_arm_hyp_service_available(u32 func_id);
99

10+
static inline void kvm_arch_init_hyp_services(void)
11+
{
12+
};
13+
1014
#endif

drivers/firmware/smccc/kvm_guest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ void __init kvm_init_hyp_services(void)
3939

4040
pr_info("hypervisor services detected (0x%08lx 0x%08lx 0x%08lx 0x%08lx)\n",
4141
res.a3, res.a2, res.a1, res.a0);
42+
43+
kvm_arch_init_hyp_services();
4244
}
4345

4446
bool kvm_arm_hyp_service_available(u32 func_id)

0 commit comments

Comments
 (0)