Re: [PATCH v8 4/4] selftests: KVM: testing the local IRQs resets

Cornelia Huck
2020-01-30T11:29:11Z

[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]

On Thu, 30 Jan 2020 12:18:31 +0100
Janosch Frank <frankja@linux.ibm.com> wrote:

> On 1/30/20 11:55 AM, Cornelia Huck wrote:
> > On Wed, 29 Jan 2020 15:03:12 -0500
> > Janosch Frank <frankja@linux.ibm.com> wrote:

> >> + irq_state.len = sizeof(buf);
> >> + irq_state.buf = (unsigned long)buf;
> >> + irqs = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_GET_IRQ_STATE, &irq_state);
> >> + /*
> >> + * irqs contains the number of retrieved interrupts, apart from the
> >> + * emergency call that should be cleared by the resets, there should be
> >> + * none.
> >
> > Even if there were any, they should have been cleared by the reset,
> > right?
>
> Yes, that's what "there should be none" should actually express.
> I added the comment before sending out.

So what about

/*
* irqs contains the number of retrieved interrupts. Any interrupt
* (notably, the emergency call interrupt we have injected) should
* be cleared by the resets, so this should be 0.
*/

?

>
> >
> >> + */
> >> + if (irqs < 0)
> >> + printf("Error by getting IRQ: errno %d\n", errno);
> >
> > "Error getting pending IRQs" ?
>
> "Could not fetch IRQs: errno %d\n" ?

Sounds good.

>
> >
> >> +
> >> + TEST_ASSERT(!irqs, "IRQ pending");
> >> +}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]