From patchwork Tue Jun 25 14:58:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13711465 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 04C43C30658 for ; Tue, 25 Jun 2024 15:05:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8690A6B00D8; Tue, 25 Jun 2024 11:05:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 819336B00D7; Tue, 25 Jun 2024 11:05:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BA9E6B00D8; Tue, 25 Jun 2024 11:05:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 46E706B00D5 for ; Tue, 25 Jun 2024 11:05:50 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6B87B1401E3 for ; Tue, 25 Jun 2024 15:05:49 +0000 (UTC) X-FDA: 82269735618.26.8B9DC3B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id D9FFA40030 for ; Tue, 25 Jun 2024 15:05:46 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jVtyl15x; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.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=1719327934; a=rsa-sha256; cv=none; b=lpYlLqxKoASxSOWPTyqHVEJ3lqu9wqSiCNZ9ktUUa/JiJB7NkBI5XRZcqxaucKsFw8naJg AEXcvdMHXlAnDOL1tUO18awB6Ht1jdOxnrFb2bEiojL8SFzi9oNh070Z3AgHkV1XGoU5C/ g2UbqLTA2/Lz1MblhKkUEi2V435t2qA= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jVtyl15x; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf01.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=1719327934; 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=2EG5IiQY7yY7HgQlkcbDVpTXltZSXWvrNwC/9tc6iLaZhN8aygBaOt1wuO1qPfE0uF8FPV dQdfDtoiRHc9WJ8HGHRyxg1DtjxZ+o4KdOp5p9mMk2jFowXbM5UgeFH5Q0Qp6caLNte22+ 0NDJAQw1LdXPs99lm9E0ab4EhTVFAaM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D63CE61453; Tue, 25 Jun 2024 15:05:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82489C4AF0E; Tue, 25 Jun 2024 15:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719327945; bh=YYz6vJzvFivBjzQl/oYVfPbzMadH/24Qr7CyuKANnYA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=jVtyl15xNduiXHKLwIurGiHrq6v7QW9hCqMHsjmjHGlP0n43EqHxggFJBuOuA/T9S ZwwyUkiuwOsMntBpfak37kJinMzrQiuoJEu+eVqdpPl53d9qQaqzSTyXFPUSpfJI8S VAlaLDXxrgRW2SWZSmnpBWfuWWfW5qV7AInmNEmiSe/7w9njmux7n7MhF8Y4K9SFGu jfPg5aq3YLB85H2QbpRCUMv9AtenTAWoE2hZfhOu8HG6Az9/y3XS0hU1LsCINimGX+ JyStWz5ytl/jDITq3/tfE0iCyB9uqOPd4C0JMEB3AKgxRqEQY6tVtdMfaO3zJH+kvI 05DmIU8/cjAag== From: Mark Brown Date: Tue, 25 Jun 2024 15:58:07 +0100 Subject: [PATCH v9 39/39] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20240625-arm64-gcs-v9-39-0f634469b8f0@kernel.org> References: <20240625-arm64-gcs-v9-0-0f634469b8f0@kernel.org> In-Reply-To: <20240625-arm64-gcs-v9-0-0f634469b8f0@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 , 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.14-dev-d4707 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/pANAwAKASTWi3JdVIfQAcsmYgBmetuR2t+0Cqlt/6leQmollofnPNO15qhZxsk4g6Rv IV0COeeJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZnrbkQAKCRAk1otyXVSH0KUEB/ 92KBV+o4546rcXH4xXo2EWT+kE5N6xC2oDsBcr7IoWFKdn5b97y2WNrash+T59Yu1XOYrCFFrOrkgm RbmFAWHOBbuOXOc35IR+XCSSa2/XJZ7FXZF5j9xA8t5Jm1TA+oALCgCQ/r6V9BCHcym9F1WxusrRH2 NmGZWONPJFdHa6wI/9n0Ormxp0MUcPFFWh0bQJwB1Ins6vJOcUUYcrUMGUZ83jjhnjAN+zkQ1GjB93 iQmF3xpdVuac037z9gR/TjRKF03O0O2cYLS2kfLwjfhX3qk2c8+SM4699Wno6d0w34BZDduAiPh+cw MG2TnaMeA4ZtK8eaNL8Ppza/o33J+c X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D9FFA40030 X-Stat-Signature: z9p48brq1k8qqk6b9jjhmyzxidysoiks X-Rspam-User: X-HE-Tag: 1719327946-761986 X-HE-Meta: U2FsdGVkX19lfPJ8hD8D03b+HajyTvAKJ/TWroJ17NStQVxXXijQDPtEfSFjXQms4sloG66GbNKz2HNR/JFfVoNQ8xy8YwGPrGVLbpn/eTXRXJK5kISHa48ZcqUymCeW5bO+b6PC0fEZAowerMEzOMCMqZHDcuGg78dTHevKi7nuLDaFFxkRhkfDPIs+lbHm1iK5mBys2H51tT2hnl3uX3hWM7ZrJOR2t5JXtVhl7JzAuCKWrUx4NAdpjOw8kkCX8Dcso0Hxg9pds2VCJqrnmdyoguTlpUws0OpMRZl8mC6EnpTAtekcKmB+RfEfV2nwuXK5wyH7Isq9lpIA///R+O/0L0HGtu3NX1R8iYy/1bw49PtKBWkgx/Aq2higswXUBXmrcCJBFpJpV1b7Eqs8+gLr67HQ6zwYs9Wy4GC4ri/OwPlidxqjEqm/5YVjDbAJQnmZN2zlHhnrDpIwMdZty5p3RIbgoslmBf7GJNyqWhMmapi7FpkwdG3FHq4OdxOwng3Aq8S5Va+tx+8dlXM5UU7weXQaL/52WFiFYS73GgjREYu1YSofXzmoDaR/hsv9MgCuJcIbjh2k/Qh7agespjC6675k+V1dRz7ebcNDYOMjHUfrePXXjPQA8Fh4Vsi3n+jBHsj+yvSY896L4H0HvwqTTfelML5CKULsLbsMH8ReTfqwK26tLyMbNgq14Cwixud0cCUpRnE/P4I5jOEqNlbHX4hj/hjB/fAuohrhDApa9lDZLJTtfjEcAIqzRe6A928WT0LvSiU3AdmEaNlq6BhDhVZW7AAlMkNE231H7tzU+2wv56w67LYQs9sAInije7qvDoqP8ebwGSPuDFXYBVSACgvy8p2H5L/gN9IsIBQfI8rEaWlgakg28BklZysbqB9o1ukBIUs16mCfsIh/Q2/CJwPnv4VHvRQGn20VzHql8LEo8yCiuJmhA/x4bqetEGHzV11xfWNckTo5Qs5 b3E0BYXa 92ePSWw6ssPnDw03rGcFWN4VtI48DDCPvICYlfWzvwbosFHzXt1epdoCNuSCTtSy1l02iwnrr6Ug6lFVzAVc8ZdkMUYDRpqTSnFEw6MJD5N+hGgJ7ypOv0OptCicMP2MuA4MbECSahMkmkBj229wzLrzFsUq2wj6oArZvnLcFUQ8WPz5Dz594zoJ38bZKG/s+P/Y5j1pXTLG/kXViutPvv91WRxrVic/EuWKOR6mcMQKieaVqZoi2OjhAcItTwODRl4diRbFbs7P0PCHmDbwbBohpZHlfJ+wzKP3318DDWBm5yh2oJaiA0Y/W1oPwZhIEJeKN/vfjsJ/9aIkH4qbqH3DPsHGKwuopB7plnswd9sl85At2SZlCKI5QRtt2vDUYxJAJ 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