@@ -466,9 +466,4 @@ static __always_inline void kvm_incr_pc(struct kvm_vcpu *vcpu)
vcpu->arch.flags |= KVM_ARM64_INCREMENT_PC;
}
-static inline bool vcpu_has_feature(struct kvm_vcpu *vcpu, int feature)
-{
- return test_bit(feature, vcpu->arch.features);
-}
-
#endif /* __ARM64_KVM_EMULATE_H__ */
@@ -774,6 +774,9 @@ int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type);
int kvm_arm_vcpu_finalize(struct kvm_vcpu *vcpu, int feature);
bool kvm_arm_vcpu_is_finalized(struct kvm_vcpu *vcpu);
+#define vcpu_has_feature(vcpu, feature) \
+ (test_bit((feature), (vcpu)->arch.features))
+
#define kvm_arm_vcpu_sve_finalized(vcpu) \
((vcpu)->arch.flags & KVM_ARM64_VCPU_SVE_FINALIZED)
Move the vcpu_has_feature() function to asm/kvm_host.h in preparation for replacing test_bit() feature checks. struct kvm_vcpu is defined in linux/kvm_host.h, which includes asm/kvm_host.h; the function has been transformed into a macro to avoid compiler errors about struct kvm_vcpu being undefined. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- arch/arm64/include/asm/kvm_emulate.h | 5 ----- arch/arm64/include/asm/kvm_host.h | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-)