Linux 6.7-rc7
[linux-modified.git] / arch / arm64 / include / asm / kvm_nested.h
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 */