xref: /linux/arch/arm64/include/asm/kvm_nested.h (revision 0678df8271820bcf8fb4f877129f05d68a237de4)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ARM64_KVM_NESTED_H
3 #define __ARM64_KVM_NESTED_H
4 
5 #include <asm/kvm_emulate.h>
6 #include <linux/kvm_host.h>
7 
8 static inline bool vcpu_has_nv(const struct kvm_vcpu *vcpu)
9 {
10 	return (!__is_defined(__KVM_NVHE_HYPERVISOR__) &&
11 		cpus_have_final_cap(ARM64_HAS_NESTED_VIRT) &&
12 		vcpu_has_feature(vcpu, KVM_ARM_VCPU_HAS_EL2));
13 }
14 
15 extern bool __check_nv_sr_forward(struct kvm_vcpu *vcpu);
16 
17 struct sys_reg_params;
18 struct sys_reg_desc;
19 
20 void access_nested_id_reg(struct kvm_vcpu *v, struct sys_reg_params *p,
21 			  const struct sys_reg_desc *r);
22 
23 #endif /* __ARM64_KVM_NESTED_H */
24