From patchwork Thu Aug 1 12:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13750420 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 67EE5C3DA64 for ; Thu, 1 Aug 2024 13:02:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D64BD6B00DD; Thu, 1 Aug 2024 09:02:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D13F96B00DF; Thu, 1 Aug 2024 09:02:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B66726B00E0; Thu, 1 Aug 2024 09:02:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 978FC6B00DD for ; Thu, 1 Aug 2024 09:02:13 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 570DF140D6F for ; Thu, 1 Aug 2024 13:02:13 +0000 (UTC) X-FDA: 82403689746.08.6237A12 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id ADC6D4007E for ; Thu, 1 Aug 2024 13:01:57 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=vGH+nzw9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 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=1722517254; 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=Bk5AvI3mwWxAfuMLeCK9HoxpcWFkf+K+W3I7eHgeFrbGv3gHVrSsLa6LAVYefn5dLIzmjO zL6c94JOVZtnFyG+JQd2X7FLyILTy/dYZW6Fhp5nrg1muX8ey9DyeyK+ol4oQIQDxGKxYX vPJBU9oPud90Q8QyJ3Xeek24r90Ti54= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722517254; a=rsa-sha256; cv=none; b=0n06cMD3ktxvB7JkutYFWgg32n9Ow/6ePRbNs6z/pMcAE/qilO9mAOdXGl8h9csqNiY+YX Hww9P48Sh+b4Vdgo1RgqI+kZArqicwVvCyzC43vYgItoxd786hv9GPDVlNHxohE6kZ7ayH 3HsuFPKCDADnTWWYxzoeg2rDoekdKcE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=vGH+nzw9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf17.hostedemail.com: domain of broonie@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=broonie@kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 9B98FCE19AC; Thu, 1 Aug 2024 13:01:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D64E5C32786; Thu, 1 Aug 2024 13:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722517314; bh=YYz6vJzvFivBjzQl/oYVfPbzMadH/24Qr7CyuKANnYA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vGH+nzw9stnDTdcaftUMZ0RSrgKf7OteE0TbDxGrYkVLsG+cDPLHLN65Kv1/N4j/q KkwToUJ8Xg7dKAusreA/2dsthDLf+JuDgtaZ0natBK+eHTXNKOuOihBQfyIBJYCSP8 MhXRdrrJQAJTb4kKrWIhoaaJs1RsdEx6bKTZOcfJgwwublrWEtufqEI09N6a5yI7x8 02keFtwbxiMdw1K8xQwg+xthHk09VaeAUKwjJLry/undGymRfhuJ0YpJIDtZxhC9SC lCJ1JJcsHj6fTKJ9B9nuH7gwaqaGHB8btfldLKKuRK/aDia5C1GRrYerJJ4vMHCs5U JriKtF9UMfzXA== From: Mark Brown Date: Thu, 01 Aug 2024 13:07:06 +0100 Subject: [PATCH v10 39/40] kselftest/arm64: Enable GCS for the FP stress tests MIME-Version: 1.0 Message-Id: <20240801-arm64-gcs-v10-39-699e2bd2190b@kernel.org> References: <20240801-arm64-gcs-v10-0-699e2bd2190b@kernel.org> In-Reply-To: <20240801-arm64-gcs-v10-0-699e2bd2190b@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.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/pANAwAKASTWi3JdVIfQAcsmYgBmq4Yk7gWmnGFkGrMdlCnUH3lfdRyPQ26ry/+pIlvh D9NfY9qJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZquGJAAKCRAk1otyXVSH0J8tB/ 40xcfumCAXaBAwsmdgdRL95dbspFwaxEzgXyO64AaG/C8o9hNZefmAMaq/PxFo0Ni6FHz3yipgiRx6 yrerq119lFtUvd+7lHrcyWo/mdoKZ4cwOzV9Whr1IvDJPZ06uozmIEdF/iyDtvTyAZNvzVO84gBj2M q85Qzze6VxUhpdwJVrF4Yx0EkNNKZ+7qdqNU7EtXNTwNeLIU4xWnyxl8bF0jTJjrO/4QvQKjEjZZUi S4QK5iXMXEUIxq7osw0xYVXGusBdQwBFmxsz0HrOCM0GE2ACUOAJS3pR6gHoJfRsq8XHFUDwdtPwXP t2DXyibXI765vRiG1dNK7vTS4V7Yot X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: ADC6D4007E X-Stat-Signature: ieymx6hx4bzhgfarix6bo7otineyqw8m X-Rspam-User: X-HE-Tag: 1722517317-640682 X-HE-Meta: U2FsdGVkX18BHobGbyWuKWSF210ab5mYVzCIJ7JnovtlQl2/NlRF7XcbkBjZkS4tRp6rxgn8LU/0/k+LdT+Wfk2zrgeXsKKP+PKtYUQhMyzi5flHJSp1zZNQVCyWtIzqtnjEkWOXA7dqWfjUlOI3HaSfw0qfnq4xHcUGMp4c8y4KQvfK3nGft0/TmWtGkQ9SirddKtUTLxrV0jaaSSN9F65omFlzvoLu1y1ttr6F9AqcalzQ6T03QoMA9wPUyEIW0Mi91JIkxG7xgOsJ06lVO187BW+9ghloxCY9/mJ522c3lGQ/NhYCb01ncb5yeWifS220bVYqLSvrNYN0FSVd8QhGgoFSL1bD3h6fjhoYRAgpDAZdvGXG7KSfQ38hMjUGcP63fWrqa1EeTcgkBx6g7u1ZL9bu65g5i2JPBPOvSwx7S3oDRn1eV4wQcfpfmfK/MykFEY6L5uHdVSRcnwxSIZ3PaY9ciNkpix2plvFsxVWlUajBtFjhozG2ofkC4UH5sPgaIch7Ec0STpKouw+bl5WsEOh6SHgV8j8BtXFBntr9dG9Yq65LIY3bgN9F2Q6JutWOozw/sjk9gPbgOeKGSH0GMCz24EcV88z19kjfIxQCeBbNGpniEWyuNCEcagMl7Ze7lC+R1GkD+wi/nD/5V/tRJLzD6GYOoKfSFDAoCLBbUAl6gguxY8XJZUb367Kjp9uOCm/tGXEDPUTVeBn1GR0Su+e1JxcobnM88FB2RY4pIsInW5SWUhBZPZzosU0CZ2CvHaAN4VTBCwhNr0bPe23eaYfwMaM/IT7HhmQZMRJghmXgxjpxjfi+/NjeoyS8l5QcwkA4bHBEIc8oFL/7s4OTpeS+4lp45fJe+wIesMQXBwweoNfKEhFS9N7nsI/+ANC1vVup/CwHC8LbHMJhB+oOzgvTg7Vc5IItNlbfta/io2VPsY8HDGu0a7hPjMhrRVsNlNzc4HtZ5VlUK5F jlWeDfRG Xp2BGA1dGWWVuvr/TLs144L+FDVEvEJp/0w6+TlTAS0xsD222CDVKW+hqIWDMR2m3z/u5MYQU/j/VJouJ55jCMYaidTeMUu1vWsvdAlvJZfTgtwrUGxy2pmA9DmiTUI9u+KJ9IuegLkdqBcIkL0FlxRbRSNeLEgh1bbgq2uuRURMR80kXABijyaBmO8vlfzd5KhZ2C+428vLivozV8AMyM3esaQ2I9VgwmlgW+3nliBbHfbQ5WOiUnMcHiIuGeGCloSpVvLpUGC3YMQaKs6kBQFYBnemIklMtVbpT+X/dZcR+FRMA7iqbvgXYvrPdEPaZ2QcHpg5f2t0MOh2xbJ5Ga3/0Dz3fd50yhdejg3wAq/WuuZoPwtOf4ST/yCUa9iktgnPT 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