From patchwork Fri May 3 13:01:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13652805 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 60437C10F16 for ; Fri, 3 May 2024 13:03:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D7B1B6B00C3; Fri, 3 May 2024 09:03:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D05DB6B00C5; Fri, 3 May 2024 09:03:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B567C6B00C6; Fri, 3 May 2024 09:03:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 933516B00C3 for ; Fri, 3 May 2024 09:03:24 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 4DEED140F7E for ; Fri, 3 May 2024 13:03:24 +0000 (UTC) X-FDA: 82077100728.28.B854999 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 772CE40024 for ; Fri, 3 May 2024 13:03:22 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; spf=pass (imf11.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=1714741402; 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=eksSlg40KT/UC9A+H2dgGP3iV0ySpnxVzcGhGVsrjJA=; b=4TJbUZlfgmrSbye85FAR1lqDFhz3z8ruZzD9hz32mfILrP1XWyuNcCS0E3iTt3F8QzyMRn YflEXJINm0L3/xhqqnBz8+cv+GsNiQNw5HiBff9C52ZiP5/QR/M5e0gyLJQ9DuPI5mrzKq Q1pAu4HATLhqGw0dkvIH2qS/Mwa4REQ= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; spf=pass (imf11.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714741402; a=rsa-sha256; cv=none; b=GAz+BNF1SytRJtRehurie6l3jHJWw9EOBBUU4j/+LJlTA2jJzy5Yc2quCJW54+HRdh2EJs MYp9GWQLMXHZuSb2H7eLUDFoUNYtQH7L+arXuB1vKg7yxwVmSHwNsqwYQlacBHGFI3lsn4 e66eDk72tHdoBDqMQkXeAbQMm0hzrkM= 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 0A9D21713; Fri, 3 May 2024 06:03: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 ABFB83F73F; Fri, 3 May 2024 06:03:18 -0700 (PDT) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.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, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev Subject: [PATCH v4 26/29] kselftest/arm64: add HWCAP test for FEAT_S1POE Date: Fri, 3 May 2024 14:01:44 +0100 Message-Id: <20240503130147.1154804-27-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240503130147.1154804-1-joey.gouly@arm.com> References: <20240503130147.1154804-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 772CE40024 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: jk93hpkresnzxygorkfqyypqn7699uza X-HE-Tag: 1714741402-324828 X-HE-Meta: U2FsdGVkX1+BR8pt/9mcXZYLNtRP6YZPqUpoMXM/18/azh88Rde7kRFsi1kbw+weuiJWX+m/8VPGs54gDpJZ+a5VEfA1B0ngtRM5tAPnlWKXmQl7qlFx9IBeLzWTiXBT763fUpY8qtLa9IaJ2dIc4zkYeUJBMMRbwMCSdWnTA9SNHGvr5aIg4SjBdADVuzZhpJ4lEHxnmTG/btKqNNCTg14o9wTdecHWyIXJbmpoRAl3Q0JGdqnhi4ThSyHNJRITgHgKboJWIl0VSt8Jvvut31RHivYj0AMy8+SMi3y9XqsAgYObkqfZS6g7LEdHcHF4SGLLzBsaw1lUpRSM8II+j0h+xNjBDlsgX1kk8Vr/aV13bYAR5jA36kccPb6jEabTitk5nDmPyTl1ErVyF2eSiI45/DqjVPr+hQ3/d9LvRJDcbImdngEvmPXEtz4QFcfB5sOA+6ecQ/tmgoHKHQxkj7CnS8ddLZsyziJy5JBxa92vXCso7TorN+g1wqv5L9B2gFfpvJ3OKZVNMUVGvgRzf/+8/CgAKG9ZUjZdwmw6ek/qJVxaE3iORHZq0Lr2qT0iKaCdz/BYamemOKgipiuJ0w7J+mDKsKoNY4vfqe1muJW9silHvUI/tHeJmKu3+gn4gDdBu9Zo25/Pkd4+7yeYoL6lI6SeV/okLD45DuGjMN07igyy11/eizTuFz4/ec+ft0QKa93VDl1N2xnVyP/BWg6ZAiL6hh/l1oN5klAW9W5OJTWekl7Ny4mYoRiHo+KT0oSKEFVtNJ1WtbIFp714RkDTE5V9cyxdcWdyRLJ38DyopomjgMfawlDedzc2vpZhtAUIWJQXYGc5f1XJRJIzuRL37yBUIRAYCZeJN75FwinpYSpB6YdM3Ejnvo8hmZOMaLxLC2e2OUXOi3CXvMVnZMVedtYzjxmlUcI5MxI/vKsr1A4YZQwAqinffbPB9ptUX3zllknlRdidsn8naF9 PdmYWFY0 e+fD7oN2CNbiv8T+GFQZtC3L+KonLHyU8/p+Vr9hDlleoMibuL04oqZu8/wtN5FsyL5jZbPimlvZGwbXdG1qLYMCP/G2DtS+4FN45S38xhKN7DdrXcTZvu5hyd2QvOg6OJ9wnafwGY8/SBGTC+Xk32GMsCfvBX98szumiMuJ8sTzCv5t8Dz41Pcwf4lbpK3pKmbiyR4gWQ91xep91wPB9KDDw0WQr/R8Lcnvs890aCO2uZYnr5kE2aIugndLauTsf1h4RwHY6ccr4Uaw= 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 a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index d8909b2b535a..f2d6007a2b98 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/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,