From nobody Mon Oct 6 15:24:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83BCE2222BA; Fri, 18 Jul 2025 22:16:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877019; cv=none; b=I5dM6tmkhQeFPYzb+oGT2BQdkMAHJzMnMst530T0sF1rTlYE8ZYgqs2DP4iMUQaw5n16bHzM4eIR3jLH42UXGBKgGqzYalOj+P+3CjtTp69duoVXQmbyDyzqqhYoTc0xWkVonrUz7Er56/EYlGRxB+Xa22PTb3ss7YIWOj5/5uM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877019; c=relaxed/simple; bh=sH6Ii1yok4Xx0txtePIyhU6/M/Q4z40Fm8HNPEuf03w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JSJULfE2lmH6QeUB3dwZ81sl5KcTWDuO4DbaSqSEDzC3/8vDSDUcsJCVIPEkCXMLn5sw1jnLdFA2TeHXCDrJgODnGVR60358WWVFAtBm0z9vSpFDGkbGzChbmSz1G5/Ra2RM+t1IgsLClR//2CVbykoM96p2D0SmfcwiOW9f1Ko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A3aY5+68; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="A3aY5+68" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3548C4CEF4; Fri, 18 Jul 2025 22:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752877019; bh=sH6Ii1yok4Xx0txtePIyhU6/M/Q4z40Fm8HNPEuf03w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=A3aY5+68E2faKqP/mfbNzVQ8oD7wGRuAB94ovQRusAFVFZTMPZnLHrSJJScEyHmPV laHU///OLU9vJMoHUc1byS+FskzRH2CBjx/aPYX6xF7I+9ps1XxCtZzpbJX8yfGFTv FBxg9kdJWOM3nHTJeoSB33o5GJzswj5gO9W5fi1gKKtXXBAI/yJQYL9NC+P12xDhrQ ONOaSs39ETFmaWIxDdxeyAOihO0LeebPlvvJmih+Uhz6wghXVXKNKrzNcKIne7O1yC EqnJ6vWNv1F2Rj6/WTK5lvbgv2E83qkLOzN+veonXr1X2P2cRJd0DObLOOThDq75GS 3ZAbFhV3K86hA== From: Mark Brown Date: Fri, 18 Jul 2025 23:14:50 +0100 Subject: [PATCH 1/3] kselftest/arm64: Test SME on SME only systems in fp-ptrace Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250718-arm64-fp-ptrace-sme-only-v1-1-3b96dd19a503@kernel.org> References: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> In-Reply-To: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-cff91 X-Developer-Signature: v=1; a=openpgp-sha256; l=967; i=broonie@kernel.org; h=from:subject:message-id; bh=sH6Ii1yok4Xx0txtePIyhU6/M/Q4z40Fm8HNPEuf03w=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBoesfV47we0+i69DcpVnKwyR0AbIPC7B+e1wPit /M1crAyL5yJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCaHrH1QAKCRAk1otyXVSH 0GqrB/4srXY64OmGEkdaiWelmOGt+Frzf74cTcB+ycaQkWJ8yl0qXjNes29yADLKtIPaLMj9DMr RlMpD9uDVphtmHPLDFovqRucLcS2s5M1X+5e89FFrlyIeQaOZqvTKJLgMn9w9GeoJOM+C7kpOZo qdI1KG/T08L9rz9UWELYpR3m8grTFXwMdZRq8clSsb4Oj6NwDlOmU5LL1AZo7+guXXBjJWbSoKA fbtbXjKR2Wn7ldaolHTOzuO/QPvhq6ne2Bim4AWVo+TNUk1VNRdNzHrxzUgDlVlUdL2wGjPvC5q ojOu2+f/JqCo0w4ZbFRVKSFgO6nuHvs+1FYFiRqWRa6HL+8v X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB When checking that the vector extensions are supported fp-ptrace currently only checks for SVE being supported which means that we get into a confused half configured state for SME only systems. Check for SME as well. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/s= elftests/arm64/fp/fp-ptrace.c index 191c47ca0ed8..d953e9b0ebe5 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1607,7 +1607,7 @@ int main(void) * Run the test set if there is no SVE or SME, with those we * have to pick a VL for each run. */ - if (!sve_supported()) { + if (!sve_supported() && !sme_supported()) { test_config.sve_vl_in =3D 0; test_config.sve_vl_expected =3D 0; test_config.sme_vl_in =3D 0; --=20 2.39.5 From nobody Mon Oct 6 15:24:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CA6D222594; Fri, 18 Jul 2025 22:17:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877021; cv=none; b=MnVE8ETzb9UJE8IR8m5EmtLarLUKKy5tlj9p81vvMRlhZKvxuLY+5Sd51RErfgiyaKoO2pwGiD+5TotY5KobgV39M3vK+CLjy4FMxNEUj9foJoELg26h3KwTPbXkPZCCTCbyz0e/rmnFICL82eRgWSZHIjyVEg4XOBRVKoQyM6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877021; c=relaxed/simple; bh=v75KB1eAr6vVFWWCQHSWO2tjEmEj20MzgOKOHSHPFeY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qam+ciURupEgKB1SX6a/oel8fooVuHdFDbqOunPT4kIyvE71YcvT4ksvGMy6o1WIs6vWOvlZY3FKRuatUD2UMxtKK7MFSoWgOgn0VJLWmCcHJwf+Vzn2qyVGBtoj0TNjRZmRPAWnX7KFmiMKogTjr/4qot1ZieeuSIgMOlYNj3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y04bJ+ZR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y04bJ+ZR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8432AC4CEEB; Fri, 18 Jul 2025 22:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752877021; bh=v75KB1eAr6vVFWWCQHSWO2tjEmEj20MzgOKOHSHPFeY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y04bJ+ZRqPbHQiYnPbvwqrPEKLjeZVSl+7qpsOBsYDbWG41tSrUrGgaqOOfML1BWd yOkqfLzcuGXsN/E3MFfE+LfcQrXIwaJRLIq+YI2/7VG4lZs4XI5W3SwCc5PTokS/sk e1Rs+MXVpjqHCpZcp8TAxNct7rCFWr7Zt2L4nHwXijZL3p/LH5EZLRsLzuob/4v/4a WSKc7SyPqIjwwXsIWYfbq6yEH9oqELSd5MELXbV9DXhOCSzcGNKiVolMLzW6RFJEk6 rZKMHO4HL35JnXvdIPV2FWvfMbAr39Jn6uLT1Czy2EMZhCwZPofoJxPz6oSCgrIw6j sklLkgiwW+0Lw== From: Mark Brown Date: Fri, 18 Jul 2025 23:14:51 +0100 Subject: [PATCH 2/3] kselftest/arm64: Fix SVE write data generation for SME only systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250718-arm64-fp-ptrace-sme-only-v1-2-3b96dd19a503@kernel.org> References: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> In-Reply-To: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-cff91 X-Developer-Signature: v=1; a=openpgp-sha256; l=1443; i=broonie@kernel.org; h=from:subject:message-id; bh=v75KB1eAr6vVFWWCQHSWO2tjEmEj20MzgOKOHSHPFeY=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBoesfW2kpUi/Y9eauMoMki+FnL9SKRAujO6Ay8H iByIVbdfpaJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCaHrH1gAKCRAk1otyXVSH 0Fi1CACFkFDPkjcxZ+wxAUV5LuKeBhx1IS5cpkKfdAPRJmLOiYN98DQbVK6ETi0R/6PSbvrQspe ru3j5f2hXnU4zZEIwo7QNd/oz8t3tOY6KQL1VmD/uWRFNOZ/4iWHz9QX57shTngup/CNfVPWlJK 4hJ3Qv1TH2WU3tncQwkf/d1Tmof0oNHhL4VQJGp8m4RyRM1EHQ5rvyrxpnT8P7q5JLACyYD3nqf R+nIvBjUwN2wCwu3v6uWrfI7WLgWw8hB19vD1yin22VOL7u0J2G5voVs/cv/YP9/YxkmOAVUV4w p/iOrFs0AlpwxbXUgRT2Hf+00PybeDDBOMcEDcn/3tqZ04Jz X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB fp-ptrace does not handle SME only systems correctly when generating data, on SME only systems scenarios where we are not in streaming mode will not have an expected vector length. This leads to attempts to do memcpy()s of zero byte arrays which can crash, fix this by skipping generation of SVE data for cases where we do not expect to have an active vector length. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-ptrace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/s= elftests/arm64/fp/fp-ptrace.c index d953e9b0ebe5..9fc9dc4adaf9 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1134,6 +1134,9 @@ static void sve_write_expected(struct test_config *co= nfig) int vl =3D vl_expected(config); int sme_vq =3D __sve_vq_from_vl(config->sme_vl_expected); =20 + if (!vl) + return; + fill_random(z_expected, __SVE_ZREGS_SIZE(__sve_vq_from_vl(vl))); fill_random(p_expected, __SVE_PREGS_SIZE(__sve_vq_from_vl(vl))); =20 @@ -1161,6 +1164,9 @@ static void sve_write(pid_t child, struct test_config= *config) vl =3D vl_expected(config); vq =3D __sve_vq_from_vl(vl); =20 + if (!vl) + return; + iov.iov_len =3D SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, SVE_PT_REGS_SVE); iov.iov_base =3D malloc(iov.iov_len); if (!iov.iov_base) { --=20 2.39.5 From nobody Mon Oct 6 15:24:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CEFF224240; Fri, 18 Jul 2025 22:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877023; cv=none; b=EI1F3tSCvDJE0Xfh3qDHFrjIGRtzkWHDETXh77yMo56duWuJEbdn4HBZLYjyIIaAsgCdTrsW+U6pJnrsu4Ay8xnEGhbwq7w+kfrlbCAUu4JKnCEaIzAWQtUacOzhoyc7NyaN4KP8SlIwp7ZaTDOBUx763CLDSZmXqL8tF+E6Rjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752877023; c=relaxed/simple; bh=HuRh6CJ6lDfRc3S6heFYqYDheIESwPc+QBbxZ2wepx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HwK4EFpPdltm8mN77HE6kJFp7YkjBPcuBxMqf9Br041pNfcYFlYyOl6D8vm6kmF6qWjprj7hPYBceN9wdOA+91j2NxuUrGIUD/v+M6Hx4KXLeNhUOls4ibmkz+SKSyUZjZoD9tJYUl2f0T4aWDWbs/Q8yyvzmZnmcN86k47GLUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZcxoM0Y0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZcxoM0Y0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E66AC4CEEB; Fri, 18 Jul 2025 22:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752877022; bh=HuRh6CJ6lDfRc3S6heFYqYDheIESwPc+QBbxZ2wepx4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZcxoM0Y0et8m1+EU8iPbE8fKxBzlvvfyPTWJh1ZAxEE3t7WLycG4PdwSR0q76tuJc eu1Zv0/eheXbJjVeJuCSogpuET7uQmMCboA3NamtvpkEZSxZ4A6em3nHgO/3dnSGwH tN0W+73XV1rFgSbu1TtUNKPUx8D2D5MmTNit5FSnyOsFt2864MDYMBwV4U1NNFbe/7 P61D3MlbAR4OUtYzu/7eFK62sAMRoZGpBZJAhfVgeqv1n8XtBBnIZ16UECqHPd4I/T YZbFZkaO/Wqf7/ndKmDtPZ6myQSvRW90KIg4MtA9ElxOku/D2dpbm25gMfq7kvOY2C bgz8cr6K+eSMg== From: Mark Brown Date: Fri, 18 Jul 2025 23:14:52 +0100 Subject: [PATCH 3/3] kselftest/arm64: Handle attempts to disable SM on SME only systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250718-arm64-fp-ptrace-sme-only-v1-3-3b96dd19a503@kernel.org> References: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> In-Reply-To: <20250718-arm64-fp-ptrace-sme-only-v1-0-3b96dd19a503@kernel.org> To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-cff91 X-Developer-Signature: v=1; a=openpgp-sha256; l=983; i=broonie@kernel.org; h=from:subject:message-id; bh=HuRh6CJ6lDfRc3S6heFYqYDheIESwPc+QBbxZ2wepx4=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBoesfWyUKPCFwnQxa4ZgHgZdqDZoWgz28vbr8CG rXqgobX48mJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCaHrH1gAKCRAk1otyXVSH 0KlCB/49ZRHBcD6xN5wJLrtlMU0/nLoPH4Z/YYUFtehP2DnFvawijgbLt0DL98NZQMCUxGvWD6Q EbmXvySXCFBDbc2139SyXCOmogc8b81iG+Tiwi0EDMYiAR7a5NPOtex3aKSI7/fdUFQB/oyptkP 6W1GMpI+teOKVILzctCgVpMUwhKgPvUNvxMrjscXIzf/4z9UaumgWYIX1MVYrGhfnmwj32OH6WR pj3N2ky2ZnHV8a+Fczb7t2l9E1x9YRRy/xnoAjaLFR+6kv8G/mhXHS5P9LqQ9lZPqSLyBnpE/kc VOPMGi6Dy5g7/lnhHk1HweGAZDzdcdO7j8uXGh+SVVKsdeZl X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB The ABI for disabling streaming mode via ptrace is to do a write via the SVE register set. Following the recent round of fixes to the ptrace code we don't support this operation on systems without SVE, which is detected as failures by fp-ptrace. Update the program so that it knows that this operation is not currently supported. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/fp-ptrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/arm64/fp/fp-ptrace.c b/tools/testing/s= elftests/arm64/fp/fp-ptrace.c index 9fc9dc4adaf9..21bc4eac092e 100644 --- a/tools/testing/selftests/arm64/fp/fp-ptrace.c +++ b/tools/testing/selftests/arm64/fp/fp-ptrace.c @@ -1061,6 +1061,9 @@ static bool sve_write_supported(struct test_config *c= onfig) if (config->sme_vl_in !=3D config->sme_vl_expected) { return false; } + + if (!sve_supported()) + return false; } =20 return true; --=20 2.39.5