1 #ifndef ARM_COMMON__KVM_CPU_ARCH_H 2 #define ARM_COMMON__KVM_CPU_ARCH_H 3 4 #include <linux/kvm.h> 5 #include <pthread.h> 6 #include <stdbool.h> 7 8 struct kvm; 9 10 struct kvm_cpu { 11 pthread_t thread; 12 13 unsigned long cpu_id; 14 unsigned long cpu_type; 15 const char *cpu_compatible; 16 17 struct kvm *kvm; 18 int vcpu_fd; 19 struct kvm_run *kvm_run; 20 21 u8 is_running; 22 u8 paused; 23 u8 needs_nmi; 24 25 struct kvm_coalesced_mmio_ring *ring; 26 27 void (*generate_fdt_nodes)(void *fdt, struct kvm* kvm, 28 u32 gic_phandle); 29 }; 30 31 struct kvm_arm_target { 32 u32 id; 33 const char *compatible; 34 int (*init)(struct kvm_cpu *vcpu); 35 }; 36 37 int kvm_cpu__register_kvm_arm_target(struct kvm_arm_target *target); 38 39 static inline bool kvm_cpu__emulate_io(struct kvm *kvm, u16 port, void *data, 40 int direction, int size, u32 count) 41 { 42 return false; 43 } 44 45 bool kvm_cpu__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, 46 u8 is_write); 47 48 #endif /* ARM_COMMON__KVM_CPU_ARCH_H */ 49