1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * ARM Generic Interrupt Controller (GIC) host specific defines 4 */ 5 6 #ifndef SELFTEST_KVM_VGIC_H 7 #define SELFTEST_KVM_VGIC_H 8 9 #include <linux/kvm.h> 10 11 #define REDIST_REGION_ATTR_ADDR(count, base, flags, index) \ 12 (((uint64_t)(count) << 52) | \ 13 ((uint64_t)((base) >> 16) << 16) | \ 14 ((uint64_t)(flags) << 12) | \ 15 index) 16 17 int vgic_v3_setup(struct kvm_vm *vm, unsigned int nr_vcpus, uint32_t nr_irqs, 18 uint64_t gicd_base_gpa, uint64_t gicr_base_gpa); 19 20 #define VGIC_MAX_RESERVED 1023 21 22 void kvm_irq_set_level_info(int gic_fd, uint32_t intid, int level); 23 int _kvm_irq_set_level_info(int gic_fd, uint32_t intid, int level); 24 25 void kvm_arm_irq_line(struct kvm_vm *vm, uint32_t intid, int level); 26 int _kvm_arm_irq_line(struct kvm_vm *vm, uint32_t intid, int level); 27 28 /* The vcpu arg only applies to private interrupts. */ 29 void kvm_irq_write_ispendr(int gic_fd, uint32_t intid, uint32_t vcpu); 30 void kvm_irq_write_isactiver(int gic_fd, uint32_t intid, uint32_t vcpu); 31 32 #define KVM_IRQCHIP_NUM_PINS (1020 - 32) 33 34 #endif // SELFTEST_KVM_VGIC_H 35