From patchwork Thu Aug 22 15:10:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13773683 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 E4184C3DA4A for ; Thu, 22 Aug 2024 15:12:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 774BD6B02FA; Thu, 22 Aug 2024 11:12:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 723296B02FC; Thu, 22 Aug 2024 11:12:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59D586B02FA; Thu, 22 Aug 2024 11:12:23 -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 35EF66B0199 for ; Thu, 22 Aug 2024 11:12:23 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E39CBC1712 for ; Thu, 22 Aug 2024 15:12:22 +0000 (UTC) X-FDA: 82480222524.19.699E6E4 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id 2D8568001F for ; Thu, 22 Aug 2024 15:12:20 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; spf=pass (imf02.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=1724339477; 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=R8bZ0HCDMB4Ng+fG0OFOyHWUGs8nbmuYuMVfMre2cG4=; b=ZLkTK/gWj5W7ya/yFn1Q6LaVNA+eXcWwR820Jm7xGjWF8lNESaUPdBLa49v/edsv9g822p Ee1NYQ6exsPhr4cQJvwNzBGT3ibt2Juwi6Aak3/XfNDFQySWo0i/sCFDQGfktGTA3l9Tuz pnqsBMu8ichnduUxgbwhS8rQJpQH/F8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; spf=pass (imf02.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=1724339477; a=rsa-sha256; cv=none; b=bw+ILkHTtbimv9terS3M/A442hfBxXWfazHtnBXUNx8zvkXiqiEOTnNlcBQUbJzYJfOZV/ yxwIfNGIA9IX8S07ZHF7BAgioH8ZEQTBgfqU5Hnz50OCTEgEbsgM5G5FC7KGcw6raohnB5 Kibxymm5tm5NjosbtY1EsJrZBtD4mQQ= 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 830E21596; Thu, 22 Aug 2024 08:12:46 -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 64D793F58B; Thu, 22 Aug 2024 08:12: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 13/30] arm64: add POIndex defines Date: Thu, 22 Aug 2024 16:10:56 +0100 Message-Id: <20240822151113.1479789-14-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-Stat-Signature: cokyyxe5db3f34dfmfa8uace5kre6e3m X-Rspam-User: X-Rspamd-Queue-Id: 2D8568001F X-Rspamd-Server: rspam02 X-HE-Tag: 1724339540-198329 X-HE-Meta: U2FsdGVkX1+Q9UL9HV3oZO2WDfEQLaNk2lDHQU9lf2uSpBYjKcsN58/hz2v2j9RaGtD65wPVPnOiJjun0QPQWBCL+XbBvEbRki4fVe17Igw4uT8gDHxG/V4xUuU889mWeOkl3nZp9US+e1HD86d/cVutcGni4aj4pGlIWea/a3+g4rRHSE63dMKmoISUDRXKIFlSu/rKphBSibbFSiBcK9l4kwbxtM1hnVxg7BeJMx0jCIbVva829QBtoqv9aTfTv4KuTr79ECzSaXopF93T5rv9wzRl85EXXpNTCnrOyk9bdjV6L/y9Z0+GSxkK1OyuFe6JDjSXiD6TNAFEzQtlRhF1mpn3juYB5/WtKjxbHh2rQcN/bpH5d2ORn+1dV1Sh9NPzDggt2NswHok3P+ymJCABXmsTiYtzB1+C0ulLHPmV87XZ6dWBHF/Vw1uep5ZDtuhYKTjfOczEEbih9nI9mOKpku26iE1wO+qbffhoGF7dT+kB1RpGyMDF5frDl6bzC3c/scWmHdnBUQQsl8N28M5gtRKPw3giEW4KbD0fed+f9bh33/xu+fqd7tuLcti+sN66D/4DOHaSpHKu9AuvY7XS0De0dWPOOC0j7GA8TkH5S9XzEEfuTYeFqv6MGNnrrvRs0cFzlbPWkaLE8ikFgIb2eDlyRE4wShZBNqxIVT/WLw9j7XeyuvkT/pISfkgt3/+LSGJTqK55JLDbKezM1xBR+9SWxusXO8uWc49NsxlSHeRtbJNn8B8cMaHBdT4qQlZMfDTsSIMI3jHox4MzxjB+bYh0MMoc1CnFc8FmwCnj7U/cCs+T+uM42ocivH9FXudMni6ooQB/prt1yVS+lv4h2aW/xA+MXflXlgqAdBsvFkzhPMK0znX97vwVmC+1rIV/XvdkbviI4t1uzFl7BgOk0Dr9wzf5X16j6WclSB07hyWs6s0C5ZfL0mbh//+GmiAqtYnZpyjrpshmd+M Q6UY7b49 +8aU5bMigwecC4aLUly8NeNF1d3Vz9VuGEmMjf54+pxMmqrUQryfXhvTwHZVU79fwFaNvoH8/EirWgeXIFFRGXuSgxTtSVV9+5xNWHUKp3Bz4fn4mFbmAlqe/Ah/CXgqt33fAYf+M45wqTUjh67UpSAKlr7D5FNfP70lUJZkq40v/yZhXuSHzMauKZXbznB0PdiJuI0MnNIHhvFXjf2GDRcj6bQ== 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: The 3-bit POIndex is stored in the PTE at bits 60..62. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Acked-by: Catalin Marinas --- arch/arm64/include/asm/pgtable-hwdef.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git arch/arm64/include/asm/pgtable-hwdef.h arch/arm64/include/asm/pgtable-hwdef.h index 1f60aa1bc750..3f0c3f5c5cef 100644 --- arch/arm64/include/asm/pgtable-hwdef.h +++ arch/arm64/include/asm/pgtable-hwdef.h @@ -199,6 +199,16 @@ #define PTE_PI_IDX_2 53 /* PXN */ #define PTE_PI_IDX_3 54 /* UXN */ +/* + * POIndex[2:0] encoding (Permission Overlay Extension) + */ +#define PTE_PO_IDX_0 (_AT(pteval_t, 1) << 60) +#define PTE_PO_IDX_1 (_AT(pteval_t, 1) << 61) +#define PTE_PO_IDX_2 (_AT(pteval_t, 1) << 62) + +#define PTE_PO_IDX_MASK GENMASK_ULL(62, 60) + + /* * Memory Attribute override for Stage-2 (MemAttr[3:0]) */