KVM: selftests: aarch64: Test userspace IRQ injection
Status from this message: Applied to next, thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/17 | KVM: selftests: aarch64: move gic_v3.h to shared headerstools/ | +0 | 0 replies | |
| 2/17 | KVM: selftests: aarch64: add function for accessing GICv3 dist and redist registerstools/ | +101 | 2 replies | |
| 3/17 | KVM: selftests: aarch64: add GICv3 register accessor library functionstools/ tools/ tools/ +2 more | +189 | 0 replies | |
| 4/17 | KVM: selftests: add kvm_irq_line library functiontools/ tools/ | +23 | 0 replies | |
| 5/17 | KVM: selftests: aarch64: add vGIC library functions to deal with vIRQ statetools/ tools/ tools/ | +116 | 0 replies | |
| 6/17 | KVM: selftests: aarch64: add vgic_irq to test userspace IRQ injectiontools/ tools/ tools/ | +246 | 0 replies | |
| 7/17 | KVM: selftests: aarch64: abstract the injection functions in vgic_irqtools/ | +36 | 0 replies | |
| 8/17 | KVM: selftests: aarch64: cmdline arg to set number of IRQs in vgic_irq testtools/ tools/ tools/ +1 more | +127 | 0 replies | |
| 9/17 | KVM: selftests: aarch64: cmdline arg to set EOI mode in vgic_irqtools/ | +50 | 0 replies | |
| 10/17 | KVM: selftests: aarch64: add preemption tests in vgic_irqtools/ | +90 | 0 replies | |
| 11/17 | KVM: selftests: aarch64: level-sensitive interrupts tests in vgic_irqtools/ | +86 | 0 replies | |
| 12/17 | KVM: selftests: aarch64: add tests for LEVEL_INFO in vgic_irqtools/ | +6 | 0 replies | |
| 13/17 | KVM: selftests: aarch64: add test_inject_fail to vgic_irqtools/ tools/ | +109 | 0 replies | |
| 14/17 | KVM: selftests: add IRQ GSI routing library functionstools/ tools/ | +59 | 0 replies | |
| 15/17 | KVM: selftests: aarch64: add tests for IRQFD in vgic_irqtools/ tools/ | +102 | 0 replies | |
| 16/17 | KVM: selftests: aarch64: add ISPENDR write tests in vgic_irqtools/ | +22 | 0 replies | |
| 17/17 | KVM: selftests: aarch64: add test for restoring active IRQstools/ | +91 | 0 replies |
Reviews trailers per patch
None of the 17 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Andrew Jones |
|---|---|
| Series | A-b |
| 1/17 | |
| 2/17 | |
| 3/17 | |
| 4/17 | |
| 5/17 | |
| 6/17 | |
| 7/17 | |
| 8/17 | |
| 9/17 | |
| 10/17 | |
| 11/17 | |
| 12/17 | |
| 13/17 | |
| 14/17 | |
| 15/17 | |
| 16/17 | |
| 17/17 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/17] KVM: selftests: aarch64: Test userspace IRQ injection
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.
Ricardo Koller (17):
KVM: selftests: aarch64: move gic_v3.h to shared headers
KVM: selftests: aarch64: add function for accessing GICv3 dist and
redist registers
KVM: selftests: aarch64: add GICv3 register accessor library functions
KVM: selftests: add kvm_irq_line library function
KVM: selftests: aarch64: add vGIC library functions to deal with vIRQ
state
KVM: selftests: aarch64: add vgic_irq to test userspace IRQ injection
KVM: selftests: aarch64: abstract the injection functions in vgic_irq
KVM: selftests: aarch64: cmdline arg to set number of IRQs in vgic_irq
test
KVM: selftests: aarch64: cmdline arg to set EOI mode in vgic_irq
KVM: selftests: aarch64: add preemption tests in vgic_irq
KVM: selftests: aarch64: level-sensitive interrupts tests in vgic_irq
KVM: selftests: aarch64: add tests for LEVEL_INFO in vgic_irq
KVM: selftests: aarch64: add test_inject_fail to vgic_irq
KVM: selftests: add IRQ GSI routing library functions
KVM: selftests: aarch64: add tests for IRQFD in vgic_irq
KVM: selftests: aarch64: add ISPENDR write tests in vgic_irq
KVM: selftests: aarch64: add test for restoring active IRQs
tools/testing/selftests/kvm/.gitignore | 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/aarch64/arch_timer.c | 2 +-
.../testing/selftests/kvm/aarch64/vgic_irq.c | 853 ++++++++++++++++++
.../selftests/kvm/include/aarch64/gic.h | 26 +
.../kvm/{lib => include}/aarch64/gic_v3.h | 12 +
.../selftests/kvm/include/aarch64/vgic.h | 18 +-
.../testing/selftests/kvm/include/kvm_util.h | 10 +
tools/testing/selftests/kvm/lib/aarch64/gic.c | 66 ++
.../selftests/kvm/lib/aarch64/gic_private.h | 11 +
.../selftests/kvm/lib/aarch64/gic_v3.c | 206 ++++-
.../testing/selftests/kvm/lib/aarch64/vgic.c | 103 ++-
tools/testing/selftests/kvm/lib/kvm_util.c | 72 ++
13 files changed, 1352 insertions(+), 29 deletions(-)
create mode 100644 tools/testing/selftests/kvm/aarch64/vgic_irq.c
rename tools/testing/selftests/kvm/{lib => include}/aarch64/gic_v3.h (80%)Signature · 1 line
2.34.0.rc0.344.g81b53c2807-goog