Message ID | 20230309145246.22787-14-joey.gouly@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B617C64EC4 for <linux-arm-kernel@archiver.kernel.org>; Thu, 9 Mar 2023 15:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pzIjHHdytBh77s8GAyMXotyh33lyzqN8KpEYWSrisW4=; b=LVTNzO2uGCR8ih nA7YE6IgdoZzisQ7q2tQoWyH4pzQbCqtIP2YRzTUK44/IVsDuVFNAS7vHgdNEZiPDD49w9K2KitCf mj++uDmpqZNQJRQC8c1Zt8TngzzMAFAWoEY3IMwSSEv93umoWrkCPW79U3k24eGEXNINxcpersZy3 Yti/EoQe1CKw8mqWNf0zv/KZpYe5u3J6/7hyMR9qFJ8ZE5Del5oOAAcu3GJYTRu+g6yNsB+cKge/V jWDO+Ijq0wb8GuOCzuB3qi5JmaQnNNRhwO0ATEAhuYQPxuvcJVpQa8diUjEU9mWP2NfMNoyNhvViL 0odh5tvLR6qIW8Mp4uvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIAG-00AtPa-7x; Thu, 09 Mar 2023 15:26:45 +0000 Received: from mail-vi1eur04on0629.outbound.protection.outlook.com ([2a01:111:f400:fe0e::629] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHsX-00AnK3-6o for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:08:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=AdxNirSgKjzCOmWmOS7qysRM7g1snk/0R6G0jBYpmL4JRUs60Zvm5E5k2yC+9y+KO6luxH7fEuNwQyNEshzy6t169qgrM1GNWBHOYkkkY3yBg/9vFhx2uD/xpM5Q17BKAMPQmHEpPS93wWwqNUM2T7UgRvz+X1XVumH8KOae0/M= Received: from FR3P281CA0190.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::8) by AM9PR08MB5956.eurprd08.prod.outlook.com (2603:10a6:20b:2d4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:16 +0000 Received: from VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a4:cafe::c7) by FR3P281CA0190.outlook.office365.com (2603:10a6:d10:a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT006.mail.protection.outlook.com (100.127.144.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 Received: ("Tessian outbound b29c0599cbc9:v135"); Thu, 09 Mar 2023 14:53:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 65133d3445b245ce X-CR-MTA-TID: 64aa7808 Received: from 27806b85681a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A7E44991-9090-4D70-B740-930B036B01FB.1; Thu, 09 Mar 2023 14:53:10 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 27806b85681a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QRvyyL2qkTS1vEumibx9wh6cGTc9L+HT+5NwtqewMa42GNNDZD4+kuOwf1b1Q5t9chcBPHf7RXQc245zKtYhbp0dvvw805R3D5ru0qMXPmu+PQxoDzuomL9Jj3uPOdO53UCln9jycJHRFrB9WDyrIpOtxbCtKHgFnzM01h3Jn5llxfepFXxtcukoWkInQwJTVPB6ihBrUoFs9zEaFhWc5AWFv4yHWG5ZgS3Vj/IwQFTMtTI2mbmVMB3aCZT3kSYhUMnn35ujFRg15vH4rxC5FVHkpV/CdgzV5jkouTcsOX7JQsYbx7cKhSUrJxDMP8Fp+LOVellfKq4xF463z6MfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=nxFfxq6hXTUdOYip89yGzoajxleQWZTcG0brDqtp2EgsVFCFJ6Of9mWb+/UROjhrJk7Iqq0tXK9pPlizcJiI2DuJfuucaC1iYIjsOYWM/uucD+/4xyc6ZkiQmG7zSP5yxD60iJnfGfalrmdXVo8YfWBIxY84rF/hXpN1iPg4hILgtIX/t7RyUm1qndUrQuxDWk+SR8nfekaMkmuU+eKz3H1Vsgf9tgc/VvrYu96DwV2NBs+PM01lO7Fz1gAW9WHPmfsBt/z0ZGJ9ZWJO3+itbUsGpyTmUZdZSSmA4esogCyBzNi+PiSfBsE0QCbid8k5644w1xaOPz3sRoc5ZibABA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=AdxNirSgKjzCOmWmOS7qysRM7g1snk/0R6G0jBYpmL4JRUs60Zvm5E5k2yC+9y+KO6luxH7fEuNwQyNEshzy6t169qgrM1GNWBHOYkkkY3yBg/9vFhx2uD/xpM5Q17BKAMPQmHEpPS93wWwqNUM2T7UgRvz+X1XVumH8KOae0/M= Received: from AS9PR05CA0117.eurprd05.prod.outlook.com (2603:10a6:20b:498::33) by DU2PR08MB10280.eurprd08.prod.outlook.com (2603:10a6:10:491::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Thu, 9 Mar 2023 14:53:08 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::67) by AS9PR05CA0117.outlook.office365.com (2603:10a6:20b:498::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +0000 From: Joey Gouly <joey.gouly@arm.com> To: <linux-arm-kernel@lists.infradead.org> CC: <nd@arm.com>, <broonie@kernel.org>, <catalin.marinas@arm.com>, <james.morse@arm.com>, <joey.gouly@arm.com>, <mark.rutland@arm.com>, <maz@kernel.org>, <oliver.upton@linux.dev>, <suzuki.poulose@arm.com>, <will@kernel.org>, <yuzenghui@huawei.com> Subject: [PATCH v1 13/18] arm64: add PTE_WRITE to PROT_SECT_NORMAL Date: Thu, 9 Mar 2023 14:52:41 +0000 Message-ID: <20230309145246.22787-14-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|DU2PR08MB10280:EE_|VI1EUR03FT006:EE_|AM9PR08MB5956:EE_ X-MS-Office365-Filtering-Correlation-Id: e7b2ceff-7ee4-4097-2fd7-08db20ae03d7 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XqvQRfcXnQ5DvxuuL8lEvUJ22M/EGgPxMJ8+TDHM4n1NAQDoDZbvdux5GwTmnTV6fT1524vkOPzc3BVQ7uvqxBZkMorS9i0L+KMmMYQ2Vna207NCOZphsumVb1ROwaus2RWoEh2+CNbkDoDlAmUuRBUpPoCfaQSYrOWU8j2BSRXXrJrExFlc7oCsu7xkc/nOAeivcLSY79nfG68ln7G3b/v0UFQN/HadkurLVxQlylyyGZrHzkXlaL2bn1msqrKkwX4MHwB1foNI9HnRZ1yGs7Z9zuPJCcshlcmgirBdv1gIqGW49hgYwqlc2Pqj5Zpje6wLuDwveFUxFpM0O69WU1ngEP1NxO8lFqpkxbmMSv13/z3l3CMyigouqe0O9hIS+4zwYKdeh9hoyOiouJKtk3Y2pJBDmyQndNZFrn04BAIL2ZIvvkFcJHyq1oacqzMlPUKguMYm4ssExv6qcMmXqNu1TBv0ara3pm/8KWGyryXoDw9k0oWqws9Cug1EEvJHkb9qZhy+f/YLzVrzZdOVTCoSPEa03YF91Z3JPp7agZAcO8aULryEBFTVHs0tG2uD1Bx77r2OUq5EYM1lXrzYMCGm//JH3yqQ51V1rMWczID6MDbkgrYB6oaRB1UmtCwikiPnahjZmB0kvT6x/xaZMeTXO1XIysNJ0eWAOr6nAl2Tl+FSznLO0+RKClbKQP3L0s0dfH/hweV3tKUIkowK0g== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199018)(46966006)(36840700001)(83380400001)(36860700001)(47076005)(426003)(82310400005)(36756003)(478600001)(82740400003)(86362001)(5660300002)(2906002)(356005)(81166007)(40480700001)(8676002)(26005)(336012)(186003)(70206006)(1076003)(8936002)(6666004)(2616005)(4326008)(6916009)(70586007)(44832011)(7696005)(54906003)(316002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10280 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e0fce4af-8afe-4dae-b757-08db20adff16 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zVY7tXhO0EVF8CrrYd65Diu70/jxQgCKYSD3uRuFvl1zVJHe7+C4VOk4E7Dp7xnmEcVcAtcPW4oTT4t6k8+biymEgFEknJerPDcgO+HjMcYLhanS/elY2XBb4OqrT3MfBaUdDy63Yj0aXD5aLKFv0A2G/8Y1oKhs5rJtvt42m1jkaBA8FcdcR+jJJ6QeJLwLByjXMTJ8B/ZxFNfM/MLsf8l7NFnvRiT2PaQuIg2AX9ZC9qX1PS+kUtQjWgrya+2Tdx3Upq0xecUGE05529+7T3aa7jWNgEySq8Yvr55lAPXqlLTuBKnMUkyXnqGWo4z5ijKkfQyF4xzAU69Sp+DYhdBE1B5b5VwXRAEP1dhHfrLtc59cSUWVRrftom2vRzAmKyrZQK+OXSns7jCC2l92Bts8bjD5QeOrl0YsmP01E7XxLNXhagpBDgckTELW16wwVJxbphxAXW1rSXOJ3ojIrRzx6oEwslbkf6AclyLhGRTps8FvgqZNthThRS03lnZKLcbieela9RlxR0BYm1Vvz1goEcYiXoFiP5iBVeQVpBPVsiovhlnzg4DE5x/ChRf0C7aG087kzAmiMym/W/D7UIM3TL+HCRmU8QyWRjKdI/yShPtg6+8Kt+H35u0siwUkKfUCxbOwRS7xVnJXZzJrLcSQP5PmqyFxZ6keXJbhD32nEsit6C9PD65pOjMf3Zpo81DJ8aq900pLW/sFAngkIQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199018)(40470700004)(36840700001)(46966006)(478600001)(2906002)(81166007)(186003)(44832011)(2616005)(36860700001)(5660300002)(8936002)(82740400003)(1076003)(26005)(6916009)(107886003)(6666004)(70586007)(426003)(47076005)(70206006)(82310400005)(41300700001)(86362001)(316002)(54906003)(83380400001)(8676002)(4326008)(40460700003)(336012)(40480700001)(36756003)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:16.2639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7b2ceff-7ee4-4097-2fd7-08db20ae03d7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5956 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070825_283939_F4F9A6A9 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Permission Indirection Extension
|
expand
|
On Thu, Mar 09, 2023 at 02:52:41PM +0000, Joey Gouly wrote: > With PIE enabled, PROT_SECT_NORMAL would map onto PAGE_KERNEL_RO. > Add PTE_WRITE so that this maps onto PAGE_KERNEL, so that it is writable. > > Without PIE, this should enable DBM for PROT_SECT_NORMAL, which should be > functionally equivalent. It's worth mentioning that since PTE_RDONLY (a.k.a. PTE_NDIRTY with PIE) is already cleared, we don't even rely on the DBM mechanism to make it writable. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index 9b165117a454..d26d0b427c0a 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -60,7 +60,7 @@ extern bool arm64_use_ng_mappings; #define PROT_NORMAL_TAGGED (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_TAGGED)) #define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE)) -#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) +#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PTE_WRITE | PMD_ATTRINDX(MT_NORMAL)) #define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
With PIE enabled, PROT_SECT_NORMAL would map onto PAGE_KERNEL_RO. Add PTE_WRITE so that this maps onto PAGE_KERNEL, so that it is writable. Without PIE, this should enable DBM for PROT_SECT_NORMAL, which should be functionally equivalent. Signed-off-by: Joey Gouly <joey.gouly@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> --- arch/arm64/include/asm/pgtable-prot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)