"linux/kvm.h" is not included for code compiled without COMPILING_PER_TARGET, and headers are different depending architecture (arm, arm64). Thus we need to manually expose some definitions that will be used by target/arm, ensuring they are the same for arm amd aarch64.
As well, we must but prudent to not redefine things if code is already including linux/kvm.h, thus the #ifndef COMPILING_PER_TARGET guard. Signed-off-by: Pierrick Bouvier <pierrick.bouv...@linaro.org> --- target/arm/kvm_arm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index c8ddf8beb2e..eedd081064c 100644 --- a/target/arm/kvm_arm.h +++ b/target/arm/kvm_arm.h @@ -16,6 +16,21 @@ #define KVM_ARM_VGIC_V2 (1 << 0) #define KVM_ARM_VGIC_V3 (1 << 1) +#ifndef COMPILING_PER_TARGET + +/* we copy those definitions from asm-arm and asm-aarch64, as they are the same + * for both architectures */ +#define KVM_ARM_IRQ_CPU_IRQ 0 +#define KVM_ARM_IRQ_CPU_FIQ 1 +#define KVM_ARM_IRQ_TYPE_CPU 0 +typedef unsigned int __u32; +struct kvm_vcpu_init { + __u32 target; + __u32 features[7]; +}; + +#endif /* COMPILING_PER_TARGET */ + /** * kvm_arm_register_device: * @mr: memory region for this device -- 2.47.2