KVM: selftests: aarch64: Abstract the injection functions in vgic_irq
authorRicardo Koller <ricarkol@google.com>
Tue, 9 Nov 2021 02:38:56 +0000 (18:38 -0800)
committerMarc Zyngier <maz@kernel.org>
Tue, 28 Dec 2021 19:23:49 +0000 (19:23 +0000)
commite1cb399eed1eda29568b17bdb75d16cee1fc3da4
tree7e6848bb19ef5c0de772c15eda4062b822ff0a19
parent50b020cdb7f72077e16133f1d88c9359cf415a53
KVM: selftests: aarch64: Abstract the injection functions in vgic_irq

Build an abstraction around the injection functions, so the preparation
and checking around the actual injection can be shared between tests.
All functions are stored as pointers in arrays of kvm_inject_desc's
which include the pointer and what kind of interrupts they can inject.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
Acked-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211109023906.1091208-8-ricarkol@google.com
tools/testing/selftests/kvm/aarch64/vgic_irq.c