From patchwork Fri Nov 24 16:34:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13467922 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 414BDC636BD for ; Fri, 24 Nov 2023 16:35:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEDBC6B02AA; Fri, 24 Nov 2023 11:35:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C9F176B02AB; Fri, 24 Nov 2023 11:35:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B65F26B02AD; Fri, 24 Nov 2023 11:35:44 -0500 (EST) 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 A7EB76B02AA for ; Fri, 24 Nov 2023 11:35:44 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 86854B61BB for ; Fri, 24 Nov 2023 16:35:44 +0000 (UTC) X-FDA: 81493399008.09.2770A8A Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf20.hostedemail.com (Postfix) with ESMTP id DEE881C0007 for ; Fri, 24 Nov 2023 16:35:42 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; spf=pass (imf20.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=1700843743; a=rsa-sha256; cv=none; b=xnkOmb6yQHmN11d+WbZ1jc423K2LWdCxjAtOQF5g1PQdzmp3BYLNg5qzUnqM1fEx4NQwS5 jrjLSKZQI1DRmg+R4WXO4BCS2kzr3zT3WlggfShv3oDhvJM2WRwLL9QBMrafMX2DK6TsSU AuJf7DCHO7P2NUirzCBB7+YWi/SIf1U= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; spf=pass (imf20.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=1700843743; 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=sgV4AndAd6/NO9/4ic2BHYdTbhCHHX5oZ2R85t/amgM=; b=26Md/4WHISl/xo8wm7cbHo0fJbZ9BPpNCj4+lOS4UNdV7Nr+it96+Ey2iXwrlAhVydqz2L Y6S+55norFS3/J0HW/xDr2MDuw7SwemOXspONPjDnLLTZ4Wz/sE4Krpmkgpb6f5lfipGZG +zxVq/5vHuXwJczFVQ2XPsVr5wHpHyA= 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 A66DBFEC; Fri, 24 Nov 2023 08:36:28 -0800 (PST) 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 026073F7F5; Fri, 24 Nov 2023 08:35:39 -0800 (PST) From: Joey Gouly To: linux-arm-kernel@lists.infradead.org Cc: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, broonie@kernel.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, joey.gouly@arm.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: [PATCH v3 08/25] arm64: add POIndex defines Date: Fri, 24 Nov 2023 16:34:53 +0000 Message-Id: <20231124163510.1835740-9-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231124163510.1835740-1-joey.gouly@arm.com> References: <20231124163510.1835740-1-joey.gouly@arm.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DEE881C0007 X-Stat-Signature: nbkqcm9r56fczyycktgwoxjqmnigixxz X-HE-Tag: 1700843742-314101 X-HE-Meta: U2FsdGVkX1873owlUf94OVKgEzN8Js0RPwmTUpSeekM3IyWLszzYl02BEoUms63JH8xtyiFhe1MdIdCL4PztBW/nEzc8to57Z0BcsBdn3AXKuGiR6RGdCmFGRpRP5iBojNte0ZSEDkmzX5tLQdI0PO1th0alLVItX+El+RgVPrz/AcIWyv4mVbkVLavyCyr4DNm1NpF4gW4TdoAA+W2uCTLO6JHGDUvoHTigFvPNwCPV4mbW6aGTDffpaxrKQrD4dVGhULF3iRHR8zqNm58E8ffRoDDTRHeN5zYifg0Nmc2NG9fJ3s0wwZqYePHkFqHH7XGy33cYabL12OwhVZWqfkyGZQErWrZ1XBznwNvA9XMPHUbiJBM7Llqxrhp+jSj0muRm4alptDc6yd4floVP8Pef1ISxMViKp+v+h/bQWYbwC6WTDfYKFlfAGJjcVVnR3eQoPFQeQGuLEIBOAAtk7ttEHrhyrRPZzg/ap/lSudJ+hEIJNdwanFfHauTLmVQnSAtrCyFzP+qn0vYz6HfDcub6yorGUunRtlwO2P++i34dvspT8Lkw69LJvmbO7MX3hDNBFrhqeUJ7gWSnsVkNeoXXYQDqL4YnfHzlf6QT9n9oD/+Saeq9HWPE6Lfz8MOKAEc+rMMgOWwjrPzRfPgGteoUnTjxOSFf/YOVrR3o8zGVdy/bbZzLAxzgfDTQk5XkYJEgM35hWTX1vEjm5/uJl66yMVgP81odmLaY49VBBS/HTtvfiF82/7+lDQp68v334lXf8P6TOIvItudZIH3TqbypBYrZEkJBJLPM9OloQRwpYJ1DTSZn+msOZdsg4yGs9Q3S1KWc8Kt3YwgqWnlJDhYWTxLwKwYtpUebCHlMkCLlM/+hI5Q1Hn41rlrQi2HJjV1zdB0jNNB+szt1F94Xx5K9QreV82Y6gl3+WhnWfpud7iAobm9WtGZwmW4MW8SKpAAKVc3/5YFOUCId8pH hBGXq1WI cNb+Y8IiDhKdBQC2nne0qY6gIfIgSLqCZa9TYCzJEGLpl3SEcyUej8RMYJxYBELTxRhGohjBTmlMUyy4YRbENnSPlsv3bm05LrmvFGFEyaBasuzHc8KlgYUC6EWRERNnBFev+KNuQ/prKFfvnLHVN3T8k6dCoQv9nfeoTfZKz878AQSWdOZBKNrtAVI++CofmAEa4WC83gooDKOwghfHVnmYI4Q== 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 --- arch/arm64/include/asm/pgtable-hwdef.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index e4944d517c99..fe270fa39110 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h @@ -178,6 +178,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]) */