From patchwork Wed Aug 28 23:27:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13782200 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 89A69C71150 for ; Wed, 28 Aug 2024 23:33:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 174358D0007; Wed, 28 Aug 2024 19:33:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D4B28D0001; Wed, 28 Aug 2024 19:33:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF4D28D0007; Wed, 28 Aug 2024 19:33:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B5AA38D0001 for ; Wed, 28 Aug 2024 19:33:18 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 74D3D80215 for ; Wed, 28 Aug 2024 23:33:18 +0000 (UTC) X-FDA: 82503257676.01.9644630 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf16.hostedemail.com (Postfix) with ESMTP id E459E180009 for ; Wed, 28 Aug 2024 23:33:15 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Ae63hpQc; spf=pass (imf16.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724887976; 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=x4bRDIg3FZYF4TjRB4Ac3+0Hb2IaTqNwKYJSKp4sACo=; b=JwUHvuoGWka7XjqCQz7EyFx+9lVyHBuciXUnwrhETWfyi7UmY5qWLALi1Jh3veY8oT+tZs 8LCoaVSkm5vHYv7vqUzXmrCpYZbfL8yAID0j7pE0R8zUjbce6s60vQyICmCkqe8iNlMSkz 2c0qR85VosrqtubCocDUFbn+ah6D/eM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Ae63hpQc; spf=pass (imf16.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724887976; a=rsa-sha256; cv=none; b=YpCXr03i83lUyScLQYkaLoWHwWlPsfbXE/nOgI9FArIoSmv+U6Qm6L3O+h/w9cybFSu5bl vRYW/eS0b5MELvWLM593cvwxY17crSwQp8yr6Ou3BvG8rEE2e5ajtinmORBLrwbATISWgG 41BKkPTY0yOrcGu3AyyhzIj7nLCr40k= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 366DDCE198A; Wed, 28 Aug 2024 23:33:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02EF9C4CEC8; Wed, 28 Aug 2024 23:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724887992; bh=YYz6vJzvFivBjzQl/oYVfPbzMadH/24Qr7CyuKANnYA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ae63hpQcyPKZ+OyB2jCjf7Q3AnoM5TNRSI8R8RYzDv9BC7hP+nt1Q2SM1NKpAHqOI c5KrwNMgLPQv1anl0o/KtpOeyQsef3CuzOu7zdTdhUp7lugl2BT7E7dCzli6x7cujp JtM4I961TOcW0h32E5nGs3SR40TblIRzXj6Om3fwnG90aP0aSD1U/6bvJEDFMw3fr0 qdZjuRpcEAadGa1QiPHS7SaEYEeoOu8eyc+1FAw6z9w2KQkro5OUbQGb2NS1PJRpYa DE+9MhaHU8EeU42cz4Kv34RjFsAPkUZsAkrXA7zyJ3oRtQYCT+H+mJRllbFrcd0w3T O+YnuJQAVDQBg== From: Mark Brown Date: Thu, 29 Aug 2024 00:27:54 +0100 Subject: [PATCH v12 38/39] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20240829-arm64-gcs-v12-38-42fec947436a@kernel.org> References: <20240829-arm64-gcs-v12-0-42fec947436a@kernel.org> In-Reply-To: <20240829-arm64-gcs-v12-0-42fec947436a@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 , 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-37811 X-Developer-Signature: v=1; a=openpgp-sha256; l=3151; i=broonie@kernel.org; h=from:subject:message-id; bh=YYz6vJzvFivBjzQl/oYVfPbzMadH/24Qr7CyuKANnYA=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBmz7KWyGmLb/5LuHUW2EcxIQm9C/uO5snWMi3VUsMB 6zop08iJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZs+ylgAKCRAk1otyXVSH0A8fB/ 90Be8aaxkQLS9HasukOKepFvom/7UIx7M/ptMK2Zg+RPc2bfuLZarXTa2aeVuabD46J6eJ3drBNTZe UzB9H/Y9Hy3YYvuXNFbxru531W0pnyk7IrRxZcIR9nQFYMukgwApRPRHUzGkt2niM9+7zKoZD3lrwW FqmHWndmLgnmzOxQh8OJLfLLjZ6ZplaVJLfh+sVB5F5KJ62HidxsYJvu58cK+n+zWkSc/LKMHBMvtS dUMHZhi3Mdju6Y87YA8T/3rxBWrIuRrC5T5QkfYlfclL2RgPU78UVX6ZyVULtKBp8IcW3dGsi6wrYp qv/N0YcGoAy2dscZaaeXyy+t1pA3wz X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspam-User: X-Stat-Signature: gj3a75u4awd7npwfqw33djf9n4itbn3a X-Rspamd-Queue-Id: E459E180009 X-Rspamd-Server: rspam11 X-HE-Tag: 1724887995-180388 X-HE-Meta: U2FsdGVkX1+b60qC5VAEM+IyYF0GvQma7wYQBd+OV0vrwknuKmT61gTzpazXWfhfjuyDs5T5Rn4c4EciqlQn1owFUV2cUkaAIBX5swRzAwzLgR8Sz8Dcal+EokxHKb60EvIfeBa9FaYfkIhp6lYYEarcMQq/IAd698puJQDWDVF/sFrZipaqgHVlynSfEuphYGgJ3quaEskspk/U/BQObbIfVemGTGYt6AjgaxkseTe/9TMWA9duSaNccm/2CaUDXgG2j/N2q7VgVTqhrpAw/Wby+h+3eMF7NRHG9zsYgcamtLWEOHYtvFiMSfNj7sZVwEraH54a19bD09cMmLynYyo1BnymS8TwFzTox8gSLMhiicBJ/QlJ7NrQPG1BS6JapBoHPArcC1F+khcFv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ence: 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 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