summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/hypervisor.h
blob: 8889a0ba1ec5ae0327748cd520aaf4ad8e4e36e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_ARM64_HYPERVISOR_H
#define _ASM_ARM64_HYPERVISOR_H

#include <asm/xen/hypervisor.h>
#include <linux/jump_label.h>

DECLARE_STATIC_KEY_FALSE(pkvm_guest);

void kvm_init_hyp_services(void);
bool kvm_arm_hyp_service_available(u32 func_id);
void kvm_arm_target_impl_cpu_init(void);

#ifdef CONFIG_ARM_PKVM_GUEST
void pkvm_init_hyp_services(void);

static inline bool is_protected_kvm_guest(void)
{
	return static_branch_unlikely(&pkvm_guest);
}
#else
static inline void pkvm_init_hyp_services(void) { };

static inline bool is_protected_kvm_guest(void)
{
	return false;
}
#endif

static inline void kvm_arch_init_hyp_services(void)
{
	pkvm_init_hyp_services();
};

#endif