Skip to content

x86/apic: PV IPI robustness and subtest selection

Jim Mattson kvm 1 version Applied

Status from this message: Applied to kvm-x86 next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5x86/apic: Skip PV IPI test if feature is not supportedlib/x86/processor.h x86/apic.c x86/unittests.cfg+8 -20 replies
2/5lib: Hoist test selection logic to library for code reuselib/argv.c lib/argv.h x86/vmexit.c+19 -130 replies
3/5x86/apic: Support subtest selection via command linex86/apic.c+30 -270 replies
4/5x86/apic: Introduce pv_ipi()x86/apic.c+13 -40 replies
5/5x86/apic: Add a test for a PV IPI boundary conditionx86/apic.c x86/unittests.cfg+68 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [kvm-unit-tests PATCH 0/5] x86/apic: PV IPI robustness and subtest selection

This series improves the robustness of the APIC test suite, introduces generic subtest selection, and adds a new test case for a PV IPI boundary condition.

1. Robustness: Skip the PV IPI test if KVM PV IPI features are not supported or if not running under KVM, preventing false failures and potential #UDs on bare metal or non-KVM hypervisors.
2. Code Reuse: Hoist the command-line test selection helper from x86/vmexit.c into the common library (lib/argv.c) as argv_test_wanted().
3. Subtest Selection: Refactor x86/apic.c to use this library helper, allowing users to run a subset of APIC tests (e.g., via QEMU's -append option).
4. Refactoring: Extract the KVM PV IPI hypercall inline assembly into a shared pv_ipi() helper.
5. New Test: Add test_pv_ipi_sparse() to verify PV IPI delivery to a vCPU with APIC ID 255. APIC ID 255 is a key boundary condition (the xAPIC/x2APIC transition point, and the MSB of the 64-bit cluster bitmap used by KVM's PV IPI hypercall). A sparse topology is used to verify KVM's handling of sparse APIC ID maps.

Jim Mattson (5):
x86/apic: Skip PV IPI test if feature is not supported
lib: Hoist test selection logic to library for code reuse x86/apic: Support subtest selection via command line x86/apic: Introduce pv_ipi()
x86/apic: Add a test for a PV IPI boundary condition

 lib/argv.c          |  14 +++++
 lib/argv.h          |   3 +
 lib/x86/processor.h |   1 +
 x86/apic.c          | 133 ++++++++++++++++++++++++++++++++++----------
 x86/unittests.cfg   |  12 +++-
 x86/vmexit.c        |  15 +----
 6 files changed, 135 insertions(+), 43 deletions(-)

base-commit: afcc98a30a84aaefc1f0d6783ffffec16c736717

Signature · 1 line
2.55.0.rc0.799.gd6f94ed593-goog