From patchwork Thu Aug 22 15:11:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13773697 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 60C40C52D7C for ; Thu, 22 Aug 2024 15:13:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC9FA8003C; Thu, 22 Aug 2024 11:13:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E50FB8001E; Thu, 22 Aug 2024 11:13:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD59B8003C; Thu, 22 Aug 2024 11:13:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A97CE8001E for ; Thu, 22 Aug 2024 11:13:23 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5DA2514053F for ; Thu, 22 Aug 2024 15:13:23 +0000 (UTC) X-FDA: 82480225086.10.78660C6 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf25.hostedemail.com (Postfix) with ESMTP id B5A5AA0005 for ; Thu, 22 Aug 2024 15:13:21 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf25.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724339535; a=rsa-sha256; cv=none; b=6cEQCGh8f7LTa3CInua1mLthJc65iA+ko53g/Z/alpIXt2ETDMx0f0h2HzpQsHvKvQzru5 /xtt9lUcfLAtsHt0PmQ/rvrrn684WGdiAQgn6Hfqnc1ENr1BxMDzTb9J8dChJwVtacRrOS JWNf37o9WDybDyWbwTMI6QV/55RUa1o= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf25.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724339535; 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=MXCzl33CgYPuUp71NFeHGj+bfZwTzvm57ZuQHOtN0OI=; b=wC5mbFnDfyJSZokvldB7dkFyOi2V8gmiDZs1HkelLSWfwb4v8AOsykAR5Z0LCRkfGz30pt 2MsR4bxjHv6xDNnuV6nrlo8HT22H1wDd0329YGANWVAShF+G2/G1r+a/AQR7pQW4UadtLZ E1jK/5bhVE7x84gwn58rr0WcthCZN2w= 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 2889E1688; Thu, 22 Aug 2024 08:13:47 -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 0A2683F58B; Thu, 22 Aug 2024 08:13:16 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: nd@arm.com, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, anshuman.khandual@arm.com, bp@alien8.de, broonie@kernel.org, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, joey.gouly@arm.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, maz@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, skhan@linuxfoundation.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev, linux-kselftest@vger.kernel.org Subject: [PATCH v5 27/30] kselftest/arm64: add HWCAP test for FEAT_S1POE Date: Thu, 22 Aug 2024 16:11:10 +0100 Message-Id: <20240822151113.1479789-28-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240822151113.1479789-1-joey.gouly@arm.com> References: <20240822151113.1479789-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B5A5AA0005 X-Stat-Signature: ym6opicck3wtix9rjtwrk9pmqn6mg7x1 X-Rspam-User: X-HE-Tag: 1724339601-153711 X-HE-Meta: U2FsdGVkX193Hg/OuBHI/LncU1LlHHUHJBz6r63eoFM6qE0g9k1qJ9StzyY9Kol9+HWmj/z+2x9udk+41PkeKohbUW6fiquMMsA94+HejTtLdKMSZPveFImkHDNswQalB5zWp26ry1RDpFXNt5Q1jBOHGQZ8r+lm2f2/J8w0Z2CdKrTb+6B0Hogc159q//IAbIhHFgBkUO/k3t9IDj1Ppr2Axs2APrPgwcXno8VKI4+jjo+vtg+6Nn1Rz8jyr/tBfFCe0AsSYuNTM8v9CH3lpm7DYSknR+MuRKLPKJwaW7/3Pur/E7Tys8NnzQHNOOCVew+Qn+imWH9AZlxDN8amzYmSau0MPJe5dz9grSpUHTZ/2Op+oPrg3yoHX5cVh5PlcpeoHPifdc4rKAUAhQXLAhwK6T+eRSAbUTzNNFxUzJUw0ndBLKs02f8i1Nic54JRoluRIszqDjCXRdwUmfBxiokWPCak3yjp2eujwlou2OZAeJIkROVhsc+9yAtx8CumqPgDSwcZ+8MApZT2bxu5UPIoq3/D1azX0907xSBl6wSCzXfQYa3/ZLjK2YwtqInHyDxJOJv8eueEOeRWnnpbYObXBoeNUoQ3uS0DoSl1idbO8uRkaV7KL2O9M8A3MAkKDwyJ4mbb54UZ25OBzu5SJHX2EqejlH2M2WAVHrahPiTYZxejCGnHOUl32hgzaMO46FIJ8CiTRFVGZymza/KSfJjmXKNCN9uJRrwCDU0yTk91HjApYPraw6vswzT2iNNoSg/DVRFBiCe8X4zzr/1HzJvv74xOdwOesWwcUGGr2YEpqNAIPFeb5wvB0BNHl0JUS8goMGAf3UKjkcGaNZvFt0gwAvb+G2dx5FadQHuKWromJ0pQghdWcYHf5OW7+DwIydhHfBGlvbULGIJQmSofhXr+4JdovJ6MqHGodhZzTGteEhgIXvgMd/q9c3+oUUD2A5E/WwszzyEcBYvAncO z+pXb5Bl CH7WzVGcUIiCy64FA2dm8ZpYHuvXnpoonZztUkEpRvDawiLvbafm/Jpn440FjzFAdRVHRJCAl9ymzF6qJ1vuUbutR/VbWkK4iUDPHFltfNU83GzU03jvcNNv9wswPZHNzdxr0CzemBC6pR5Uh3R1rGOBialiu+2pnMT4zBVbG8mKiJG/6V0hLEIOmF7F/adGOSVkOIvbRelYxX8ge9qTtWupRWiJMmGVhd6aBVmZtUFASQY15vInG2wFnrKCEHrRDKZajbyKvQdejZcU= 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 Reviewed-by: Mark Brown --- tools/testing/selftests/arm64/abi/hwcap.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git tools/testing/selftests/arm64/abi/hwcap.c tools/testing/selftests/arm64/abi/hwcap.c index d8909b2b535a..f2d6007a2b98 100644 --- tools/testing/selftests/arm64/abi/hwcap.c +++ tools/testing/selftests/arm64/abi/hwcap.c @@ -156,6 +156,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"); @@ -601,6 +607,14 @@ 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, + .sigill_reliable = true, + }, { .name = "RNG", .at_hwcap = AT_HWCAP2,