From patchwork Fri May 3 13:01:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13652785 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 18B8BC10F16 for ; Fri, 3 May 2024 13:02:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69A646B009A; Fri, 3 May 2024 09:02:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64ACA6B009B; Fri, 3 May 2024 09:02:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49D176B009C; Fri, 3 May 2024 09:02:20 -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 2C4C36B009A for ; Fri, 3 May 2024 09:02:20 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DC46DC07D7 for ; Fri, 3 May 2024 13:02:19 +0000 (UTC) X-FDA: 82077097998.05.638FDB4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf14.hostedemail.com (Postfix) with ESMTP id BCFE2100052 for ; Fri, 3 May 2024 13:02:12 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.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=1714741332; 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=EMTlE16KHg92fuatX2tP/KfEsLj0enCW7nGDqhK+fxQ=; b=0Z+v3yrSYCAmIj2xsaDN8LT+hp+QoYJJoLly0r8NJMJFohIJZHt+WDFpVEYz3P1nstl3NT yLRYG8k+96Ve8auwDw63qrcaYfCA/4RgwPv9JsAEQd8iSHtyJfZFlUnhqkWmih2qpaRneY H9oTrEJ2j7IjM51JWvWOnklhLAHIB0k= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.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=1714741332; a=rsa-sha256; cv=none; b=hh2fYnTVO0R+wXRA/WXDOH2Pbi/rcg3rYhWewEEyQ0+5vJA46ZDdiVRbcgsW428CWW4YDh R2lmiBz37yjLgQ6wFnwiuA3rDyosVRckXLQaoUuop0NbOC5lza6cB5ZUhaFcTd/FsROPn8 ZOHE7slswV23u1cVB0jPApA0ZCQnPYQ= 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 57FC215BF; Fri, 3 May 2024 06:02: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 0728D3F73F; Fri, 3 May 2024 06:02:08 -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 05/29] arm64: cpufeature: add Permission Overlay Extension cpucap Date: Fri, 3 May 2024 14:01:23 +0100 Message-Id: <20240503130147.1154804-6-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-Stat-Signature: k4mj1w5faxnp9rkfzx839w9opehtiu4f X-Rspam-User: X-Rspamd-Queue-Id: BCFE2100052 X-Rspamd-Server: rspam05 X-HE-Tag: 1714741332-502966 X-HE-Meta: U2FsdGVkX18RWB3Q+rYMZksYFCH9+sAP42KydJAUh1D9T0I23cQHAxDcxlAuYyM/5cgghOV6lfRU/+vEEA/bWj9ovCIamEMfAKD0YQoFMCyQuq4KfM/ltq1hbR9Kw5nA6fHIGM3budZFpvsCR8IafOPfgwsw4Bw/3WnIgZYnYTFfZMEueqIf5w1Bjc9BQBNeC1eeWj+hxk596knJdVbDGxbC8e5HWskoM6UWlGDCaMaoyVtS5+/vh19SnZbKYD0Iqz0sF+uwit3fWo0gLTXPclhQerN7PIfgIWeAq3ALzNfNWv9lX5WCUATQYxZWKMzRa/llq/n3lw80YtKZQKiafYv1ImzcVChhZ7V7VUo7ryxMw43m0ts/U7vKG6wMb7ENuKgcMQjtavGWYZYMM7cN9XGcdjd0WPI+42PPnwFDpQWXKbqPlKLryZblnHy70V8POzdr2xJKiA7mAiiO28zA37xVJfDuDCGDij7V3bqhk7MwjNdjQoTm0GBwVysUxATC90foliuy8pnCNFIJLqYYePYAADdZU80JHh/bi4UhIUaxNAiUOrwonDRxD9SFbnImTFLCqkREjAKY6kY3g3vxf9mljDYD5It5Fs8pmanweNkgTRYtbFBeoDxTe+OFE5Do8MOTkxvbRbwO3Uph5UnDNOJI1erTNTlXPzflTRSx0q0QSVaeP8WE9K4hBaX7UhaSPs4uyBaFErEc5JHiaAb6PJxMgepZfTRsZAzGyv5K4RZRQNAiOT26q1lKDKSc5lT6x+mUySNUXo5RM6pEc8Jp2ug/WvIjo75PraktRI7IRBZobGToYItJic5i5s/Nx1wnxf9dHPRR66gxpmUrdqivLSuI/tHnGtTYy2ni4bXCfBf2370o/79F+8nGpII04TAUx8hoUdeiDUZFTwClQLssaLADYDkXBefPGe97Gx5LpSbJI7sIqouX4r3HedWvw0EDo6fVyQwKTS5dAJ/FkNK BZizjQUd swMaoRAVgCPaAITzX7uEJg1wjjGQPBQ+wMQVieg6bB3tSxPzED0Kh2ECuTgDNvuS4O3DiS6C0ymeEMRwhLuJWIa4eEfGDvaIO5bIkeGLjE612kr91obRMbSt2MNZ9m2RkCw6QTXAuW70FQpyilgEBwZ5KuxGGsWZVn24/PpUuICE+a9deirk0tHNjeGwGT41TfIUlVVvNEV8p9UjCIaPSH6l9ww== 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: This indicates if the system supports POE. This is a CPUCAP_BOOT_CPU_FEATURE as the boot CPU will enable POE if it has it, so secondary CPUs must also have this feature. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Acked-by: Catalin Marinas Acked-by: Catalin Marinas Reviewed-by: Anshuman Khandual --- arch/arm64/kernel/cpufeature.c | 9 +++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 10 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 56583677c1f2..2f3c2346e156 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2861,6 +2861,15 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_nv1, ARM64_CPUID_FIELDS_NEG(ID_AA64MMFR4_EL1, E2H0, NI_NV1) }, +#ifdef CONFIG_ARM64_POE + { + .desc = "Stage-1 Permission Overlay Extension (S1POE)", + .capability = ARM64_HAS_S1POE, + .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, + .matches = has_cpuid_feature, + ARM64_CPUID_FIELDS(ID_AA64MMFR3_EL1, S1POE, IMP) + }, +#endif {}, }; diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index 62b2838a231a..45f558fc0d87 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -45,6 +45,7 @@ HAS_MOPS HAS_NESTED_VIRT HAS_PAN HAS_S1PIE +HAS_S1POE HAS_RAS_EXTN HAS_RNG HAS_SB