From patchwork Fri Sep 22 13:42:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13395794 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 705BAE6FE32 for ; Fri, 22 Sep 2023 13:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=CyvH1Q/NBdpykpd9NaLAli7IrZAQgtR5NcebtUM2Nh4=; b=jakzXy+Mt3yTDN SRmoNz31MQ8BFES72YAy1Ol60cEX13KE5c8Ej7PFvnBmv31OhwdrABDqoqgPUfvZZnPEzm/hjAynC auqqy8dbeTH68iZRYOw4TpcZrMVQHqg2O6os4aPluX2ORfqND4zYBhg04hGvlnRIApwm71TU21Asc Xupk6G2Z5ew3pUlHDdG6Z6S1fROTm1GWxAAYs++C3hQG+erKgvt2e7AaBngj+2ZHCA4R4ing+HnoC 878aVvXWwEH28IlRycZwqXUSi7g3WsfGZ9DpQr6keg+EVtwUsyPHWTOvXvgP0dW7OUe+sMRAmtAtX iZAYYZQTpbh1w/snZ2/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qjgRB-0098Wv-2K; Fri, 22 Sep 2023 13:43:17 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qjgR9-0098WO-1N for linux-arm-kernel@lists.infradead.org; Fri, 22 Sep 2023 13:43:16 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B04B0B8236B; Fri, 22 Sep 2023 13:43:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F9E2C433C8; Fri, 22 Sep 2023 13:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695390192; bh=j5vHMaZNulwNl93JoC0zZV0oxBkj6KYr0yGyd8QJbdo=; h=From:Date:Subject:To:Cc:From; b=t4lJmsa9K4SYFVWm0+sQnhrluecCWx1/h2UO3tdYzyQcNFoCfXBzw4bfLsSDLM5Kx D1FrCraIUpto64iBPGytXJiDuL8rmZ+8YiRCw+0Z0QZD3iEW8Gu1jhbjYKWG5zpphB DEdXCPR2i2uNEZD436cJqqKEX8fORj60xmlaiav6NBjHg5Yz24XBhRx1z3kg3//l+E wSaLRnXqdtQu8WjhwjdvzYTqxcocXGrqP0fT9CiU6pBwrU94hV6BRz0QtUn84QYcZA TswjEsDPPdvC6DlOA5shAnsgAK/X2vxv9NrPZcvq5I8DMYIiO1BS1K8tPEzFhhTouo ExFYVtjSAgA9A== From: Mark Brown Date: Fri, 22 Sep 2023 14:42:55 +0100 Subject: [PATCH] kselftest/arm64: Validate SVCR in streaming SVE stress test MIME-Version: 1.0 Message-Id: <20230922-arm64-ssve-validate-svcr-v1-1-f518960eaeda@kernel.org> X-B4-Tracking: v=1; b=H4sIAN6ZDWUC/x3MSwqAMAwA0atI1gZstaJeRVyUGjXgj0SKIN7d4 vItZh5QEiaFLntAKLLysSeYPIOw+H0m5DEZbGHLorUGvWx1haqRMPqVR38RagyCpakbZ52rptB Ayk+hie9/3Q/v+wEf+CEVagAAAA== To: Catalin Marinas , Will Deacon , Shuah Khan Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-0438c X-Developer-Signature: v=1; a=openpgp-sha256; l=1353; i=broonie@kernel.org; h=from:subject:message-id; bh=j5vHMaZNulwNl93JoC0zZV0oxBkj6KYr0yGyd8QJbdo=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBlDZns61ov5A5gcZVF0zAW559z+8Z0qx8tajKUMDpd tkqOphqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZQ2Z7AAKCRAk1otyXVSH0KOeB/ 9r2n2qtsZF3r9yWVP4nOm48WJ3hFIrTcWeN+ScxVXkjqsE9cdscqgh645B5PY54xzcJF6Q2NcPBtoZ N0VTsagWZXTcbXrX5Phoy1xXlaUq6/KTSLL/PstOYP2i86Jkhxv3Rw8+Ajtuc55mogX0Vv5uXMGDxJ /hVZsOgBKAtFMQgHo3D7aoR2HwjvmlYSDvYT4dudhvfMAVpz0hOyfHvnfeOAS+1l8LFQOCjNtyLKs5 o2FtzXBmcjaN6pQk1z9aeWniPT/tzo3WjgeJV8V2HKQBjhS9qw/hmToLC0rc96rBLWFl88NU6SqKrx MH480RiImZ1PgC6BQbT9vEhnfF6rmT X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230922_064315_621200_940B2C3E X-CRM114-Status: UNSURE ( 9.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the ZA and ZT test programs we explicitly validate that PSTATE.ZA is as expected on each loop but we do not do the equivalent for our streaming SVE test, add a check that we are still in streaming mode on every loop in case that goes wrong. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/fp/sve-test.S | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- base-commit: ce9ecca0238b140b88f43859b211c9fdfd8e5b70 change-id: 20230921-arm64-ssve-validate-svcr-316852554fc8 Best regards, diff --git a/tools/testing/selftests/arm64/fp/sve-test.S b/tools/testing/selftests/arm64/fp/sve-test.S index 4328895dfc87..547d077e3517 100644 --- a/tools/testing/selftests/arm64/fp/sve-test.S +++ b/tools/testing/selftests/arm64/fp/sve-test.S @@ -473,6 +473,13 @@ function _start // mov x8, #__NR_sched_yield // Encourage preemption // svc #0 +#ifdef SSVE + mrs x0, S3_3_C4_C2_2 // SVCR should have ZA=0,SM=1 + and x1, x0, #3 + cmp x1, #1 + b.ne svcr_barf +#endif + mov x21, #0 0: mov x0, x21 bl check_zreg @@ -553,3 +560,15 @@ function vl_barf mov x1, #1 svc #0 endfunction + +function svcr_barf + mov x10, x0 + + puts "Bad SVCR: " + mov x0, x10 + bl putdecn + + mov x8, #__NR_exit + mov x1, #1 + svc #0 +endfunction