Re: [PATCH v5 05/21] KVM: selftests: Add IRQ injection test
From: Sean Christopherson
Date: Thu Jun 04 2026 - 12:33:57 EST
On Thu, Jun 04, 2026, Sean Christopherson wrote:
> On Thu, Jun 04, 2026, Josh Hilke wrote:
> > + eventfd_write(eventfd, 1);
> > +
> > + clock_gettime(CLOCK_MONOTONIC, &start);
> > + for (;;) {
> > + if (GUEST_RECEIVED_IRQ(vcpu))
> > + break;
>
> This is a kludgy and confusing way of writing:
>
> clock_gettime(CLOCK_MONOTONIC, &start);
> while (GUEST_RECEIVED_INTERRUPT(vcpu, do_use_nmi) &&
Heh, "minor" detail:
clock_gettime(CLOCK_MONOTONIC, &start);
while (!GUEST_RECEIVED_INTERRUPT(vcpu, do_use_nmi) &&
timespec_to_ns(timespec_elapsed(start)) <= timeout_ns)
cpu_relax();