From patchwork Mon Oct 9 12:09:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13413647 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 3E3DDE95A96 for ; Mon, 9 Oct 2023 12:15:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D04958D0073; Mon, 9 Oct 2023 08:15:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C8E248D0031; Mon, 9 Oct 2023 08:15:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE1058D0073; Mon, 9 Oct 2023 08:15:04 -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 963268D0031 for ; Mon, 9 Oct 2023 08:15:04 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6FFCC40242 for ; Mon, 9 Oct 2023 12:15:04 +0000 (UTC) X-FDA: 81325817328.12.F1B14F6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf06.hostedemail.com (Postfix) with ESMTP id 50F0718001B for ; Mon, 9 Oct 2023 12:15:02 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=H6L2zm3O; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696853702; a=rsa-sha256; cv=none; b=7WEIab8eZkR/D0rgjN6Z421mhQPpWunXdAyWdCYUsiLvJBi1xUI9jhyprPShvxMrGdJod9 vNlgaIXZ9vTa7+IZiCqS08SCKkT9sKeKXyy7BLximwTqlAXPsByXV1mEtQGepk/ut62SlG XQiXosV1PVU3ss9DvxxwBqnsE3jIytA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=H6L2zm3O; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.hostedemail.com: domain of broonie@kernel.org designates 145.40.68.75 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=1696853702; 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=c422h9hePWFZGXVEyc1SJULBUM8N+meybf6z8umXg3Q=; b=DPLP6GQcudDcgwgmdpWzVH6OJfoLBOSRmcQ7LDk3a/AJsHfSjTbW1KdJBDWjfahcAhXFVy inXmM/XGZdP4DjMFqcX50GYOTzZL/nzYCPAHRjLSyIlrRxbVjF4Yug3dKLv263dYLVFaHK 95ghXxXiDTbTVvxEtEZu+eHU8a2cjeQ= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 02255B81189; Mon, 9 Oct 2023 12:15:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D4BC433B6; Mon, 9 Oct 2023 12:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696853700; bh=o3F0gqwirOzTh8gwGkZMmsXM7Yu/yi+gPnGo/AGnFQM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=H6L2zm3OMsRyXQZfw5aCB2cQkw9G1wWr2dacwbrbjZXZPIvYK/weMVGb/cCzZKiC7 ZWZE+3KXbORqpB/LvrPa2XKaZcYAjAFSMj4QWQFzw3QNTXKDYCgERhCXIRuk6Sjumc zB5fHswdhfFPA4MwUbxsr8ag7wUXWXMvOwCfogAugBxO+lLIGF8fBuDPcfcrWt9bL/ UfwoJNGMVjZIYaA2ZzmhBY6HI7q3jqJtDEajWrgfdPB+xTlJBBPSLdojTFkIx10j12 ZNBSMSXaS2qYh9yW/wlBi/EargZA/4mUtrGrQO91UPNkTiaKE8IffZTX8D3vhoHTR8 OG9JYN3wJLxnw== From: Mark Brown Date: Mon, 09 Oct 2023 13:09:12 +0100 Subject: [PATCH v6 38/38] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20231009-arm64-gcs-v6-38-78e55deaa4dd@kernel.org> References: <20231009-arm64-gcs-v6-0-78e55deaa4dd@kernel.org> In-Reply-To: <20231009-arm64-gcs-v6-0-78e55deaa4dd@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 , 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-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=3085; i=broonie@kernel.org; h=from:subject:message-id; bh=o3F0gqwirOzTh8gwGkZMmsXM7Yu/yi+gPnGo/AGnFQM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlI+2vG7XbuVEpS5pxDaAIrEX013t37tEVAfRK24qD lhEdNXWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZSPtrwAKCRAk1otyXVSH0O9gB/ 9FoGr0eST8WBd+FIsUjhsE3d9wYovTCREYw/+Ayy30NkoVgB2HmjZh7K+hb1YN/LMp4ABI6gQv9m7U CD4WfBwvZ66QhtkrTfCIAGZpIQukSOsbVk6gdZYFnG7YW+e8eW3WDSRw9MC8WvY4S8Se1kCKCSUCeb Qz3siqGYszHBGhCUXtGLknYBqrkRfkRcrLwD25GetvYNDznn9zMYXqk6yRPx0AfSoebviB+WXqPi2L dbp5/fysyysuQlZh6LF/DXv7rc3dApbApo0DQVkQsmIg1LX6vsrhlBVTV2UmFdpn3sqVmIl8CtGlBA iYNaW3vGcLHl9DSvc6WgiC/Kg5uRyg X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 50F0718001B X-Stat-Signature: uc1j3sjib8p5q8nm3kdoxcfkkzmammej X-HE-Tag: 1696853702-168567 X-HE-Meta: U2FsdGVkX1+CezOAqe4EY0slFTbF8usqFjxid61jVLB6uwvyI/Nq6KjCMKi0+e34VI/G8IJpvVRJVDSOLXbZnRUPfYRxcx9boEKYyXRgba9I2ngB5qOHsWBjyAGRziPfejfbYDH6DGo835ObRkvitb07nVYh4Ux8vnt3YSTHUtlChRxrZ8SbFWrFLs42aqqM07TYka5sS7s35445a1UOUOkE4Zt5RwsVK27TrEjCXZX5sYyC6arjLGedpkXISzOsXXPDWqsPfj3hishReYXgoIC6E+WNGy659DkL43BcpLhRK4ajUEVF6SXW8kOaojr1dghljloH2mhMZQ1ashC+KoIMtoRbkoHxSQOW7hFfn6bKnTb2gx2CbPo1gOL27RergAGmBImU6AaugIM+bjmk90cXKGObRa6+d80L3Jg3lwHtoPnTlXsXi7n9750Tw36kZBw56s6XJhFzG9YPOQl8AdFpp2OF/Ftx6uHzG3936l0YWewEFVBFsjAbU+3PxXHSc2RPjGN34WAauxUhXqAIUN90GoRg62KyoF1mdYdtI70Co52GNJemgDuIEQk7m+xZYMkgOnXN9izjhuyKwMa1ZR1s8C96IFLw2vEvPedvLMo58z4fvb8BTc+qMuBkHtvUqtpkIYyw0oOA2eHYpMozhK6KwU+pd8JM3qT4TRCJcMdC5ALma5ySQNAhHuRu0TaFOiK84YGppZjFRCFtu9Zkr/yTPH0Lwi1AboO8l1ZsFRGHAb+nPJ4Rcc8UwcDGeIjQRgU4vMx8J7MRbCNrNi8m02B6URykdW2ePGYBgZz+skaP4+QcQ3oQ2QAIr3J6SLV6a+M7Y96gAWRHOF6kpLszOkBr5aQhQ5E1eLX81a8+EfNfwGKj3yS350CS7B2IoxFGSFJ4GyOYKxrP9oU6hqF584uv98xeAVtKInqbArJXpoZBp6Be1VfCSZi+IySIZaKdawOky5/EGtl/mJm2G5U 4AGOjpuj HHJc4QUf/iETXFZeFmhbVJ316i2/th0fy8rcrswK5caLL3jNV/ionYQfL48xXY8hKHNZI/+K07iktPMySxtnJOvErQFQGmWu4uVqvze9YkdoO8OJ/UPsDr/wuP9es4VW5Wfy8d4Ek2qjDw5+4eqWQ5uZWcQw/P2d7H/bb5MDLwHoGHtZyiAB/s7xI1KelQ5gJMsO1k+UxEty/IWt391nKC3nQk9vrvmEycevvunVFbvpTuK7vCqr5VDEkDjN26xuTpWhBQ+4u1lgIewDIUkYeDbjBDX2WJm6nomAFX2E+TUysYAskiyZz3ZK/UZZnx0+BDp3kS04lTB3kCIA= 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: 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 4328895dfc87..486634bc7def 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 9dcd70911397..f789694fa3ea 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 d63286397638..ea5e55310705 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