From patchwork Fri Oct 27 18:08:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13438792 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 71092C25B47 for ; Fri, 27 Oct 2023 18:09:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 071486B03EA; Fri, 27 Oct 2023 14:09:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3AEC6B03EB; Fri, 27 Oct 2023 14:09:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB3916B03EC; Fri, 27 Oct 2023 14:09:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id C5C3A6B03EA for ; Fri, 27 Oct 2023 14:09:57 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A6CA51409AA for ; Fri, 27 Oct 2023 18:09:57 +0000 (UTC) X-FDA: 81392030034.24.BCAF9EF Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf15.hostedemail.com (Postfix) with ESMTP id 154AFA0013 for ; Fri, 27 Oct 2023 18:09:55 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698430196; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NOIalpql1Gn3aNVw5ZzZcoCDHoaYJ88sSdUjGFcXioo=; b=7NhAJJogYxxZXtxfgVvyxn9ogG+9lvlxcHcj9UGdy6IgykUE2WyMdq9ZGYGCcQ91i32wLE W/S5kEtcM/NrUjZTb7kQEhLHLTyPy2CP74GpAfOhCaHFR2Ovpunp2t29IaVSWn9hqzaiim CsqKVU4lIzZbh7UK+X3os2RfIA6mtK8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698430196; a=rsa-sha256; cv=none; b=Q2hzQUWGCQK7KuL5nBPXUpYho4mhWFPcbT3cWaTIqFLJVm6lheAm9+wD0vmaJpFt3ZAcrD J/6OXQHrGRGSx7n/7DJxUDSM3wBL41OP9Bg4ZW1skpRaF2H1q604/PUETDyUPSC6jBx/Xp 1SzIy9ViL8J0zfcPiqNC/OIlpgjYhl4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 16A2D1570; Fri, 27 Oct 2023 11:10:37 -0700 (PDT) Received: from e124191.cambridge.arm.com (e124191.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 487D43F64C; Fri, 27 Oct 2023 11:09:53 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: [PATCH v2 21/24] kselftest/arm64: add HWCAP test for FEAT_S1POE Date: Fri, 27 Oct 2023 19:08:47 +0100 Message-Id: <20231027180850.1068089-22-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231027180850.1068089-1-joey.gouly@arm.com> References: <20231027180850.1068089-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Stat-Signature: f1k94oj1a6pfy8et5uu3e95761bx77ee X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 154AFA0013 X-Rspam-User: X-HE-Tag: 1698430195-405677 X-HE-Meta: U2FsdGVkX18B8D4y5PLgxgx65T29t+CANQdYUjtzN+1ur8+8W1NRTViz+BdcQl0uPDObx60O7HW2HzVDdtZ28sgT8bCyRNGOKShKHeE189WvQy7xtgk1BVfq88Z0vUzIXQ5NUlWKvHnMJ+H6ixTud5Xkg1Y/okbz7aAWzAcySsKSavX9Ai3N1ygw4U4kFl0L4BHBGLEoRhkF4rXniR9N/CDVOCAU6YUW7Z6NNQSP0EdJ72y47fv9sLvGrGte4pCLxvJPvoumFpzTRTkqgtDAV7qynFNghZWJ+0+3QwZ8EqmlfETLpGy1gPH9SoZg1DGwCVLxbTMRneqXVyheNNngqhIsXk4U69BpdxHy4LE3zOWRVE8zjyFNIdwOT8aiVQxo0DN75QpodvuH4W7bbxtZ/zbw+P88gXK6J4/i32e33N4m09nHko1StX/dTxF5hEWZgXbWBLBQLsGqwpF1+cyqIhCDDJ22Sa0UarJRh4BjXZ+0WVrn9k/zy8D2ix7a8cD4o0mNx1oGc3BV5Sc5696OmmOGofwrZ05cc1krgMD+Rw19pUoImdQTr3gGKmTr77OuJ46syWoFe4oS59q5Fi64/AdXhmY1M12R0UbLMcGpF6vqvEt/fPpJ1/ditOo4J+1dRpvzeSdsaZE+E5H52PB83iNh2HILH/QxnoiWgLBicYDJlCnL88VsQqL+BnWsM4uoUZDFIyUoE2YMv/LrbS9LTVEMAK61YeVqas8XYDZu92EGbk7jinnin62/k8MPOk9sSQEiGUMveyqgWNgIbCHk+C347ps+a2RedO6oIgOONFss9DJG+DGWq3uaLbniXY/K6TYky4j7n1CgWPIJshQdpapSi0o8eHkHckw64yx+aSfGF7MUpFomFJCYKZo+YDJw3zH2fSvyan/PmP+2bFXfnv+veyKztijlPLeSdDN9RpcffUnObabpD6GRoRDbmnTTE/mCGY2Rki/n0YspHP6 TThs6jZY FdJbOEguDz6lYScZSYEMFFwk1rlYgwGLqNYwPgIFSPqBd0EqDYtcLQJk4RlHapebXo8/MmkAkl5rPm3PHt0uJ3NNLcpImBvkgnk9UyccnOS/6vyyqCZ1dm/0hwI72HDt6VeofpnF9CEQqdGyZNpqiZdtjAoPk6lWiErh9vehrxs67j6ydyrP6MtfkzJ/K7VPHnAsHsHw7WUG51Be0LVXkGz684sHjuQ7nGEsZDQ28XzbN6/iZSxLBY6tNZCAM0uoLB8wJgdmXj57U6cY= 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: Check that when POE is enabled, the POR_EL0 register is accessible. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Cc: Shuah Khan --- tools/testing/selftests/arm64/abi/hwcap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index e3d262831d91..64bb49fe3f5c 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/tools/testing/selftests/arm64/abi/hwcap.c @@ -101,6 +101,12 @@ static void pmull_sigill(void) asm volatile(".inst 0x0ee0e000" : : : ); } +static void poe_sigill(void) +{ + /* mrs x0, POR_EL0 */ + asm volatile("mrs x0, S3_3_C10_C2_4" : : : "x0"); +} + static void rng_sigill(void) { asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0"); @@ -379,6 +385,13 @@ static const struct hwcap_data { .cpuinfo = "pmull", .sigill_fn = pmull_sigill, }, + { + .name = "POE", + .at_hwcap = AT_HWCAP2, + .hwcap_bit = HWCAP2_POE, + .cpuinfo = "poe", + .sigill_fn = poe_sigill, + }, { .name = "RNG", .at_hwcap = AT_HWCAP2,