From patchwork Wed Sep 27 14:01:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400876 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 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 9F8ECE80AAD for ; Wed, 27 Sep 2023 14:03:54 +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=dgbFz/vmr9N6DVbp2hovY2Zw3+WQjIAB1XL88aHuPxw=; b=WRz7pSeWwHC6ji JTbnfepFHW0v4Vgr6+TE6+s/ewhnL/vW/I1nh9BVJBpAuMLGRNSq/0breYDupMMAMYkBoaP3KWQcS xBQyErNBFHOIH0qufQQE7vkyJdT/CMMuNimmU8cpVoPPeaOaBe3oz3tm5jzcqbL2YNjw7t6K2X1JQ trhOm0/6lQST5RzCjrjZ4+1/yRv0409bcO1/krksTZFu4gs4ObkWRuvhZmV3J6SFxgTOnV8uPUcI3 XSwAwmNLuaS02iwfn2djT0y8ZT6YvptWdCfrUU8zRQQH171rsWSMjHQ3evW6ZLnM7Oafqjgxcinax jkoHwjeTEiVJib/8Emsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlV8S-0014nD-0d; Wed, 27 Sep 2023 14:03:28 +0000 Received: from mail-vi1eur04on062e.outbound.protection.outlook.com ([2a01:111:f400:fe0e::62e] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlV8M-0014ka-36 for linux-arm-kernel@lists.infradead.org; Wed, 27 Sep 2023 14:03:24 +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=/jeZoJNj3DCve0zLnDradealBpu4fQiYUevBJ8HVNHI=; b=7ZtNi6modLeQ+Yr/N4wT/5W6lAcz1UtNtX6xJMPFl+rKelt9CGXY7fgMesOofLcL8aVJjFADB3JtdxitEGyzOIXxxfnhIPdctQuzmcRx3uzO3DtUrWy5IuQpzt2+NU9b6LM8MmrSJC5xGqR1v1IWqIir6H+eYVXQ7hJiSDZlp+Y= Received: from DB3PR06CA0021.eurprd06.prod.outlook.com (2603:10a6:8:1::34) by AS8PR08MB8875.eurprd08.prod.outlook.com (2603:10a6:20b:5b7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 14:03:14 +0000 Received: from DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::83) by DB3PR06CA0021.outlook.office365.com (2603:10a6:8:1::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:03:14 +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 DBAEUR03FT021.mail.protection.outlook.com (100.127.142.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.19 via Frontend Transport; Wed, 27 Sep 2023 14:03:14 +0000 Received: ("Tessian outbound ab4fc72d2cd4:v211"); Wed, 27 Sep 2023 14:03:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f324b05c154a856d X-CR-MTA-TID: 64aa7808 Received: from a10bfef047fc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B8ADBD8E-3C9F-4822-B815-164669FEEACB.1; Wed, 27 Sep 2023 14:01:51 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a10bfef047fc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EZ1NghPCNkDzOWaMD3uX+tWFNV/JnAt8Hj4bN513bF52EiVdR8qjHXSPMaQaXvX6bCvueUqj7lsx9bhmG6uMDKQum0Q3HFk4d6QgnYwbQ8FA+Og7aSR0aikJ5PNjtFVUUJ6jUGgnc0KasqlququR5vYQLTf0ugSKm2s5jRph+0iUGoOADQj5B1/ICaj3g0yoH+uAYKR6wcrYJxPqwKyZEvd41rzI0PBdwtQ4HjOTDrkrZDDj1bRVZsrVNkOh1YeJmoz+aY2C9BWGV0IfvyMyxo3XIEY4zhJzKmHi+J3HC7vy5l1NrXpnZO281HdEHztv1RbyuCxpGDsxtxgw2zjPvw== 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=/jeZoJNj3DCve0zLnDradealBpu4fQiYUevBJ8HVNHI=; b=TD2sV0q0KmZggk7gig/OAqX7zOD/fvAGIGl4uzNrkdee20Wi1o5xHI4dI90kWw4CJ/Chl5z2daiJmkEXHTatOWNhjSkfKz/MIgZdjXuxDK5TT5hJkcU7OBpnRuPQ1fBGLIigfRk02s/3k7fn4qMcw4TR3GOdM+4pmJRfFeHncAfB/5jFiq7zpbux3p0PUmrrHlGlOWrpv0mlESK4/j6DrkAz7qZ6awxhnLBLtsfg23uRXWiP1Sk9ZCEus12BdHtYRr8uiR46+jZYX5YL2TabS1WJ/37W422Qy/kR55ZKMasqxA8UB0Hu3IDxTzhDLXuBGwSZh9XYjB60wTjdnJ8YPw== 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=/jeZoJNj3DCve0zLnDradealBpu4fQiYUevBJ8HVNHI=; b=7ZtNi6modLeQ+Yr/N4wT/5W6lAcz1UtNtX6xJMPFl+rKelt9CGXY7fgMesOofLcL8aVJjFADB3JtdxitEGyzOIXxxfnhIPdctQuzmcRx3uzO3DtUrWy5IuQpzt2+NU9b6LM8MmrSJC5xGqR1v1IWqIir6H+eYVXQ7hJiSDZlp+Y= Received: from AM7PR02CA0005.eurprd02.prod.outlook.com (2603:10a6:20b:100::15) by AM8PR08MB5666.eurprd08.prod.outlook.com (2603:10a6:20b:1de::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21; Wed, 27 Sep 2023 14:01:48 +0000 Received: from AM7EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::4d) by AM7PR02CA0005.outlook.office365.com (2603:10a6:20b:100::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.35 via Frontend Transport; Wed, 27 Sep 2023 14:01:48 +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 AM7EUR03FT030.mail.protection.outlook.com (100.127.140.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.19 via Frontend Transport; Wed, 27 Sep 2023 14:01:48 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 27 Sep 2023 14:01:38 +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.27 via Frontend Transport; Wed, 27 Sep 2023 14:01:38 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 09/20] arm64: define VM_PKEY_BIT* for arm64 Date: Wed, 27 Sep 2023 15:01:12 +0100 Message-ID: <20230927140123.5283-10-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230927140123.5283-1-joey.gouly@arm.com> References: <20230927140123.5283-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT030:EE_|AM8PR08MB5666:EE_|DBAEUR03FT021:EE_|AS8PR08MB8875:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ca6fbe1-ef7c-4d34-22cb-08dbbf627e01 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: jsMJfLYrUQXbs1koVzHyY3RDkn7JQaMLZIogET6oAFR/U69G8LlYE3PkEST/+o8jd7oN1KRQXsGGWOAQIMxTtB66Bq7EJSos1FI3cyQEq0wunYUK2L5j4u3c+szUJCC4BgFp1FzfuOQ9pGqWu/VCyL9AaK1s3GGOkSLrqR9g9dyhLy1O9gGOUOIz/ugxU8qblMTlBn3gxRHxiTS8JRToUUrU4ryjTvH+WXhP3wTSCfMJ0Z0QbfyvgP20iIB9knjpCabfcYo3y8dXdgWOanvNiY+CCR/8AxeHw0lfQm/JGQLzD2Am5wpc/LPiXJVb96iniWKw8o9aVE/Hpy8P8Ceu76DXENoCFevRbXPoP/ol2u0Dd/4VOoCVHyEvZXXCW8Z5UgtM0I6CkXmlj7nzOF1XAlGuu8jv//1X2DjgGAdP+HeHl8h6gPvLSIe7SteZMrsc1xIu5itjI200viv1PYb/tx6SzmxvwyQdBD78f5pBpH7ErcRH2/v2KIYwaQcRCb+2FEGJi+YSBrrXJ3JviSGTuteqmxzaLUhGY+rwbXYVllZXGMRV2bCw+qMujzWvhxx92U1mAKecdl/XjxURElgsiF4M+kkgCZtZkb/HCRNRVUDJB3tMRAROGqgZERXBtHatlzd6gAnUkaq2WNpy6TiBEU13JPx/2j70CBhq4tV7qXsFloZzhobSwCX0kM+D1Kg67F9bUhFAqy6ZScCoWliFrPwfJUVnOUnzq62hKnnBPT4hm4FM94ssiKPFafRoat7gXZ0tb8agreaPoc4fj8qKEw== 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:(13230031)(4636009)(396003)(39860400002)(136003)(376002)(346002)(230922051799003)(1800799009)(186009)(82310400011)(451199024)(46966006)(36840700001)(40470700004)(7696005)(6666004)(478600001)(2906002)(83380400001)(336012)(426003)(1076003)(2616005)(7416002)(316002)(40480700001)(8676002)(6916009)(70206006)(8936002)(70586007)(41300700001)(44832011)(54906003)(5660300002)(4326008)(36756003)(47076005)(36860700001)(82740400003)(81166007)(356005)(86362001)(26005)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5666 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8bab5f68-6dfa-4da5-0cbd-08dbbf624abc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vUAp3QRg26u4z0oMie3Sy+k9c4Jd9HPPa7PDVGCBY25DqWX5jjhuWYPamVdOcKezzLfMmZPIUu+/FSh368NazIsgK+hzDhRmS3lONkQfMM7ekD3lp9F+tRTZN2oGW2Mkqc95BHyRbChPajSHrojpl6cCOVo8MmCouLPiqOaNentIr9qkOXledUVAtgUhJfIgD6mg7jhFbX9OtdEs0YcPIYcSoLKN9EMSPKjG6IWM7JjrZXXym8UTtRAQQbr2wvtP51VQnJeKgZPvS4afgT53WmVHoZzxlM7zdW+dltORv7mddEez0Q5UJm5WRhNVbbxfLm2e6jiKYwDnpy21AJhhevaPwhjEbY9RTlh+LZcMsgjj0ETbf2a1mPWjwjBuw7axV7BfHzhij7L9v54qxODcmGWCbvTj/muDxGR7HYyttXtD1hFUUHH63aFjvDFSn0K1dKob2XWwBCF6P3ho15+8wDvrugrDkeWgm9HuNHUGIinb/La5C70TTG7MBsDoeFvkC63qy+yz7dQpINob/E9bU0vBlL0wJxw0HbkBkGyOK5vdjDmShoFClI+cvzq7ra2eis5xft3YJB8hOZo0Rc3ceG2PkMiQSDBLzoIws8R8hZUokbaaFQayDhMGwFf5TNBPpVcSulivKqk51hTwdGvwiqzNobiSMZxF8zRvvqBpnEk9QhQWJHRm+1/NZs2zzwUhLCkqRxojDorGPQqZ8ES0gBGw/WWyc3TAGv1WBQrzz6qRPmFqCm0DDWeI5qtANQld 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:(13230031)(4636009)(39860400002)(376002)(396003)(346002)(136003)(230922051799003)(451199024)(186009)(82310400011)(1800799009)(46966006)(40470700004)(36840700001)(8676002)(41300700001)(54906003)(316002)(70206006)(6916009)(70586007)(40480700001)(8936002)(4326008)(2906002)(44832011)(478600001)(40460700003)(6666004)(26005)(7696005)(47076005)(5660300002)(83380400001)(81166007)(36756003)(426003)(1076003)(336012)(36860700001)(86362001)(107886003)(2616005)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:14.4448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ca6fbe1-ef7c-4d34-22cb-08dbbf627e01 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: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8875 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230927_070323_008739_247B3499 X-CRM114-Status: GOOD ( 14.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Define the VM_PKEY_BIT* values for arm64, and convert them into the arm64 specific pgprot values. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/mman.h | 6 +++++- arch/arm64/mm/mmap.c | 7 +++++++ fs/proc/task_mmu.c | 2 ++ include/linux/mm.h | 11 ++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/mman.h b/arch/arm64/include/asm/mman.h index 5966ee4a6154..22de55518913 100644 --- a/arch/arm64/include/asm/mman.h +++ b/arch/arm64/include/asm/mman.h @@ -7,7 +7,7 @@ #include static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot, - unsigned long pkey __always_unused) + unsigned long pkey) { unsigned long ret = 0; @@ -17,6 +17,10 @@ static inline unsigned long arch_calc_vm_prot_bits(unsigned long prot, if (system_supports_mte() && (prot & PROT_MTE)) ret |= VM_MTE; + ret |= pkey & 0x1 ? VM_PKEY_BIT0 : 0; + ret |= pkey & 0x2 ? VM_PKEY_BIT1 : 0; + ret |= pkey & 0x4 ? VM_PKEY_BIT2 : 0; + return ret; } #define arch_calc_vm_prot_bits(prot, pkey) arch_calc_vm_prot_bits(prot, pkey) diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c index 8f5b7ce857ed..ef75b04f9d02 100644 --- a/arch/arm64/mm/mmap.c +++ b/arch/arm64/mm/mmap.c @@ -98,6 +98,13 @@ pgprot_t vm_get_page_prot(unsigned long vm_flags) if (vm_flags & VM_MTE) prot |= PTE_ATTRINDX(MT_NORMAL_TAGGED); + if (vm_flags & VM_PKEY_BIT0) + prot |= PTE_PO_IDX_0; + if (vm_flags & VM_PKEY_BIT1) + prot |= PTE_PO_IDX_1; + if (vm_flags & VM_PKEY_BIT2) + prot |= PTE_PO_IDX_2; + return __pgprot(prot); } EXPORT_SYMBOL(vm_get_page_prot); diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 3dd5be96691b..fcd94a39bb30 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -689,7 +689,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) [ilog2(VM_PKEY_BIT0)] = "", [ilog2(VM_PKEY_BIT1)] = "", [ilog2(VM_PKEY_BIT2)] = "", +#if VM_PKEY_BIT3 [ilog2(VM_PKEY_BIT3)] = "", +#endif #if VM_PKEY_BIT4 [ilog2(VM_PKEY_BIT4)] = "", #endif diff --git a/include/linux/mm.h b/include/linux/mm.h index bf5d0b1b16f4..43d96c925b9b 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -328,7 +328,7 @@ extern unsigned int kobjsize(const void *objp); #define VM_HIGH_ARCH_5 BIT(VM_HIGH_ARCH_BIT_5) #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ -#ifdef CONFIG_ARCH_HAS_PKEYS +#if defined(CONFIG_ARCH_HAS_PKEYS) && !defined(CONFIG_ARM64) # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 # define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ # define VM_PKEY_BIT1 VM_HIGH_ARCH_1 /* on x86 and 5-bit value on ppc64 */ @@ -341,6 +341,15 @@ extern unsigned int kobjsize(const void *objp); #endif #endif /* CONFIG_ARCH_HAS_PKEYS */ +#if defined(CONFIG_ARM64) +# define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_2 +# define VM_PKEY_BIT0 VM_HIGH_ARCH_2 /* A protection key is a 3-bit value on arm64 */ +# define VM_PKEY_BIT1 VM_HIGH_ARCH_3 +# define VM_PKEY_BIT2 VM_HIGH_ARCH_4 +# define VM_PKEY_BIT3 0 +# define VM_PKEY_BIT4 0 +#endif + #ifdef CONFIG_X86_USER_SHADOW_STACK /* * VM_SHADOW_STACK should not be set with VM_SHARED because of lack of