From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 121C13E557E for ; Tue, 6 Oct 2026 10:29:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791282601; cv=none; b=ZQaCUdtBnTuzRjCK7acOF3/6C6SdCCGfTy538lcmYOAYeeP+rRv8y2HBJdt0xW6gd+TqnlGdQkU+XT8Bt/roD/WSLc8PPJhu245GLr6BqHat7MPJxsgBq0Ev3bpUrkm1/uEMNaZDMFXj9R2iS8sPt+5xH4ql0FBb7yenR1VZUUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791282601; c=relaxed/simple; bh=/ezbbM0TGZs2GhJUb0V6eMysvRv1UKp2GDpJMsjkpuU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Abzcd4gsZVUd9qxWDepV1vwLZ/SS50sATpnPyrMIcNAWFlFtiYYCG+3i59Pevyu+PlP99WTZe3F0NPe2fLqqadqJmVdGmz/+/Ezd2Y1W5ZR9+84H1lC8th5Y5d9Gl+qwf9rvQ4Jhdw5rCbcvy0sy+tLXj4/0U5z294cfI/5+7VA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GOrAJtOI; arc=none smtp.client-ip=74.125.82.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GOrAJtOI" Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-351297d9f8fso1243039eec.1 for ; Tue, 06 Oct 2026 03:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791282599; x=1791887399; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ZcbRoP+uea/9OIqckWxSVeGmNCVXFZup7WqyFdJFlC8=; b=GOrAJtOI2KAlhiZzvl8OpV/V5k3czkkmHGheWn88TZ5wiR/2ywj657ExeAqin4WPrl gu2iYv63hqKFXCp8TbETMIBpD7aPMt56KiKuR2NB5wDJ76rNeuFGuUKrEst5wBMcMn6A InWZ2MDoDGOBKVj3VSl9K7lPk+C0A+8d/30+IkCA9bzu3pxAQAvAqwWwMH3WOFoa3aec INmoyz+RW+Kqb+ElECZnV4jRwH2lVcfXciBTfGI6c68Qila8fdKJwIiCF7NxaZ9oLZco ryeCgEZgYUcx50bWMH4aNqP5Ax8NeBFYB1fz+jt2x7Id5X4oKl2XWKl3pe559E1ZKxGO hJjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791282599; x=1791887399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=ZcbRoP+uea/9OIqckWxSVeGmNCVXFZup7WqyFdJFlC8=; b=h4YWyWFLhs5SLya9ICknnfRnQFlVj2YfyYACyvx4hoR7VSi0Ay9k5QsNxxO/FM/uyu tWYpF5CaoJ3D98RvgScsliRw+tj4LH6aNTqUBUO1V76dv9/Qk6wWi1BiS+3+8l9awxpD 8pwAOphzmfvapye3Ho39Tff6fX2TWxVIwgcUaemDHzNISAqpazjZnGOrh9PKxznI0dEO VxSSXgqPX6vAWUEhJs6EEAG2fH+HLmHZHR5QQ0DhYeIhgq2h01qKlTD8opGXIv7+tHxk WP37v/I8XQnQIANX4cmK6JCOzSE1WGxPxiP5eBBtrKG1XxUXxU2CJ3lU4cr4LEXgzdNZ br3w== X-Forwarded-Encrypted: i=1; AKwUvBzaBu7wnKw7WkFKaKwrL4Lay5jMxtUc6sXGYloPfQoJJSMx12szgpr0Jad1Scn5PcTEVsV6zqb7hfFrB8g=@vger.kernel.org X-Gm-Message-State: AFuF++mTuXzrHYEDchX7hfZBvyz+9LFiii+NEWsMCtTWNMTgqQXU5VDr 9otAWZGLp/+3LcFvjEz+jcGGMmg/GDM4K9tLT7k1rFeEDuSLHvPpZR1S X-Gm-Gg: AYBFou1rdG3lTZNHhm17/FtviD/FKu0Gg7rMbM8o50I19A8LvYlL0vOs8UMHqQRzChf EAycjbWVW85wNNr6N20+RJnKdM0jz1oA41OYihPp5Z0bc/JRCitRVt17QB+MaD1DHF3CxYHjRGr dCLbJ71f8OS0VGvwIGim4Md0/BrxBV9nGq/kMTvkSixBcgyhFMNtTyzs7ijUjWn9ItNNj8e7UdH Wco0kJT2cjDPQUP8WecWVT+3fClOzJpgWUseNe42LlV6pBqsTYm2VrhEhLNhC6hENOOod64SDGG 4sGfkiQB8p7JvLNluCflFNHAF3D9LmqZIqY5e8RaAZ0TN75Ul2nuux7UG10hnZPKcF7nwMES2p5 QQqKNdRR2V0l4iBNpJbVp4WWxNS9RlDpV0fB5qvWFDKgUZ9gCGqJFUKBG/XEqe7Sf0EzoJriroA 9AzZBPoz7Bzady4G6nR6X9Tf/gCQ8zMD2sIl93U5svbN67QaNn2LjROE/0fIjFSzTnjShycEVqk XDJ4gLySzHjEgpvUPLjy6vjpYuk6Hi6bEcYpwxg3hMXPcbUIjP9IORZsfEg X-Received: by 2002:a05:7301:9a90:b0:351:54a:e320 with SMTP id 5a478bee46e88-3514dc8203cmr903000eec.2.1791282598999; Tue, 06 Oct 2026 03:29:58 -0700 (PDT) Received: from pve-server.rlab ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-351469fa189sm7443970eec.6.2026.10.06.03.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 03:29:57 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: kvm@vger.kernel.org, Sean Christopherson Cc: Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Christophe Leroy , Anushree Mathur , Venkat Rao Bagalkote , Harsh Prateek Bora , Madhavan Srinivasan , Shrikanth Hegde , linux-kernel@vger.kernel.org, "Ritesh Harjani (IBM)" Subject: [PATCH v7 3/8] KVM: selftests: Skip the max vCPU ID test when KVM_CAP_PPC_SMT is set Date: Tue, 6 Oct 2026 15:58:37 +0530 Message-Id: X-Mailer: git-send-email 2.39.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit kvm_create_max_vcpus creates vCPUs from 0..MAX_VCPUS-1, then again with ids at the top of KVM_CAP_MAX_VCPU_ID. On PowerPC the vCPU id is not a flat index: it encodes SMT thread plus core. So on powerpc maximum permitted vCPU ID depends on the VM's SMT mode and the maximum reported by KVM_CAP_MAX_VCPU_ID exceeds a simple non-SMT VM's limit. So, skip that second loop when KVM_CAP_PPC_SMT is non-zero. The cap is 0 on other arches, so they still run it. The 0..MAX_VCPUS pass is unchanged. Suggested-by: Sean Christopherson Tested-by: Anushree Mathur Signed-off-by: Ritesh Harjani (IBM) --- tools/testing/selftests/kvm/kvm_create_max_vcpus.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c index c5310736ed06..1b95027d41ba 100644 --- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c +++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c @@ -58,7 +58,13 @@ int main(int argc, char *argv[]) test_vcpu_creation(0, kvm_max_vcpus); - if (kvm_max_vcpu_id > kvm_max_vcpus) + /* + * Skip the vCPU ID test when running on PowerPC with SMT support, in + * which case system topology is encoded into the vCPU ID and so a VM + * can't use the full advertised vCPU ID range without crafting a valid + * platform specific topology. + */ + if (kvm_max_vcpu_id > kvm_max_vcpus && !kvm_check_cap(KVM_CAP_PPC_SMT)) test_vcpu_creation( kvm_max_vcpu_id - kvm_max_vcpus, kvm_max_vcpus); -- 2.39.5