From 9de211597e81954d4c981e04bdfa81fa7d3297b5 Mon Sep 17 00:00:00 2001 From: "Ritesh Harjani (IBM)" Date: Tue, 6 Oct 2026 15:58:40 +0530 Subject: [PATCH] KVM: selftests: Skip kvm_create_max_vcpus on powerpc pseries LPAR On a PAPR LPAR, KVM_CREATE_VCPU is H_GUEST_CREATE_VCPU and KVM_CAP_MAX_VCPUS is only the vcpuId range but is not a guarantee from L0 i.e. because L0 Guest Management Space can be exhausted before that many vCPUs exist, so creating MAX_VCPUS is not a valid assert. So, skip the test when powerpc is pseries LPAR (running nested i.e. ibm,hypertas-functions is present). Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Gautam Menghani Tested-by: Gautam Menghani Acked-by: Madhavan Srinivasan Link: https://patch.msgid.link/c8856b73b06bd4b44ff31e7454c8fc56dd402428.1791280439.git.ritesh.list@gmail.com Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c index 1b95027d41ba..22279c638d06 100644 --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c @@ -39,6 +39,12 @@ int main(int argc, char *argv[]) int kvm_max_vcpu_id = kvm_check_cap(KVM_CAP_MAX_VCPU_ID); int kvm_max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS); + /* + * PowerPC's PAPR L0 does not guarantee KVM_CAP_MAX_VCPUS when running + * on pseries LPAR (nested kvm-on-powervm). + */ + TEST_REQUIRE(!kvm_is_ppc_pseries_lpar()); + pr_info("KVM_CAP_MAX_VCPU_ID: %d\n", kvm_max_vcpu_id); pr_info("KVM_CAP_MAX_VCPUS: %d\n", kvm_max_vcpus);