From patchwork Tue Oct 1 22:59:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13818977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 527F1CF3189 for ; Tue, 1 Oct 2024 23:07:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9011680040; Tue, 1 Oct 2024 19:07:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D401168002B; Tue, 1 Oct 2024 19:07:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBB01680040; Tue, 1 Oct 2024 19:07:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9A72568002B for ; Tue, 1 Oct 2024 19:07:15 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 507361409B5 for ; Tue, 1 Oct 2024 23:07:15 +0000 (UTC) X-FDA: 82626571230.25.989554B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 813A7A0006 for ; Tue, 1 Oct 2024 23:07:13 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pGG18lc2; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727823930; a=rsa-sha256; cv=none; b=KW2uSa/dKcpanj1EbJ/lJMmBvg67SclcSM/9LhCZQCLsiBiatt3vWtnGrDxBReKjKUZoNM KUIJczTlIq1hM0iYCVyB5p4B72vl4ZMwpqh3bmstBNUfyaixi1etoA7/3LAbx/nlUOJWah JJsHUcdRmgpDNKHeSoHFGOQt5F+q2JY= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pGG18lc2; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727823930; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D8pupPtAUC/PefOJZOlK/94OO4LdMLysuROmTkPxi+M=; b=ohhIVt/0jSFHSu67tB0Cf4wXMbPwW5jWVKadGtk2IxZYCHiTwnfxZlQN41BGkEdD1GSl9a Ax3tuuJVUkodUHHrsGpZjEkVqR05NeZ3XPqc3r7eg8Z3b8TozLgIiISyULnhSpv5uiIfRx syQiJUHlRsbeGBkLU9zWxjrVesvjFvo= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 8D8515C0339; Tue, 1 Oct 2024 23:07:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 079AFC4CED1; Tue, 1 Oct 2024 23:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727824032; bh=ZVQOrXstPU5gR3A8Ckx0lxDGx6pZ/VSu5l6FgDY2wws=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pGG18lc2vPv29gIqkMAgxe+tMLf+4YOSLTVwbD/QjeQ+DvjTcSnhA7jJROEaXnoqZ Sk7q9z9Ik6EYvQw8wHgkFpjni48cdseqWXNSDA3ME5Y4jiMtNIFbXFi/Q4Y6Qx9DwF CjbEr1Q9cpzsDu2LAVgTT9fQjiQWKTngRmKBXEN7BSy7+OVyloW50UqBsYSAQgLQzI dfLXYIT6H9J9EGSKdxsCiJYQYuaK6ZHNrAAHm9yKovSUDtANbzIELnFp7jRx4qdDNO t/OM6qvVSZzaXHRKgKE3J05TO1D0sCqUjuUxevCHFlz6IcybO63cbV6unXyWRUYs81 /uCRBTD6TpHcQ== From: Mark Brown Date: Tue, 01 Oct 2024 23:59:18 +0100 Subject: [PATCH v13 39/40] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20241001-arm64-gcs-v13-39-222b78d87eee@kernel.org> References: <20241001-arm64-gcs-v13-0-222b78d87eee@kernel.org> In-Reply-To: <20241001-arm64-gcs-v13-0-222b78d87eee@kernel.org> To: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy , Kees Cook Cc: "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , Ross Burton , David Spickett , Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Brown X-Mailer: b4 0.15-dev-99b12 X-Developer-Signature: v=1; a=openpgp-sha256; l=3215; i=broonie@kernel.org; h=from:subject:message-id; bh=ZVQOrXstPU5gR3A8Ckx0lxDGx6pZ/VSu5l6FgDY2wws=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBm/H7irfZPEvRvl3o5vpBr8BsBVzwq7I5CnEYGxfwZ gyf+MGWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZvx+4gAKCRAk1otyXVSH0DS3B/ 96I6K/hdbGr5DSrgzJPe0+7XKencBMwk/ceJm2y031cJaJPViPOQuTZAendfczyGkbAaZt9UeDVPAO gCkbqR4XLO9PBxjo5YScfTmU9r99+zSj+zwQC5ucr66eT1x77VygKzJd8j2rR1NQZy3HquSDHylyJC ESOMtP6qcQKwhdA09cJ8P0dj/L95TlsXTza8OyudflyIIVmrrmpDc09CU+GCTAfUusoUv9E42T4DBi TW0WXck2w1AHyKmsaRL0eCusUSj9mjvtBiInM5ZzFL6Li07LZB1ECqhlt4eYMKED4AvXPIrM4w5bqY Sud8jJ/dLx7hEM40eyum2Ok+hHChEA X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 813A7A0006 X-Stat-Signature: 84jcy6q64nz51uj7gbezzqfzo1sfcsky X-Rspam-User: X-HE-Tag: 1727824033-913815 X-HE-Meta: U2FsdGVkX1/BIPoOCuVWgdyY7wZXEh8eboN8zO2gPmFM0I5KoLFqZJbAP6lhYjleM+cGrzsHtIlhVea6E3fcfJOWIOFNw7fqr3HWTGHaM9L5giykyqfWuhkBqejiI5w+kngwm04uRxRpJsr6FeRtQ75e7p2llVBmj6CfcMe9qedEhyocfen0QIHXhjkMHZ0lJo4PutG+MOi1+rcboyw9sdllLou3Vbe4mYhjQrho3SSGmT0oCkMJ8mxtOYmYJW5QrPJRG7yBq3M3qNxwR+eTXsWijHOVB3n7THwBuSjb9qpCYF7/ihJt/99nRITl9sQlra6QHAkKy6iLdJAsmgE7NmAXYXpzatUMPzBAXPb9Pbh+SkS5vU0evBeg+0wn6azdDlXWoV5aYo7ahLPc+vfLEYhIN95iiBl24TcUlKwYf/cpwCJ7kfE+Q83DjQSMoHv0+O1PZnK293gKQLq7aeuIXARBe24u18QyUg0ZWboUjfB11DCuY8Mk7N78iUGGspfuHWguNCZ0ZyDBgBZx47A6uvSTsdHlYxid1xTmJCdx02Qhg3wjBiPB8PdxxLzSvZXxjq4eRcnCCTN4k/hmXTyHyfi8g0SHZrRECJT+EIZyklEsf3jXNVVZZXaGduTPjD6ScIYzC71N+YGEi2A2oppsaBXcZt1IVEC11ZRAbEGhLT/ps2BYHMl4GGA0q2AGkclZyor/TYv74SFGhTxIRQhL5HRKhUbF6Opjv1Bf/7OuTpzOekteiZbhfBmOZJFjBY+4ULBZoUAB8opiVGfdOiLI+mlvgbNIRduCKOXC7qQTaeASaUWGoJkZxqVZrrOwLlmuqfNIOzmkMe0sQp37fJzcAwGDPHu2UFVTXNrR0TTmRa38nKcG09wGoNdoWPxXysUya/55wWwp9rnQhq0HjSQQTQ/9L2iUarnAy7/1P5zyR8xRYBbG7C28TMcs6AA1O8VEMAYlzTX7DTCQOMm7hZf bmAZrRwi rogAR4egPsxA16ttFB4OqCuOV7STLNTMTV/+vCokQu0jWKjW5Edd5qLeQlKB0dq4cdP6uSIV/KFAmTgf6s/tqLtJNfQ67tcHs3dzVFByVyQ4+BIumIfGo7dfgpt++3I4ZUHq0TXOnCHY0TlsoVY7DXFrzjVpNHGgZRXs1o+XvE+N01Iug2V4tO3GIo3aMGypKlJot4dSIb2Qhy0MMbsbOhkVjoqCybi6DREDSfuF4ZxLKQgji4orsCGA6KSF5awLhqBNSRQ8RxNe7g/F1gKJUwMiC64Crh3sVzH68WFH9ObYvp0yLexqPlga7+sWZDHxpqyqJVN4yLXnGkigwMV1ZERX8vw8Kh7GLnwLfwPXXkCraE6lwX+mtRtqOG/KWmeK50T1x X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: While it's a bit off topic for them the floating point stress tests do give us some coverage of context thrashing cases, and also of active signal delivery separate to the relatively complicated framework in the actual signals tests. Have the tests enable GCS on startup, ignoring failures so they continue to work as before on systems without GCS. Reviewed-by: Thiago Jung Bauermann Tested-by: Thiago Jung Bauermann Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/assembler.h | 15 +++++++++++++++ tools/testing/selftests/arm64/fp/fpsimd-test.S | 2 ++ tools/testing/selftests/arm64/fp/sve-test.S | 2 ++ tools/testing/selftests/arm64/fp/za-test.S | 2 ++ tools/testing/selftests/arm64/fp/zt-test.S | 2 ++ 5 files changed, 23 insertions(+) diff --git a/tools/testing/selftests/arm64/fp/assembler.h b/tools/testing/selftests/arm64/fp/assembler.h index 9b38a0da407d..1fc46a5642c2 100644 --- a/tools/testing/selftests/arm64/fp/assembler.h +++ b/tools/testing/selftests/arm64/fp/assembler.h @@ -65,4 +65,19 @@ endfunction bl puts .endm +#define PR_SET_SHADOW_STACK_STATUS 75 +# define PR_SHADOW_STACK_ENABLE (1UL << 0) + +.macro enable_gcs + // Run with GCS + mov x0, PR_SET_SHADOW_STACK_STATUS + mov x1, PR_SHADOW_STACK_ENABLE + mov x2, xzr + mov x3, xzr + mov x4, xzr + mov x5, xzr + mov x8, #__NR_prctl + svc #0 +.endm + #endif /* ! ASSEMBLER_H */ diff --git a/tools/testing/selftests/arm64/fp/fpsimd-test.S b/tools/testing/selftests/arm64/fp/fpsimd-test.S index 8b960d01ed2e..b16fb7f42e3e 100644 --- a/tools/testing/selftests/arm64/fp/fpsimd-test.S +++ b/tools/testing/selftests/arm64/fp/fpsimd-test.S @@ -215,6 +215,8 @@ endfunction // Main program entry point .globl _start function _start + enable_gcs + mov x23, #0 // signal count mov w0, #SIGINT diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S index fff60e2a25ad..2fb4f0b84476 100644 --- a/tools/testing/selftests/arm64/fp/sve-test.S +++ b/tools/testing/selftests/arm64/fp/sve-test.S @@ -378,6 +378,8 @@ endfunction // Main program entry point .globl _start function _start + enable_gcs + mov x23, #0 // Irritation signal count mov w0, #SIGINT diff --git a/tools/testing/selftests/arm64/fp/za-test.S b/tools/testing/selftests/arm64/fp/za-test.S index 095b45531640..b2603aba99de 100644 --- a/tools/testing/selftests/arm64/fp/za-test.S +++ b/tools/testing/selftests/arm64/fp/za-test.S @@ -231,6 +231,8 @@ endfunction // Main program entry point .globl _start function _start + enable_gcs + mov x23, #0 // signal count mov w0, #SIGINT diff --git a/tools/testing/selftests/arm64/fp/zt-test.S b/tools/testing/selftests/arm64/fp/zt-test.S index b5c81e81a379..8d9609a49008 100644 --- a/tools/testing/selftests/arm64/fp/zt-test.S +++ b/tools/testing/selftests/arm64/fp/zt-test.S @@ -200,6 +200,8 @@ endfunction // Main program entry point .globl _start function _start + enable_gcs + mov x23, #0 // signal count mov w0, #SIGINT