From 23140d6e54ac31e2f4ef3bcd7fb586a14360be34 Mon Sep 17 00:00:00 2001 From: "Ritesh Harjani (IBM)" Date: Tue, 6 Oct 2026 15:58:42 +0530 Subject: KVM: selftests: Enable hardware disable test PPC (without pSeries LPAR) Enable the hardware disable test for PPC, but skip the test when running on pSeries LPAR. 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. Skip the test for now, as making it play nice with pSeries LPAR is non-trivial, while the test provides meaningful coverage for other flavors of PPC. Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Gautam Menghani Tested-by: Gautam Menghani Acked-by: Madhavan Srinivasan Link: https://patch.msgid.link/23f36aab5e9c849719ffeb796e1a74e69eb5d142.1791280439.git.ritesh.list@gmail.com [sean: massage changelog] Signed-off-by: Sean Christopherson --- 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++) { -- cgit v1.2.3