From patchwork Thu Aug 22 01:15:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13776861 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 33FE1C5320E for ; Sun, 25 Aug 2024 18:11:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC7888D0021; Sun, 25 Aug 2024 14:11:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A1D178D0020; Sun, 25 Aug 2024 14:11:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F95F8D0021; Sun, 25 Aug 2024 14:11:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 60A758D000C for ; Sun, 25 Aug 2024 14:11:50 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 071591C3EED for ; Sun, 25 Aug 2024 18:11:50 +0000 (UTC) X-FDA: 82491561180.13.0E7379D Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf29.hostedemail.com (Postfix) with ESMTP id 506DA120004 for ; Sun, 25 Aug 2024 18:11:48 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R9zzjzMV; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf29.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724609439; a=rsa-sha256; cv=none; b=YDzRGFEIQLvkOBBoILM111ZC99L2v0hSR284Hfe9qcmCRoNlcwrOYiHIVCzV0il1mWTiV8 3Lq+kUs2XafN6wfKERctTfMTQE+0/MKlE5gKPpAX0eEq10ScRRXF0HO3narDjQfUNn51v9 gYM+xwb9EVaLn5jeLSzjN4PM43l2U1k= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=R9zzjzMV; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf29.hostedemail.com: domain of broonie@kernel.org designates 147.75.193.91 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=1724609439; 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=wmVciSbuJ0/7ZpUD+cyHKY6ILDM9r07TVUeyCnY02XuE2IeALa9w+GKLsaAH5Ie3sP6sxn /YKpNoV+slB1441a0ufps5m/RjbNxSTl9WV8lVpNaj0mUrR756zzsOCWAvCWSB/I2vHOjf 74/wDC5ATtoU1PswsM6hvlRf/Ygx2wk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 855D2A420FF; Thu, 22 Aug 2024 01:23:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 599F6C4AF11; Thu, 22 Aug 2024 01:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724289830; bh=YYz6vJzvFivBjzQl/oYVfPbzMadH/24Qr7CyuKANnYA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=R9zzjzMV70LpzGfyvhuJYpabIKzUcvQf9MHXQHntpuj1/nRe8ImXDZhtco4U+GIWD H/L1Qr3+s6la2xkwMiwv798l3hafjyZcYnb5FNpK192mgBXdYzu+Bz8JO+OMCH0tl0 71TA36KOD9qaSkQfQoJhVnSvi5LbUD0bV8A8LPKdlGPGXVs18IJe6gCLyZ7N9g0SOe EFr4BQDg2i2AW1eBJ2U1sOPB0uc5gGjI9YFKmUdRUTppOPzjjYeyns0b5abb8cLyWy YIgowAAhiLYAlPnSvCEV/7XHRUHMT9JceVGBH/s3O9yv9jhRwLAHZX5xJ7XjUNeJGF 5LICH7Hd2wa/g== From: Mark Brown Date: Thu, 22 Aug 2024 02:15:41 +0100 Subject: [PATCH v11 38/39] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20240822-arm64-gcs-v11-38-41b81947ecb5@kernel.org> References: <20240822-arm64-gcs-v11-0-41b81947ecb5@kernel.org> In-Reply-To: <20240822-arm64-gcs-v11-0-41b81947ecb5@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/pANAwAKASTWi3JdVIfQAcsmYgBmxpFB+A0WlwPqvXouPNNAgEUHNQxzIPyeeifSv05V CgED102JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZsaRQQAKCRAk1otyXVSH0IFqB/ 9O2YNN8PESOQ8WpkX3izDmeZcNEc1mXsl6dcYRSuYE00J6cl60UTAoBD2c+1iffUZZvHYOq08x9TYH NkZIB/U7bSX8x3OqTPM6omT3YbnF/GLaFbmWaz+J246wqay/dsccm5RWIqd7KpL36dESEg81pFOePd iMbsQP0jR6Oy9Pr/a8zLX0C8z851QwxecQ2bDMezJ8pTuATnSOHt8TymMguDghQvxihb/rrd9XsoE6 OYyEldzAk187hNE56iYGryyL5b+P6sxtmplrhEfvR7kdK1liKjgs9r35hP5hRyhEJPyfpoJqyfcIYb cpqV42uhrlGB8tPJHDynJyu4CRAyZ2 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 506DA120004 X-Stat-Signature: xeg3qfmi3z8ggma385xfjfzch1puqzij X-Rspam-User: X-HE-Tag: 1724609508-506534 X-HE-Meta: U2FsdGVkX1/wO936G//+IfCKQPoZc9ttmfJYwbju64njcBbiXyHbHzolwS8ueekNxej+GepRYM898S0DPU6f27N5CikgJv3lrYd64U4X+9zM2jGgFhtqk8RAnFERrbAYalprXeN4iJ2qD3dvqPi/nzOWz3iYnDjxvv+aJApOp6EIdV2bLeVb+cFeN0cdPg8pZTycnqOvNmfsT3nqANGNeZfS0quYKLyG1In88wVzZb+E+mpjfxqvh4+nvvTdxC3q6YQwbYJKUXl+37z/xm0Qd6iab8DPpDoFoeZe+T5ng4qets6zg+40K/RvbHItDtKyy4WuQwhNPTkqKxviJeXAkarqKX87WFKa2vXmIxEFkP4Z3mje5XJkRTTqzJZGDQ22hQTtXvB5owxRHDuOoNRqou6tYXKyNKjatLnvoh90IjMolke6t+4zXcwBcvpjUx2mgKA1ZmyvCJEG1Y881hcshogzRWU6OFZ8MPVPxIG4RnottpULSgDIiV3wwEbh/WbGQXXHMYbIg+YHxPqAec62kBNRpVDs9xaX3IJjr2xS7kpVfFHsfOGO/vQ1Pmot9qThGPEcnWT37n4MY206AWljfPhbJ29iZ7qiLNu4BD97mi0y5W2hyBd1lPx3kw+UCLQExKxaBsUvJUAd4mvt0NgX0/9AZCKoOx5KVMEaSOfFT8jcg8JrfVecpxiX3N9P4WCXmN0d16CK1S56CTH0MYlk+AUdg+Y2OQgbhoAMFWgF8WVzQPXLsJ+aXxcGir5u0MoUQnIDwChVd+zm+76kIn8YtT6XhYeILYro85qqelNRvk9QBYHfbmhD9zpJPaeOgc41M3SfYFNTKkPssyA1wc5wFBarbk9wML8xsQLPsUkx9UrIc+B3K5tHXeZzNbJPzE7L8E88KCvaZcSmN7E9xW1Kj+9O1W1InRFm2Sn4SWRZSiPgBYRz3oFYVl7v5ovpZPFxfIMajCFIUPx3mWZybBw I4ESLQrb lu9wyW/W+FaiSSfpirz4KwlwZQNoun5Nv4LFpIwyExCreNv7Y3og5kbAu0owektkTsUR4UOcCj90xAE/be1IUFk2qlnvuPK7opweC8lOfxXsZ05s5++Nl8ZIEpEMCedW7athxdHkqtoShcTeyd1KY1EBuvIqmNRmxBE/GCpioAn4qlg9XDJV818GLSWZLyC/OT+hMxfL5JJcvTKyqE/p5RyxLjIrTQly9yJjx9xuU/eJyK8CxSASDnY2Fhnw4wrGOileCowkz7zymyDR4O/ucq3b/oZAx1iPu8rnLs87+9+pe1T6ybIM793KDjw6UgfDDOFpmh2zNQjgYQ8wGKVpVeu+WpSO4AZ4yuAOjtY/o7pnLJxkmualL4hFS2XyOnwIjJmXc7pf+/cgGEhDzsUxpVKqFTpkyP4fQg+oUH2+8NQHj+j8= 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 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