Lines Matching full:intid

7  * host to inject a specific intid via a GUEST_SYNC call, and then checks that
80 #define _KVM_INJECT_MULTI(cmd, intid, num, expect_failure) \ argument
81 kvm_inject_call(cmd, intid, num, -1 /* not used */, expect_failure)
83 #define KVM_INJECT_MULTI(cmd, intid, num) \ argument
84 _KVM_INJECT_MULTI(cmd, intid, num, false)
86 #define _KVM_INJECT(cmd, intid, expect_failure) \ argument
87 _KVM_INJECT_MULTI(cmd, intid, 1, expect_failure)
89 #define KVM_INJECT(cmd, intid) \ argument
90 _KVM_INJECT_MULTI(cmd, intid, 1, false)
92 #define KVM_ACTIVATE(cmd, intid) \ argument
93 kvm_inject_call(cmd, intid, 1, 1, false);
161 static void guest_set_irq_line(uint32_t intid, uint32_t level);
165 uint32_t intid = gic_get_and_ack_irq(); in guest_irq_generic_handler() local
167 if (intid == IAR_SPURIOUS) in guest_irq_generic_handler()
170 GUEST_ASSERT(gic_irq_get_active(intid)); in guest_irq_generic_handler()
173 GUEST_ASSERT(!gic_irq_get_pending(intid)); in guest_irq_generic_handler()
176 guest_set_irq_line(intid, 0); in guest_irq_generic_handler()
178 GUEST_ASSERT(intid < MAX_SPI); in guest_irq_generic_handler()
179 irqnr_received[intid] += 1; in guest_irq_generic_handler()
182 gic_set_eoi(intid); in guest_irq_generic_handler()
185 gic_set_dir(intid); in guest_irq_generic_handler()
187 GUEST_ASSERT(!gic_irq_get_active(intid)); in guest_irq_generic_handler()
188 GUEST_ASSERT(!gic_irq_get_pending(intid)); in guest_irq_generic_handler()
239 static void guest_set_irq_line(uint32_t intid, uint32_t level) in guest_set_irq_line() argument
241 kvm_inject_call(KVM_SET_IRQ_LINE, intid, 1, level, false); in guest_set_irq_line()
245 uint32_t intid, kvm_inject_cmd cmd) in test_inject_fail() argument
249 _KVM_INJECT(cmd, intid, true); in test_inject_fail()
297 uint32_t prio, intid, ap1r; in guest_restore_active() local
302 * in descending order, so intid+1 can preempt intid. in guest_restore_active()
306 intid = i + first_intid; in guest_restore_active()
307 gic_set_priority(intid, prio); in guest_restore_active()
315 intid = i + first_intid; in guest_restore_active()
316 KVM_ACTIVATE(cmd, intid); in guest_restore_active()
326 intid = num - i - 1 + first_intid; in guest_restore_active()
327 gic_set_eoi(intid); in guest_restore_active()
329 gic_set_dir(intid); in guest_restore_active()
346 uint32_t intid; in wait_for_and_activate_irq() local
350 intid = gic_get_and_ack_irq(); in wait_for_and_activate_irq()
351 } while (intid == IAR_SPURIOUS); in wait_for_and_activate_irq()
353 return intid; in wait_for_and_activate_irq()
365 uint32_t intid, prio, step = KVM_PRIO_STEPS; in test_inject_preemption() local
369 * in descending order, so intid+1 can preempt intid. in test_inject_preemption()
373 intid = i + first_intid; in test_inject_preemption()
374 gic_set_priority(intid, prio); in test_inject_preemption()
381 intid = i + first_intid; in test_inject_preemption()
382 KVM_INJECT(cmd, intid); in test_inject_preemption()
385 GUEST_ASSERT_EQ(tmp, intid); in test_inject_preemption()
387 guest_set_irq_line(intid, 0); in test_inject_preemption()
392 intid = num - i - 1 + first_intid; in test_inject_preemption()
393 gic_set_eoi(intid); in test_inject_preemption()
395 gic_set_dir(intid); in test_inject_preemption()
509 static void kvm_irq_line_check(struct kvm_vm *vm, uint32_t intid, int level, in kvm_irq_line_check() argument
515 kvm_arm_irq_line(vm, intid, level); in kvm_irq_line_check()
517 /* The interface doesn't allow larger intid's. */ in kvm_irq_line_check()
518 if (intid > KVM_ARM_IRQ_NUM_MASK) in kvm_irq_line_check()
521 ret = _kvm_arm_irq_line(vm, intid, level); in kvm_irq_line_check()
523 "Bad intid %i did not cause KVM_IRQ_LINE " in kvm_irq_line_check()
524 "error: rc: %i errno: %i", intid, ret, errno); in kvm_irq_line_check()
528 void kvm_irq_set_level_info_check(int gic_fd, uint32_t intid, int level, in kvm_irq_set_level_info_check() argument
532 kvm_irq_set_level_info(gic_fd, intid, level); in kvm_irq_set_level_info_check()
534 int ret = _kvm_irq_set_level_info(gic_fd, intid, level); in kvm_irq_set_level_info_check()
537 * are not level-sensitive). It only checks for intid to not in kvm_irq_set_level_info_check()
539 * are supposed to mask the intid with 0x3ff (1023). in kvm_irq_set_level_info_check()
541 if (intid > VGIC_MAX_RESERVED) in kvm_irq_set_level_info_check()
543 "Bad intid %i did not cause VGIC_GRP_LEVEL_INFO " in kvm_irq_set_level_info_check()
544 "error: rc: %i errno: %i", intid, ret, errno); in kvm_irq_set_level_info_check()
547 "for intid %i failed, rc: %i errno: %i", in kvm_irq_set_level_info_check()
548 intid, ret, errno); in kvm_irq_set_level_info_check()
553 uint32_t intid, uint32_t num, uint32_t kvm_max_routes, in kvm_set_gsi_routing_irqchip_check() argument
563 for (i = intid; i < (uint64_t)intid + num; i++) in kvm_set_gsi_routing_irqchip_check()
571 if (((uint64_t)intid + num - 1 - MIN_SPI) >= KVM_IRQCHIP_NUM_PINS) in kvm_set_gsi_routing_irqchip_check()
573 "Bad intid %u did not cause KVM_SET_GSI_ROUTING " in kvm_set_gsi_routing_irqchip_check()
574 "error: rc: %i errno: %i", intid, ret, errno); in kvm_set_gsi_routing_irqchip_check()
577 "for intid %i failed, rc: %i errno: %i", in kvm_set_gsi_routing_irqchip_check()
578 intid, ret, errno); in kvm_set_gsi_routing_irqchip_check()
582 static void kvm_irq_write_ispendr_check(int gic_fd, uint32_t intid, in kvm_irq_write_ispendr_check() argument
594 kvm_irq_write_ispendr(gic_fd, intid, vcpu); in kvm_irq_write_ispendr_check()
598 uint32_t intid, uint32_t num, uint32_t kvm_max_routes, in kvm_routing_and_irqfd_check() argument
611 if (INTID_IS_SGI(intid) || INTID_IS_PPI(intid)) in kvm_routing_and_irqfd_check()
614 kvm_set_gsi_routing_irqchip_check(vm, intid, num, in kvm_routing_and_irqfd_check()
623 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
628 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
637 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
644 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) in kvm_routing_and_irqfd_check()
648 /* handles the valid case: intid=0xffffffff num=1 */
659 uint32_t intid = inject_args->first_intid; in run_guest_cmd() local
667 /* handles the valid case: intid=0xffffffff num=1 */ in run_guest_cmd()
668 assert(intid < UINT_MAX - num || num == 1); in run_guest_cmd()
672 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
675 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
680 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
685 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
690 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
695 kvm_routing_and_irqfd_check(vm, intid, num, in run_guest_cmd()
700 for (i = intid; i < intid + num; i++) in run_guest_cmd()
705 for (i = intid; i < intid + num; i++) in run_guest_cmd()