All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Ricardo Koller <ricarkol@google.com>
Cc: kvm@vger.kernel.org, maz@kernel.org,
	kvmarm@lists.cs.columbia.edu, eric.auger@redhat.com,
	alexandru.elisei@arm.com, Paolo Bonzini <pbonzini@redhat.com>,
	oupton@google.com, james.morse@arm.com, suzuki.poulose@arm.com,
	shuah@kernel.org, jingzhangos@google.com, pshier@google.com,
	rananta@google.com, reijiw@google.com
Subject: Re: [PATCH 00/17] KVM: selftests: aarch64: Test userspace IRQ injection
Date: Tue, 23 Nov 2021 15:25:24 +0100	[thread overview]
Message-ID: <20211123142524.4bjhdvw5pkx3g5ct@gator.home> (raw)
In-Reply-To: <20211109023906.1091208-1-ricarkol@google.com>

On Mon, Nov 08, 2021 at 06:38:49PM -0800, Ricardo Koller wrote:
> This series adds a new test, aarch64/vgic-irq, that validates the injection of
> different types of IRQs from userspace using various methods and configurations
> (when applicable):
> 
>     Intid        Method     |       |          Configuration
>                             |       |
>                IRQ_LINE     |       |
>     SGI        LEVEL_INFO   |       |
>     PPI    x   IRQFD        |   x   | level-sensitive  x  EOIR + DIR
>     SPI        ISPENDR      |       | edge-triggered      EOIR only
>     bogus      ISACTIVER    |       |
>                             |       |
> 
> vgic-irq is implemented by having a single vcpu started in any of the 4 (2x2)
> configurations above.  The guest then "asks" userspace to inject all intids of
> a given IRQ type using each applicable method via a GUEST_SYNC call.  The
> applicable methods and intids for a given configuration are specified in tables
> like this one:
> 
>     /* edge-triggered */
>     static struct kvm_inject_desc inject_edge_fns[] = {
>             /*                            sgi    ppi    spi */
>             { KVM_IRQ_LINE,               false, false, true },
>             { IRQFD,                      false, false, true },
>             { ISPENDR,                    true,  false, true },
>     };
> 
> Based on the (example) table above, a guest running in an edge-triggered
> configuration will try injecting SGIs and SPIs.  The specific methods are also
> given in the table, e.g.: SGIs are injected from userspace by writing into the
> ISPENDR register.
> 
> This test also adds some extra edge tests like: IRQ preemption, restoring
> active IRQs, trying to inject bogus intid's (e.g., above the configured KVM
> nr_irqs).
> 
> Note that vgic-irq is currently limited to a single vcpu, GICv3, and does not
> test the vITS (no MSIs).
> 
> - Commits 1-3 add some GICv3 library functions on the guest side, e.g.: set the
>   priority of an IRQ.
> - Commits 4-5 add some vGICv3 library functions on the userspace side, e.g.: a
>   wrapper for KVM_IRQ_LINE.
> - Commit 6 adds the basic version of this test: inject an SPI using
>   KVM_IRQ_LINE.
> - Commits 7-17 add other IRQs types, methods and configurations.
>

Hi Ricardo,

I didn't review this in detail, but it looks good and quite thorough. Out
of curiosity did thoroughness come from attempting to get coverage on KVM
code? I.e were you running some sort of code coverage tool on KVM with
these tests?

Unfortunately I probably won't have a chance to look much closer than the
scan I just did, so FWIW

For the series

Acked-by: Andrew Jones <drjones@redhat.com>

Thanks,
drew


WARNING: multiple messages have this Message-ID (diff)
From: Andrew Jones <drjones@redhat.com>
To: Ricardo Koller <ricarkol@google.com>
Cc: shuah@kernel.org, kvm@vger.kernel.org, maz@kernel.org,
	pshier@google.com, Paolo Bonzini <pbonzini@redhat.com>,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH 00/17] KVM: selftests: aarch64: Test userspace IRQ injection
Date: Tue, 23 Nov 2021 15:25:24 +0100	[thread overview]
Message-ID: <20211123142524.4bjhdvw5pkx3g5ct@gator.home> (raw)
In-Reply-To: <20211109023906.1091208-1-ricarkol@google.com>

