From patchwork Thu Aug 22 15:10:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13773675 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 9AE97C52D7C for ; Thu, 22 Aug 2024 15:11:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2439880033; Thu, 22 Aug 2024 11:11:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F4D08001E; Thu, 22 Aug 2024 11:11:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F38A880033; Thu, 22 Aug 2024 11:11:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D37F08001E for ; Thu, 22 Aug 2024 11:11:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 788CF1C12FF for ; Thu, 22 Aug 2024 15:11:48 +0000 (UTC) X-FDA: 82480221096.16.C25F5E1 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf28.hostedemail.com (Postfix) with ESMTP id 9E0CCC0017 for ; Thu, 22 Aug 2024 15:11:46 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.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=1724339440; a=rsa-sha256; cv=none; b=zRnvy5+G4an/4O/zuQroJ23xkZCvbgGn3r/Df/16e2ALu+IYcLbbD12Hh9ymUqscETHE0b L9gUzM7b5IPzS2972vx/iDs9j3TYUKNFdmvi21dYBFXv80msc+ZpXw7/e0T1JAS4aVpITy vSGRaLeinN6HBurr/Rw0zIeznFJAbbg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf28.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=1724339440; 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=MNrTMGsD5+rmAx8lQBjnHgQzdbxN8x//itlGnFpXYu0=; b=TgfNO/RWR/zvuKCrDmrIbiiIplJgKkJJmGFMEYZhkVC0XeuoQBoPeb6He3UTJ3fZjUlMDw IfkTrSZi5Z+UVSXEvIsjupfBKywkRpqHAdTZH9XL1ddGE0Ad7SD0NC5YcTgUelflYxynq7 ZoFbnZ8Fi7penUGONzuhrsTiNbUfQ4w= 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 EE16915A1; Thu, 22 Aug 2024 08:12:11 -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 CF9E83F58B; Thu, 22 Aug 2024 08:11:41 -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 05/30] arm64: cpufeature: add Permission Overlay Extension cpucap Date: Thu, 22 Aug 2024 16:10:48 +0100 Message-Id: <20240822151113.1479789-6-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: 9E0CCC0017 X-Stat-Signature: eaj8msedmikizfd3q5b9nw1koc5tgwtj X-Rspam-User: X-HE-Tag: 1724339506-947761 X-HE-Meta: U2FsdGVkX18diIodbpd50zlT0au3pawe23Nd/aPMzPVnishW9JRrrIznEfFaliwoGeRHyTHVJrEjOP1x5XyNmqZ8oCxfrfDwPb/v/eU7EcELb/iIKkffdpj3/H3bcGWyHGKDaTWIEzdjQ9SDdo/2vMgB+DVDcTEkTlpoATaceN++3IXflmka8cWlfR4yGngaE6oPu3GhyFXcYAj90jhXC3sM9W/DUusocwKa8RDH7jbEEZkyL8gKusX4PmqoVToulL/uCsbIsp7D9Pm2ET3gHNSaejqWeyARum6zhqGtuBvoVsr4/YZ9FxOqAobNqrIZTQtCi98l+S0KNFNbXj8WrJ3Eh9rhrb0396COaG8DTixWKUj2N3uHZ6P1K/KSD2uzeJg9/d9s4V2VChQxX3WAFnO3+DKl2+ly9zbkEBP90Id4d+QxY164vpapHyk46gdyMcyXJGGG7eDvSfODbcis36R7s8pT1axH5dUO5/P60VVo23o0jMxpuyyYSlLIbLzNyBeV2HcKabUu3B1PVpcr4Br5pY3K8I4y4MEjSCOVoPxnzxcflXLlDS0GxEHTblvmgz4Q7qQ4JmDV0f1OiSScDtajORSroMsQpbu3LmNgoZ4ZuwwVnbUUdEwlfTKwrrGyOiFNhV/LoThrl3Tf0DS0k/nW8P5wof8BU0eTZjxPZ33p8OkruifGNTz2L2vdXnbws3jAh0lUaP8DBwMNZFGD72Tt1OIiZXQv3/y0r5xatya17cusIyOQ6Udq+jF5LnSZN+Jc0/yIBbmPvX0vLf9Zlfn98MMjlaWAKAfs3Uk1vSZtHohamRmk7aypxmqBYLsMz8a9ssY/anssvmT96vXNAxqZc28JRyraXh/c3ubBQMt+q5WmL0198nw5j2dyEt104M6Tr7n1/SLP9i7PVo6LhVFZ+wjJkIZ1k9ZodjEzM6T498JxHWnDFBArWzv+5GM9LnT9xHzPNiz5q5CTwXW /Ltj+FdD HC/JFqy0R2Q+3kbUX8fYdOUP4wuvmryZezOouXWI9QAPcL2e9/naES+z/aLpCR823dEjUemNQGqtUNOuhthyrEFwaoaI2OEc3UPKNAxtiVTxry4e+Ej52cmqfg3NJM5I4ojnczmTpSX8h+RiuLJcza0SNIGuixqtpzzqBncFWChG/7U76rCDh0ECHYE9Id7YMyLmC4dNrxaqHghEMZApr3aFieA== 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 Reviewed-by: Anshuman Khandual --- arch/arm64/kernel/cpufeature.c | 9 +++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 10 insertions(+) diff --git arch/arm64/kernel/cpufeature.c arch/arm64/kernel/cpufeature.c index 646ecd3069fd..2daf5597cd65 100644 --- arch/arm64/kernel/cpufeature.c +++ arch/arm64/kernel/cpufeature.c @@ -2870,6 +2870,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 arch/arm64/tools/cpucaps arch/arm64/tools/cpucaps index ac3429d892b9..eedb5acc21ed 100644 --- arch/arm64/tools/cpucaps +++ 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