[PATCH v7 8/8] KVM: selftests: Skip hardware_disable_test on powerpc pseries LPAR

From: Ritesh Harjani (IBM)

Date: Tue Oct 06 2026 - 06:33:41 EST


The test forks 512 children, each of which does KVM_CREATE_VM and then
SIGKILLs without waiting. On a PAPR LPAR that ioctl is H_GUEST_CREATE
and unreaped guests may still occupy L0 Guest Management Space, which
means create can fail with -ENOMEM error.
Hence, skip the test when we are running on powerpc pseries LPAR.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx>
---
tools/testing/selftests/kvm/Makefile.kvm | 1 +
tools/testing/selftests/kvm/hardware_disable_test.c | 3 +++
2 files changed, 4 insertions(+)

diff --git a/tools/testing/selftests/kvm/Makefile.kvm b/tools/testing/selftests/kvm/Makefile.kvm
index 692bbae44a65..38c3900cac68 100644
--- a/tools/testing/selftests/kvm/Makefile.kvm
+++ b/tools/testing/selftests/kvm/Makefile.kvm
@@ -258,6 +258,7 @@ TEST_GEN_PROGS_loongarch += steal_time

TEST_GEN_PROGS_powerpc = $(TEST_GEN_PROGS_COMMON)
TEST_GEN_PROGS_powerpc += access_tracking_perf_test
+TEST_GEN_PROGS_powerpc += hardware_disable_test

SPLIT_TESTS += arch_timer
SPLIT_TESTS += get-reg-list
diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
index 43a36ef3ead8..0104b7e840b5 100644
--- a/tools/testing/selftests/kvm/hardware_disable_test.c
+++ b/tools/testing/selftests/kvm/hardware_disable_test.c
@@ -130,6 +130,9 @@ int main(int argc, char **argv)
int s, r, cpu, i;
pid_t pid;

+ /* PowerPC PAPR L0 cannot guarantee 512 overlapping H_GUEST_CREATE from fork+SIGKILL. */
+ TEST_REQUIRE(!kvm_is_ppc_pseries_lpar());
+
kvm_sched_getaffinity(0, sizeof(cpu_set_t), &allowed_cpu_set);

for (i = 0; i < NR_VCPUS && CPU_COUNT(&allowed_cpu_set); i++) {
--
2.39.5