Lines Matching full:intid
7 * host to inject a specific intid via a GUEST_SYNC call, and then checks that
87 #define _KVM_INJECT_MULTI(cmd, intid, num, expect_failure) \ argument
88 kvm_inject_call(cmd, intid, num, -1 /* not used */, expect_failure)
90 #define KVM_INJECT_MULTI(cmd, intid, num) \ argument
91 _KVM_INJECT_MULTI(cmd, intid, num, false)
93 #define _KVM_INJECT(cmd, intid, expect_failure) \ argument
94 _KVM_INJECT_MULTI(cmd, intid, 1, expect_failure)
96 #define KVM_INJECT(cmd, intid) \ argument
97 _KVM_INJECT_MULTI(cmd, intid, 1, false)
99 #define KVM_ACTIVATE(cmd, intid) \ argument
100 kvm_inject_call(cmd, intid, 1, 1, false);
168 static void guest_set_irq_line(uint32_t intid, uint32_t level);
172 uint32_t intid = gic_get_and_ack_irq(); in guest_irq_generic_handler() local
174 if (intid == IAR_SPURIOUS) in guest_irq_generic_handler()
177 GUEST_ASSERT(gic_irq_get_active(intid)); in guest_irq_generic_handler()
180 GUEST_ASSERT(!gic_irq_get_pending(intid)); in guest_irq_generic_handler()
183 guest_set_irq_line(intid, 0); in guest_irq_generic_handler()
185 GUEST_ASSERT(intid < MAX_SPI); in guest_irq_generic_handler()
186 irqnr_received[intid] += 1; in guest_irq_generic_handler()
189 gic_set_eoi(intid); in guest_irq_generic_handler()
192 gic_set_dir(intid); in guest_irq_generic_handler()
194 GUEST_ASSERT(!gic_irq_get_active(intid)); in guest_irq_generic_handler()
195 GUEST_ASSERT(!gic_irq_get_pending(intid)); in guest_irq_generic_handler()
246 static void guest_set_irq_line(uint32_t intid, uint32_t level) in guest_set_irq_line() argument
248 kvm_inject_call(KVM_SET_IRQ_LINE, intid, 1, level, false); in guest_set_irq_line()
252 uint32_t intid, kvm_inject_cmd cmd) in test_inject_fail() argument
256 _KVM_INJECT(cmd, intid, true); in test_inject_fail()
305 uint32_t prio, intid, ap1r; in guest_restore_active() local
310 * in descending order, so intid+1 can preempt intid. in guest_restore_active()
314 intid = i + first_intid; in guest_restore_active()
315 gic_set_priority(intid, prio); in guest_restore_active()
323 intid = i + first_intid; in guest_restore_active()
324 KVM_ACTIVATE(cmd, intid); in guest_restore_active()
334 intid = num - i - 1 + first_intid; in guest_restore_active()
335 gic_set_eoi(intid); in guest_restore_active()
337 gic_set_dir(intid); in guest_restore_active()
354 uint32_t intid; in wait_for_and_activate_irq() local
358 intid = gic_get_and_ack_irq(); in wait_for_and_activate_irq()
359 } while (intid == IAR_SPURIOUS); in wait_for_and_activate_irq()
361 return intid; in wait_for_and_activate_irq()
373 uint32_t intid, prio, step = KVM_PRIO_STEPS; in test_inject_preemption() local
377 * in descending order, so intid+1 can preempt intid. in test_inject_preemption()
381 intid = i + first_intid; in test_inject_preemption()
382 gic_set_priority(intid, prio); in test_inject_preemption()
389 intid = i + first_intid; in test_inject_preemption()
390 KVM_INJECT(cmd, intid); in test_inject_preemption()
393 GUEST_ASSERT_EQ(tmp, intid); in test_inject_preemption()
395 guest_set_irq_line(intid, 0); in test_inject_preemption()
400 intid = num - i - 1 + first_intid; in test_inject_preemption()
401 gic_set_eoi(intid); in test_inject_preemption()
403 gic_set_dir(intid); in test_inject_preemption()
517 static void kvm_irq_line_check(struct kvm_vm *vm, uint32_t intid, int level, in kvm_irq_line_check() argument
523 kvm_arm_irq_line(vm, intid, level); in kvm_irq_line_check()
525 /* The interface doesn't allow larger intid's. */ in kvm_irq_line_check()
526 if (intid > KVM_ARM_IRQ_NUM_MASK) in kvm_irq_line_check()
529 ret = _kvm_arm_irq_line(vm, intid, level); in kvm_irq_line_check()
531 "Bad intid %i did not cause KVM_IRQ_LINE " in kvm_irq_line_check()
532 "error: rc: %i errno: %i", intid, ret, errno); in kvm_irq_line_check()
536 void kvm_irq_set_level_info_check(int gic_fd, uint32_t intid, int level, in kvm_irq_set_level_info_check() argument
540 kvm_irq_set_level_info(gic_fd, intid, level); in kvm_irq_set_level_info_check()
542 int ret = _kvm_irq_set_level_info(gic_fd, intid, level); in kvm_irq_set_level_info_check()
545 * are not level-sensitive). It only checks for intid to not in kvm_irq_set_level_info_check()
547 * are supposed to mask the intid with 0x3ff (1023). in kvm_irq_set_level_info_check()
549 if (intid > VGIC_MAX_RESERVED) in kvm_irq_set_level_info_check()
551 "Bad intid %i did not cause VGIC_GRP_LEVEL_INFO " in kvm_irq_set_level_info_check()
552 "error: rc: %i errno: %i", intid, ret, errno); in kvm_irq_set_level_info_check()
555 "for intid %i failed, rc: %i errno: %i", in kvm_irq_set_level_info_check()
556 intid, ret, errno); in kvm_irq_set_level_info_check()
561 uint32_t intid, uint32_t num, uint32_t kvm_max_routes, in kvm_set_gsi_routing_irqchip_check() argument
571 for (i = intid; i < (uint64_t)intid + num; i++) in kvm_set_gsi_routing_irqchip_check()
579 if (((uint64_t)intid + num - 1 - MIN_SPI) >= KVM_IRQCHIP_NUM_PINS) in kvm_set_gsi_routing_irqchip_check()
581 "Bad intid %u did not cause KVM_SET_GSI_ROUTING " in kvm_set_gsi_routing_irqchip_check()
582 "error: rc: %i errno: %i", intid, ret, errno); in kvm_set_gsi_routing_irqchip_check()
585 "for intid %i failed, rc: %i errno: %i", in kvm_set_gsi_routing_irqchip_check()
586 intid, ret, errno); in kvm_set_gsi_routing_irqchip_check()
590 static void kvm_irq_write_ispendr_check(int gic_fd, uint32_t intid, in kvm_irq_write_ispendr_check() argument
602 kvm_irq_write_ispendr(gic_fd, intid, vcpu); in kvm_irq_write_ispendr_check()
606 uint32_t intid, uint32_t num, uint32_t kvm_max_routes, in kvm_routing_and_irqfd_check() argument
619 if (INTID_IS_SGI(intid) || INTID_IS_PPI(intid)) in kvm_routing_and_irqfd_check()
622 kvm_set_gsi_routing_irqchip_check(vm, intid, num, in kvm_routing_and_irqfd_check()
631 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
636 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
645 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) { in kvm_routing_and_irqfd_check()
652 for (f = 0, i = intid; i < (uint64_t)intid + num; i++, f++) in kvm_routing_and_irqfd_check()
656 /* handles the valid case: intid=0xffffffff num=1 */
667 uint32_t intid = inject_args->first_intid; in run_guest_cmd() local
675 /* handles the valid case: intid=0xffffffff num=1 */ in run_guest_cmd()
676 assert(intid < UINT_MAX - num || num == 1); in run_guest_cmd()
680 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
683 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
688 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
693 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
698 for_each_intid(intid, num, tmp, i) in run_guest_cmd()
703 kvm_routing_and_irqfd_check(vm, intid, num, in run_guest_cmd()
708 for (i = intid; i < intid + num; i++) in run_guest_cmd()
713 for (i = intid; i < intid + num; i++) in run_guest_cmd()