From patchwork Sat Feb 3 12:26:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13544163 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 4BDD0C4828D for ; Sat, 3 Feb 2024 12:33:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8A4B6B00CC; Sat, 3 Feb 2024 07:33:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D39A86B00CD; Sat, 3 Feb 2024 07:33:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDA006B00CE; Sat, 3 Feb 2024 07:33:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id ACD896B00CC for ; Sat, 3 Feb 2024 07:33:57 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 85C43C0704 for ; Sat, 3 Feb 2024 12:33:57 +0000 (UTC) X-FDA: 81750434514.10.6885983 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id DC4FD20005 for ; Sat, 3 Feb 2024 12:33:55 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GAPqK+2T; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.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=1706963636; a=rsa-sha256; cv=none; b=mjUMOdmEymh3y4vRrAq5Hh4hs9uhvOXfWt126YClg3iN3Bdvc/gqvzaQ04sfAP0lJaKb5r yKnPnCpkIMd9gJ+DDjP7jZ+WmYfg48NEsDl/nEAJnEV05hokg5xnpKPkVbTiWMSqlibfR+ dMCKK8BfdP85J8StMBbS+sxM2Rzd49w= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=GAPqK+2T; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.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=1706963636; 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=AVn/Nphdcm4TpDYK78SoscFba+IPaeCn+tj+rbzyMD4=; b=B7O8uHIhgrXbn1LkFuZvX4DYBga+YFiwSYsQYESY1LzGJODEBsJ15QTDGc4dhIVaK9XkJd 6se84P8BfQKbQ1sqFRJxY9tq/Rqf3ePqlYWKCQ9G4iZX2d91ciNBECpNNNoB+yk+v5K2At A+tHdb0e7rRjnyGWg2y7TtE03NcBj2Q= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1945160A13; Sat, 3 Feb 2024 12:33:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FF01C43390; Sat, 3 Feb 2024 12:33:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706963634; bh=9F4zVwazY45NVTLTUMt3+YYK1FhVQKr2kpggbiXDZYk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GAPqK+2Tg7IeoYeLzW/lxHYBxXVbkmr9N6VoDkMRmiAyfvdGrjwwX7jOjEUxTA5Q2 /l5z5xzv/EHEDHto4oWGMOcWTtw3z29dh4UP5PMsaQMj2OYKJPMgPsjBtqCLSveCdF IyDHhhvJx+X/psoJdAqnITvdezXyLq91C9qu7pA0aWx1gDFQz4Y+uLqv1+REhdequZ Cl7E/HkNb2okHRTogLu3T3T/3nSExZ/mvLhCOIK1hwvy1DU+qiMyzXgMBIZ3WexOEs hhdMeF6Wgm9W+kWy/RyVU6T36BjgxKklBygRnE33D2JBytL5CISb2tpW7K6I246Xrm vNvTFl7bEOg9Q== From: Mark Brown Date: Sat, 03 Feb 2024 12:26:03 +0000 Subject: [PATCH v8 37/38] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20240203-arm64-gcs-v8-37-c9fec77673ef@kernel.org> References: <20240203-arm64-gcs-v8-0-c9fec77673ef@kernel.org> In-Reply-To: <20240203-arm64-gcs-v8-0-c9fec77673ef@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 , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Deepak Gupta , Ard Biesheuvel , Szabolcs Nagy Cc: "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , 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.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=3085; i=broonie@kernel.org; h=from:subject:message-id; bh=9F4zVwazY45NVTLTUMt3+YYK1FhVQKr2kpggbiXDZYk=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlvjDuRauFkaaPh56HIZRKGO8gNrdgx5cd8fytqaJ9 gxcZ8/yJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZb4w7gAKCRAk1otyXVSH0HvfB/ 45BDOyjlHdP8oMFeAoBIWMZZkmUzrM9aCS8QzG4hHJ4fJUKglzj019pZFVnlgeEtVvYPLOw2Mms9Xz QFl96gFHiupPO6gSLIp3YUOe0mDoh0oUhPp7eKc82vvXhQVBvhfgnSKmvd5A9immDtRgiJ4GD35W9x YMHaW1UpHJ/0SuU+JwZ+Uzmr2w6Ele0LENiS6hHXWG13qVDAXYqVeV2qdUVUXE6Aai+vRqxkoyXwwN YNXtOVmIA5hMiLQIR+BhqJjb+9YDPJaXCpuZUgRgUNOTJ27HIMUb2crVxqMDd+ug5hYHPXG3kq3KQM /AA99Qn2fflH/ontmNTg69Ma0JCwb3 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DC4FD20005 X-Stat-Signature: wk8hw1zxmn83hicx5r8ao3nq6haaso1s X-HE-Tag: 1706963635-706091 X-HE-Meta: U2FsdGVkX1+cEhtK8rkOJMOVI/HnuR6njTimaVLmCgKuiOvyT9t0tnMwMjeOZO0FAcF7iNUvwVilfKgEnOpYfPBmjzw3oOAxcakFzCDzMR+Xv1pFYEOzYZsajcp38Bjfr9UjxS4arJt0773cR8Unfkl5AVrtbERw22Is6qKUeoJBJVTqcYckEGWqA3eDCkiAIX9EfyrrBC10P9LibHYwKFiVbiyzj+2+9RO/yaL5qlpfpGxGrOhNyumzihkNGvs6NqMB+v2Y6xEdI+Jfr10PECQNFEJ6UafucywVIOOolcW3vJb0utM/aSsZ6WRY5goLC6pRnONfRd0JObvlwPvjOUpKHRvFGb+vQDUllzs+8eshZtxV4iF+dK5pCLj9cNp1PS4+1v8xT2UM6GHUgQghIx+VNofnpQX3Nzvw/ze2NhfFG0Qde/4QO0xojN8ndX8F3x9Lxs6npU+AM2t1jpeg1mRL7IfYshGcvAma3iMGSzEmllGaM7vnW5HC9keJecIJSFzV342a4C0PB97fSTV8O0ZaFveFHFX1VGBZBSxWHodxzxx7o9g/tLKBptO/ZyBIvxEdJt4duIdHjB+qzKL1Hk1HoHL8K8XUF6i5TdZAwM7LV7j24KUZQTCHsYg8n5RsHy+wsUg/4g+7Ydk84rlVwMjTJ9xTzPvKTXIm3IsvRWHc9fiaNZ0MH1DRS96JUuTc2ES8P7VhrwgGmqUia4opb0P4gZhI0eBxo+wxv+xXjx/F2V8MYGrm567n1ap60/T43qTgUykDMXUZzPEx3F6t1zsn/FqIMsDePEUOddO/tKBST+N+Jy3NcZskkWlslibXbRR71AJ8lD9pqbmCEkhox0uePifuC2wUEB5YRGWrT7l8idd7AS7qFifvnaXEI4Msi3FvRH+s3fNpgb0rboiqVmJ75CEMRbQWeiZ0yLx47rZaSBnmVcXEQqS3gI1g/f6susj7CODYX0DbD9HpIMa eUQ== 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. 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..7012f9f796de 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 72 +# 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