Skip to content

Commit

Permalink
firmware/smccc: Call arch-specific hook on discovering KVM services
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Marc Zyngier authored and willdeacon committed Aug 30, 2024
1 parent 7c626ce commit 0ba5b4b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/include/asm/hypervisor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@
void kvm_init_hyp_services(void);
bool kvm_arm_hyp_service_available(u32 func_id);

static inline void kvm_arch_init_hyp_services(void) { };

#endif
4 changes: 4 additions & 0 deletions arch/arm64/include/asm/hypervisor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
void kvm_init_hyp_services(void);
bool kvm_arm_hyp_service_available(u32 func_id);

static inline void kvm_arch_init_hyp_services(void)
{
};

#endif
2 changes: 2 additions & 0 deletions drivers/firmware/smccc/kvm_guest.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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_arch_init_hyp_services();
}

bool kvm_arm_hyp_service_available(u32 func_id)
Expand Down

0 comments on commit 0ba5b4b

Please sign in to comment.