From patchwork Wed Nov 22 09:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13464432 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 201AFC61D9D for ; Wed, 22 Nov 2023 09:48:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAC686B05D6; Wed, 22 Nov 2023 04:48:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A5CB36B05D7; Wed, 22 Nov 2023 04:48:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FD146B05D8; Wed, 22 Nov 2023 04:48:06 -0500 (EST) 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 7C0586B05D6 for ; Wed, 22 Nov 2023 04:48:06 -0500 (EST) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 576991CB40F for ; Wed, 22 Nov 2023 09:48:06 +0000 (UTC) X-FDA: 81485114172.28.64586E9 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 80E32180014 for ; Wed, 22 Nov 2023 09:48:04 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ky+pdXFq; spf=pass (imf06.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700646484; 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=lARH0LXYpPyl6/xq0Q87ae+WghUwtBsjqC5c6hCRo2I=; b=e6lYZa4Mz/GzQ2m+OvK4IiVXFl4D+kRO6r33shtJpahapkUxp7jP+aANcM7BJ7iEGj6hdH FwpcNpRoBpPUp7fTc7R9Bhh4oUz7ZkJ30DpGZYrid7w6mvYE6ZYcbNvOHUe3t3KFc6ipxi B6xVbTuz7JjD4BwG0j7gavgY9E26uyA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700646484; a=rsa-sha256; cv=none; b=u+jca3lpRC/6t1xEHc62r4liu4nVeywtT6eQHtMENJP08mLfgWhqRHEQ7oer++YQ2n0n68 I/qkXSUfaBcAHiWOo7vL4leDLHsXR7FhrhTDYJVbNnvmd2tTX17xOhMVV6voUGFSwYy0s0 NOWDeqVO4I8Lh8xoTl6H/tssAZ3QVrU= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ky+pdXFq; spf=pass (imf06.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id BDF1361CCB; Wed, 22 Nov 2023 09:48:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07F11C433C8; Wed, 22 Nov 2023 09:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700646483; bh=eSCNvWDUi17fRk35d8u5Mk3lnX0Qn/saq0Me9ODMcog=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ky+pdXFqPVvbwLOQUIF5KSUAApd5yTfp+EINHRoVxbFevJpHoyzBoj2b888ngusWk yaqfFa8QVfN25G/u7QdOYZUJScjAIgS0W5IYixhIMpxpcucqib0pQ39x4ovpU/4ei1 gVrQagiEjXeCrqjKfim7+VoJe9JtEaWSBTdRJi46N1fKsiwXaGv2WafWlU+6dHq8lN uzmYGPrRen1M+iAo+Yib/uD572QUkvKLXEUJXCTK8GbUTZNFIdU2G16bmX0oplRg+W IAO1TThYj30cSZq36jN5aITacV3zTcxa2zJi6aLLFWvZTAsyIT/vGN0hdk74aRrUiq hXdb6F28yuOyA== From: Mark Brown Date: Wed, 22 Nov 2023 09:42:48 +0000 Subject: [PATCH v7 38/39] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20231122-arm64-gcs-v7-38-201c483bd775@kernel.org> References: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> In-Reply-To: <20231122-arm64-gcs-v7-0-201c483bd775@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-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=3085; i=broonie@kernel.org; h=from:subject:message-id; bh=eSCNvWDUi17fRk35d8u5Mk3lnX0Qn/saq0Me9ODMcog=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlXc0TxVaHhiADHB3bt1cHAI20VA1kqzEuj0fpj P2J54lQhOyJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZV3NEwAKCRAk1otyXVSH 0JlxB/9FubKE8WWTJdmyYLHbycLew6cc6wkr4QsEGDYSbvsH6yUlHMaOFlF8K4bCuYzdet4kVjB djl3tnOX8toJbJGgztTuvNDASojBPp75eEaXXBNPtkn8zEZOzMvgXvd09/n0HmXffwhqFr2N495 TLue+HbFeVDNc0fCIhADVuCrpK+5PEiISx974vYRYvwsGyqLh59DxFuqqJgWVatzyni7JXJWWmJ 6wgvUBPx9mGzmUZGFi5H5tD93ZTl3+/CXDEPsk4m3sH7wOkaH9ohDus3PfpTRW42Vdad9uAvR4I A8kL/AC9KhHYrCxP1U84b4R0Y0z+oLl66/wYlFmPpOJWkdaU X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Stat-Signature: jo6jdfrjwwxsuyxubcq7dqxkhhosyksg X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 80E32180014 X-Rspam-User: X-HE-Tag: 1700646484-449353 X-HE-Meta: U2FsdGVkX1+ySzUljNezSlnMpPWqbu5ab4njrBt3htTZDqDxcc6TaltBCOhapcme5bT5c9Wus1Fw0QcPsQlIbJcWV4W9wcCac2I5+3SRqagumcBnVvW5mnXTmDikdjFpCMyMCysQcC+eZy2QD+Nlu/8Ra6XLdd/yT09td18zAgd8mBnnw7Zg4ZswfhnDJtPd5geXGBiG3/0phA1YoLRLYMeapxkG5Udl936ZMirU1SmPyl07L/TXHd/Itx65/J1CRbP3U96gvu34ni/tZO2RbVuj5X17gVTzhqh+fOIeJ5NkQtR8jG+28jTHzo0viKgfiXNtOuVLK2acMOTxVw/TiZF0sRYponQfCGRHFJ98tqWUIV3Kd72UjVM71XsUvI7Tv5GgMRIppBV9MtuPAzR7SWvWecwIZZkKHXLbomXllRCrrkNp1rpmMF537iz2SY5p9pqu/n755oiDqqzKPc30SWS0zrJzTajAeE8n2CVuw0SAuy6CcPPvllhI8pfYL0bumYhp9WnSgc/AufkTfwlt9aV3U4FZVAu7ugCJ+8Buok4ZgKtfuIL6dpmagbuHHMWiTJKPe36j3WjHQa0gHPNwB74/IPvic3grApWH1JTyQJJFP30/zkXSOMFU1ThGuUEBg0u6J+TicWOcoMTptZROG5KTZkJM5pDo1VbL5fIabdJFHccUIRNC7tB0It4K4KpZfBo+O88cZWvELEWnvAQryGsCGjYs6MQhRXPiX48ySBxF8Ggm1Ty66TqoBmpsi4xCP7b1mJUgWx3R7YjqgHKSMybb0XENZ74QU4qgk8ZUAR4W6EcQROu6v94bPI/dRmBsns+f6bGxhwDOoqdNcE0ayklcVmh0LxEdCZE9rrnwAj21HL6ticqLowGNLQv0l/mW7/lGSOxMLgT6jsbwfByhTZ20+YguhPeZlmoMvqt/uq+HvINlDLBYmpZ9nU2NmMCw4YBIW/vMSq+yTrGX5QP eItqvhyL LzmnOXIIaJz1HxwJB+Qpt1lfPQAkPy/OAvyOkfrAK2wwa/L6VMuQzQOsjp2Q0/vsCtah5vrvqfkPjB/A1LVeorLG2gKD4m7uH/reOJCjb7tyHIYr7s7m5RZbyRdfcAgCir7gjACWFXQQWfJGQtucSUKEYhQdTHZrWHrRT92iaQn/Yk6hQzr0Qc/NckT8caxRrA/Vn2d6U0DXbHmMg7a9k4t22iH65pbcjRDHVVXKox20KUgCDfJoWtzcITWglG5u761564B8v1jHWMqKbb9U2oLPcNnesxQGnM8RdXVLJog03cXkaiEg6o6AyBOqJvY+7XX6g 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 547d077e3517..e29ab7c4e824 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