On Mon, Nov 08, 2021 at 06:38:49PM -0800, Ricardo Koller wrote:
> This series adds a new test, aarch64/vgic-irq, that validates the injection of
> different types of IRQs from userspace using various methods and configurations
> (when applicable):
> 
>     Intid        Method     |       |          Configuration
>                             |       |
>                IRQ_LINE     |       |
>     SGI        LEVEL_INFO   |       |
>     PPI    x   IRQFD        |   x   | level-sensitive  x  EOIR + DIR
>     SPI        ISPENDR      |       | edge-triggered      EOIR only
>     bogus      ISACTIVER    |       |
>                             |       |
> 
> vgic-irq is implemented by having a single vcpu started in any of the 4 (2x2)
> configurations above.  The guest then "asks" userspace to inject all intids of
> a given IRQ type using each applicable method via a GUEST_SYNC call.  The
> applicable methods and intids for a given configuration are specified in tables
> like this one:
> 
>     /* edge-triggered */
>     static struct kvm_inject_desc inject_edge_fns[] = {
>             /*                            sgi    ppi    spi */
>             { KVM_IRQ_LINE,               false, false, true },
>             { IRQFD,                      false, false, true },
>             { ISPENDR,                    true,  false, true },
>     };
> 
> Based on the (example) table above, a guest running in an edge-triggered
> configuration will try injecting SGIs and SPIs.  The specific methods are also
> given in the table, e.g.: SGIs are injected from userspace by writing into the
> ISPENDR register.
> 
> This test also adds some extra edge tests like: IRQ preemption, restoring
> active IRQs, trying to inject bogus intid's (e.g., above the configured KVM
> nr_irqs).
> 
> Note that vgic-irq is currently limited to a single vcpu, GICv3, and does not
> test the vITS (no MSIs).
> 
> - Commits 1-3 add some GICv3 library functions on the guest side, e.g.: set the
>   priority of an IRQ.
> - Commits 4-5 add some vGICv3 library functions on the userspace side, e.g.: a
>   wrapper for KVM_IRQ_LINE.
> - Commit 6 adds the basic version of this test: inject an SPI using
>   KVM_IRQ_LINE.
> - Commits 7-17 add other IRQs types, methods and configurations.
>

Hi Ricardo,

I didn't review this in detail, but it looks good and quite thorough. Out
of curiosity did thoroughness come from attempting to get coverage on KVM
code? I.e were you running some sort of code coverage tool on KVM with
these tests?

Unfortunately I probably won't have a chance to look much closer than the
scan I just did, so FWIW

For the series

Acked-by: Andrew Jones <drjones@redhat.com>

Thanks,
drew

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  parent reply	other threads:[~2021-11-23 14:25 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09  2:38 [PATCH 00/17] KVM: selftests: aarch64: Test userspace IRQ injection Ricardo Koller
2021-11-09  2:38 ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 01/17] KVM: selftests: aarch64: move gic_v3.h to shared headers Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 02/17] KVM: selftests: aarch64: add function for accessing GICv3 dist and redist registers Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-23 15:06   ` Marc Zyngier
2021-11-23 15:06     ` Marc Zyngier
2021-11-25  1:55     ` Ricardo Koller
2021-11-25  1:55       ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 03/17] KVM: selftests: aarch64: add GICv3 register accessor library functions Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 04/17] KVM: selftests: add kvm_irq_line library function Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 05/17] KVM: selftests: aarch64: add vGIC library functions to deal with vIRQ state Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 06/17] KVM: selftests: aarch64: add vgic_irq to test userspace IRQ injection Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 07/17] KVM: selftests: aarch64: abstract the injection functions in vgic_irq Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 08/17] KVM: selftests: aarch64: cmdline arg to set number of IRQs in vgic_irq test Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 09/17] KVM: selftests: aarch64: cmdline arg to set EOI mode in vgic_irq Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:38 ` [PATCH 10/17] KVM: selftests: aarch64: add preemption tests " Ricardo Koller
2021-11-09  2:38   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 11/17] KVM: selftests: aarch64: level-sensitive interrupts " Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 12/17] KVM: selftests: aarch64: add tests for LEVEL_INFO " Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 13/17] KVM: selftests: aarch64: add test_inject_fail to vgic_irq Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 14/17] KVM: selftests: add IRQ GSI routing library functions Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 15/17] KVM: selftests: aarch64: add tests for IRQFD in vgic_irq Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 16/17] KVM: selftests: aarch64: add ISPENDR write tests " Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-09  2:39 ` [PATCH 17/17] KVM: selftests: aarch64: add test for restoring active IRQs Ricardo Koller
2021-11-09  2:39   ` Ricardo Koller
2021-11-23 14:25 ` Andrew Jones [this message]
2021-11-23 14:25   ` [PATCH 00/17] KVM: selftests: aarch64: Test userspace IRQ injection Andrew Jones
2021-11-25  2:23   ` Ricardo Koller
2021-11-25  2:23     ` Ricardo Koller
2021-12-28 19:57 ` Marc Zyngier
2021-12-28 19:57   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211123142524.4bjhdvw5pkx3g5ct@gator.home \
    --to=drjones@redhat.com \
    --cc=alexandru.elisei@arm.com \
    --cc=eric.auger@redhat.com \
    --cc=james.morse@arm.com \
    --cc=jingzhangos@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=oupton@google.com \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.com \
    --cc=rananta@google.com \
    --cc=reijiw@google.com \
    --cc=ricarkol@google.com \
    --cc=shuah@kernel.org \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.