From patchwork Wed Sep 27 14:01:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400920 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 D6E87E80AAC for ; Wed, 27 Sep 2023 14:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 71CA78D0083; Wed, 27 Sep 2023 10:10:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A57B8D007D; Wed, 27 Sep 2023 10:10:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F7568D0083; Wed, 27 Sep 2023 10:10:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 405528D007D for ; Wed, 27 Sep 2023 10:10:53 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DBE511A09B8 for ; Wed, 27 Sep 2023 14:10:52 +0000 (UTC) X-FDA: 81282563544.19.F366F56 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2058.outbound.protection.outlook.com [40.107.241.58]) by imf01.hostedemail.com (Postfix) with ESMTP id 8EF4940014 for ; Wed, 27 Sep 2023 14:10:48 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=GOi0JcGi; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=GOi0JcGi; spf=pass (imf01.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.241.58 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823848; a=rsa-sha256; cv=pass; b=P/ILBXxxBYGBG2ljRJoohu1999hYoOm769SmnSJbQHSPNbCvJll8mnFoLBipb3egsJSGYN Oj0sf7wn0gLRd4NiVArW9PtwrgLHUaLdWusnPRgfGG+oEjdfCWd9B5A1IteS9hLMV3e0Fu FXQ669AOMPPddGSKzhYtfhUb6XA7u1E= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=GOi0JcGi; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=GOi0JcGi; spf=pass (imf01.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.241.58 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823848; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BWTFVCXImGkRj7gtzqeNh9WIkpR+V+P8qcpBbFbZapE=; b=k7TRoGPXjN8kLWS0RXs9ngRV4C3/8M4uAQKXb9DbcGt9yQBmPDWMK09vwU5fWyn354UVWC qY6AhCzVQ8hJJEneJ0erpj3x3m8Hb4zRDBJoBAniQR+D4TCrLg3FQqRjl3XjeGJ77zdB6k 8Qrd3l+fV592VPZ64EQN8lsjKTOYulo= 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=BWTFVCXImGkRj7gtzqeNh9WIkpR+V+P8qcpBbFbZapE=; b=GOi0JcGiXJh7pkYozJav+sDjJKCVdUJEiCqCOOc+EGDlyDWK4nL2ecHt5Fn2CvH15kb96+RTthXRkI3YZS3LjBLzfNwrTFjk6vpbVXed1aOZkiMTbYswwMzjDoqeLZOc4DOX3xVqBzje3/zM/wWX+rzRIvMvmWxDSkw/+JcDfVI= Received: from AM0PR03CA0036.eurprd03.prod.outlook.com (2603:10a6:208:14::49) by AM9PR08MB6225.eurprd08.prod.outlook.com (2603:10a6:20b:2de::6) 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:10:40 +0000 Received: from AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:14:cafe::97) by AM0PR03CA0036.outlook.office365.com (2603:10a6:208:14::49) 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:10:40 +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 AM7EUR03FT034.mail.protection.outlook.com (100.127.140.87) 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:10:39 +0000 Received: ("Tessian outbound 6d14f3380669:v211"); Wed, 27 Sep 2023 14:10:39 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5e59d962b51d9ebb X-CR-MTA-TID: 64aa7808 Received: from ae81cb80fa00.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AEAC1633-5CDF-4F8B-92E4-8512589A33E3.1; Wed, 27 Sep 2023 14:01:49 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ae81cb80fa00.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzdsMbQl+YHbGt7m+yuw7ZANQjpTJ29bLo+bTbe9y0MOIK+MQTOQAEoVP4sccbKjtxe6+j/umcJwRp687B8rRlaFbUiMpmEKZf7A/4yWBwEloQb7bAobyX91oBcz6bkzMXBDaPEFq0ne83iVPhOuvxGQS5h/+/fvyiQcNLebqt+JQbO/dVlUa6BeMMkSQOcWxKhAt8FJL67KhuKsAs6jBQIKPg5WMFh6/8RnYWs+6JczbfFZE8+yUGuW0qOekQlLbf6vQ5XAogRJZd0mu4w8+6KknNoLAhu3m7xftVCmbjTfWFZzcvarXPdwkNQsPMnXxrjVPqqe4LuTW2LN8y+6Mg== 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=BWTFVCXImGkRj7gtzqeNh9WIkpR+V+P8qcpBbFbZapE=; b=nIXSMknyaumRsoxMo0Uj/wUaM9OqhBgtqpYkaO6fsx8BhqMc3KkSSJ8uPhqkjYiDJXeo/bpA5xA9BXsIKpYuELDgY/BiOa1OlfeNbrbaxBKFyk9HA5QkzwRXc1lOl5PKAIvaEPXBXzRy5jkX1bladQTTYmvw4bUuPyq+GSg5W0jdVd1daJ0Z5yXwUnsDhE6uTq3LnR4fMA4sJu/m6cGKH/KgpaS52AAXr5krWQTkPfhOqyV5Q0wkgplbKKLNRjo6U020ODEU1S7Q0Zt66857rKocni7kGAPheP8Yyye7H/6IYYWVCSfsV3yD+rlT8dVlwK/W42Auws+21tfj5wxqNw== 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=BWTFVCXImGkRj7gtzqeNh9WIkpR+V+P8qcpBbFbZapE=; b=GOi0JcGiXJh7pkYozJav+sDjJKCVdUJEiCqCOOc+EGDlyDWK4nL2ecHt5Fn2CvH15kb96+RTthXRkI3YZS3LjBLzfNwrTFjk6vpbVXed1aOZkiMTbYswwMzjDoqeLZOc4DOX3xVqBzje3/zM/wWX+rzRIvMvmWxDSkw/+JcDfVI= Received: from AM7PR02CA0002.eurprd02.prod.outlook.com (2603:10a6:20b:100::12) by GV2PR08MB8511.eurprd08.prod.outlook.com (2603:10a6:150:b5::5) 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:01:45 +0000 Received: from AM7EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::19) by AM7PR02CA0002.outlook.office365.com (2603:10a6:20b:100::12) 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:01:44 +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:44 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:34 +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.27; Wed, 27 Sep 2023 14:01:34 +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:34 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 01/20] arm64/sysreg: add system register POR_EL{0,1} Date: Wed, 27 Sep 2023 15:01:04 +0100 Message-ID: <20230927140123.5283-2-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_|GV2PR08MB8511:EE_|AM7EUR03FT034:EE_|AM9PR08MB6225:EE_ X-MS-Office365-Filtering-Correlation-Id: 53cc5941-4f30-4af0-1a55-08dbbf638753 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: 9gI2NhjW5Hp7GcUzQxAjaOH9+Wx4tcl+ipq0APiqE01KBLZ7N81k79aca5pM3QP91TKno5LuVaJM808YlqOkdK81FCXn23Qm3RB0URDGquV/9PwraXBBAqMFQTfexpgtEoMFxHB5LhKvAK4agu4L1xthz41uiQ12OGLqz9BItZ7zAkYxNd8+ia/C/drSaapFxxipvB+ZsqAhFa3Ap5nT7zZq5BTTFhCrnPN+dzVn/w+RUNH3IlSeQadb5rXrmZlSVFXjmJ/UqGsoz/wtJp1GaaNucJX1G6nGVCb3WIb/RuhfC6tpc9LD9Cx4Ac64bgkmnRSU895pAaahMxOIXhbg0w7OuUsqjyFzoGKqGeiJLjOY71KN0GDlvvKub6ojKlZkxeX0Mcxhv81a09bLU62KwQbWgJbfw41s4sJcSVlGblk+e9VRWfhfbMIQad0jm1E/Wa5BGZk/Ek9jG1mIsKNXk+SGsV7A1kr4S0LkludlgfVhSVAWjKT2d9JzY/h6W8deZHPEc5Y8R222iyFp/BGxLn1L+t3aDPpGhA3Wu/oXaQocQaPVfM1Q5er6uga9bMJzn+OE1jrMuhIqH2B1GY7BfEpOh00FK8DDNEGheshAbj+DeFT0qQkyVxnHUq7yAWcXKnjeERWPVSBNSiGWXISm4Jhq3sGNx8U7iD/4Z791bpWRnLJYxPF2V42ZpF6Auqgu1irhpHDnqzJAXimvuvm9ykWWuo7PF1Mp6o9r95VLmdvA/NdwdD2qpXPMoe2ThbE1PV8MSIVTXgcpVpyRH33aRQ== 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)(376002)(39860400002)(396003)(346002)(136003)(230922051799003)(451199024)(186009)(82310400011)(1800799009)(36840700001)(40470700004)(46966006)(54906003)(316002)(70206006)(70586007)(6916009)(7416002)(40480700001)(8676002)(4326008)(41300700001)(8936002)(2906002)(44832011)(478600001)(40460700003)(26005)(6666004)(36860700001)(47076005)(5660300002)(7696005)(81166007)(426003)(2616005)(336012)(36756003)(1076003)(86362001)(82740400003)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8511 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 58e3647b-53b0-48b0-d2db-08dbbf62484d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EKur5gAAm8CcKgQRKAhYJLRoqIidX70IVfD2Yy/OfX3XomUAvNsMiAKPtDpaLtpkdCmLPTKQSmDPg+F2npM4XKqW6Re04/w/puDc2MyxbbzQjjwrW40+H9+8+36PZA9IZlGB8MCGXS+8zl8OFcLM2tBd07XGTb2srr1+tQTeMX82iSoc8G83A1BDMBdURKmujMclQ34zggcOueJ034ekng2wneMPEvU33X4JjO3XRSy6nSsowOsJSUbdHvHHOMfiQ4m3V6yz260n1n+yElifzlAuIF0G0RyRavDMJMqlDCcn9SZ2c6MVaS68pvIRYIpFtutmZuDl1bwUfkKYe57Wa60lsdZzPmN27wrkYCrGvm2CERfZNlV0nBzyWxyaFjtNYciDcTJCC8zV+81Rg0PLVTqPIaMPD4Sr5R1hDqn9s6GeFzdaRSjrqfMXVfkqi9D233zYKDE5MVxpEACL2kTgw/Aisn8NweZ37QWCNTynUKhvGS78Emuscffjh/1Lb6YtLeHG1gvSyppYH2CyDH4ukqH/NyODkXUbX/tjXj9YIU+x0Acxt0NAGYOHwuHtPuWRMLHl6vS4gscnOUt/egzgRUeRdG9e/Wcv7z6G39jUeLQbIPv6sOlXFQp5VdBpR1VQej1B9wkaWFt6oPF1Vk+oJkT/FjQsWkLsfi8aQAsFaO+JwMxLzZMit4M6za4xFf+mOiWeP9v7Z0B8vIYcF49pWxJzgvO4Ps4HvwdikljJRo0= 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)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(107886003)(1076003)(2616005)(426003)(336012)(26005)(7696005)(36860700001)(47076005)(86362001)(81166007)(82740400003)(36756003)(40480700001)(40460700003)(70586007)(70206006)(2906002)(44832011)(54906003)(316002)(41300700001)(6862004)(4326008)(8936002)(8676002)(5660300002)(6666004)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:10:39.5470 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 53cc5941-4f30-4af0-1a55-08dbbf638753 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: AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6225 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 8EF4940014 X-Stat-Signature: 4fo6rtqf3y8gpcodb1e37n3zteg3t41g X-Rspam-User: X-HE-Tag: 1695823848-402398 X-HE-Meta: U2FsdGVkX19uJt1UJaG+eIJtRND7mvQYZN6R/O/sES8azXA39oFNMTsSPpyXSJk3XCVEG00UBT3SCXDokj/513PuoBl6nZWB5FX1+pICwM5nBuQTjABXnSpLbBs/Ll6L0TN52m6GWxFKO+dy2dGEUt6KwDSw7UQrYMbTeyctD7s2FmTR/anZoDFnofD4+X0y1tXolg+ox4Mbl5rJH55EB23xdUX5S+8OoHCqcHjMmK5oPHA5VQt9EAnhmez3cwnqshud/vY9OXGH8lAgS2A7I4zwYmkX6MWpt0u7AgdVl+u9FygqkIvBkVEQM6ZZRP0ErD++LiD5SHydkDLUj6XJA4UBWIQMwNNdbbjhoD+NdH1z5yCml+aZUd13/oDbgYylRMGzQapfrrYNrurpMmDLKc/cA7c7SzQv+o57LKaduiI0pyiXKcoZChgQ5tN5cmbqtEV9j8IExeBpFtvi4y4G6weIBbHMCpyClTLGzcvlfqrMDnV5ZiY3W9K7u8iZwMvuoUyDf/S4lpphq2jO7zHLApzXtTh8v86KyGwq78edPq8FfoUmgz6zB+7dp29k3IbTPyjH6vWxt+hEXfnwrffssomCXI4bsnVPGiLLOsl58bJcRHy47sqHNp87IE6xpRR/1G7FEsK1MXWSz6xsr49at55xTIXDx9WNpVL1aBoUf7GUVcf2TzINTbZvFA5t1X8o9RgXI5mJHNNPZK8q6Gwno714R/0oCW1om3V+jgMqbpo+0K2J+qgwEiLqB1VWViSToYNRV36ToEmrNUMcvqGG3l9iG8A7ueNb+yNzUljvB09vt12CqEnbcI3zP7VMsvfRsTBBsqRYY7liAmUISaXAaKFhhghoOxitii+0Nc2HsF/RafGCLR71akLtCYIurC02szevRzJyRDiAZ4Aqw24pZpHagauLt1+C30n0za5sqn8y1wlNwr+ziArBbPUrFf0CABx4RpoeW+wjsI4roMz Wnn3y7ZO whzV6iyOhPRu6QnhKwGZRofd6V+PDVjHU5yyvnOJxxy9ni9+1rFgcvsGaUKBglyKoH5ZGxAsiqfIE9AsKotiPXTRNmw3mEwWjbZ1aa+XRGBUdztg1Ksgwa8Rdi7SL+yeUzKjm8+X6ymvHr1yBval7034HLQDs+D87SUrZ5xrSC85YDzVyiLQm/HuRihiTvIGImuANarFDX+rdgyvjSCtNc7Tb1P1i80WKgenyBj8j6St1oR6zw3iGf/1E40hI60M4EET227SbNYjxt1aG39fLJK273+KJ23oGK5azX+2OrDjqQslSg4+el44etRNJA1Jar0bXLL0El1Zx3YyCb5xb0rKU0r+TiitrySxDUWIPwHvLup/L9N7YOzZo6R7DCtlyep2Qwfjs8GOBi8C6fBUwXBwDMhwWr9N4QNkvJhstKEuZHmzro2JVuHwYMtITmSs9A3ENuGEm+I0ahJPMOZJWyw7ece1hPMFBn8r8a4HafuwZ1b+0wbxe/eahieoMNRUvbgS7+LbviS3B+mBOAqmMpxYGplWyjYmhfw09hkDNnY31YYZaX6OdxASHW9MpSbwiTVIbiiMfJLCCnCQ0p8SrwLWpJLrfSTJA6skRvpjdL5P17X4= 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: Add POR_EL{0,1} according to DDI0601 2023-03. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Mark Brown --- arch/arm64/include/asm/sysreg.h | 13 +++++++++++++ arch/arm64/tools/sysreg | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 38296579a4fd..cc2d61fd45c3 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -994,6 +994,19 @@ #define PIRx_ELx_PERM(idx, perm) ((perm) << ((idx) * 4)) +/* + * Permission Overlay Extension (POE) permission encodings. + */ +#define POE_NONE UL(0x0) +#define POE_R UL(0x1) +#define POE_X UL(0x2) +#define POE_RX UL(0x3) +#define POE_W UL(0x4) +#define POE_RW UL(0x5) +#define POE_XW UL(0x6) +#define POE_RXW UL(0x7) +#define POE_MASK UL(0xf) + #define ARM64_FEATURE_FIELD_BITS 4 /* Defined for compatibility only, do not add new users. */ diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 76ce150e7347..20f7dd25c221 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2504,6 +2504,14 @@ Sysreg PIR_EL2 3 4 10 2 3 Fields PIRx_ELx EndSysreg +Sysreg POR_EL0 3 3 10 2 4 +Fields PIRx_ELx +EndSysreg + +Sysreg POR_EL1 3 0 10 2 4 +Fields PIRx_ELx +EndSysreg + Sysreg LORSA_EL1 3 0 10 4 0 Res0 63:52 Field 51:16 SA From patchwork Wed Sep 27 14:01:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400923 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 DAB39E80AAC for ; Wed, 27 Sep 2023 14:14:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 793638D008A; Wed, 27 Sep 2023 10:14:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7442E8D0081; Wed, 27 Sep 2023 10:14:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BD418D008A; Wed, 27 Sep 2023 10:14:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 48E0A8D0081 for ; Wed, 27 Sep 2023 10:14:19 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id E88D0C0A00 for ; Wed, 27 Sep 2023 14:14:18 +0000 (UTC) X-FDA: 81282572196.12.6B4193F Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2063.outbound.protection.outlook.com [40.107.21.63]) by imf14.hostedemail.com (Postfix) with ESMTP id 083C9100020 for ; Wed, 27 Sep 2023 14:14:14 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=PcIZAMbv; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=PcIZAMbv; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.21.63 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695824055; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=0EZ1h56U3Pd2J5S/cTwJhPAkArNSg9poTD89fXTBttQ=; b=F+N8T6Rc+E24PDdtmmGYv8Pv80jCpeTYE4nJUL207qs3JmB9N7wP7k+ZqF66edh4DCEvat aDxQLwXqoU2zMpOB8G55c3aJiwUmzTb3TT2kIWuNyTscwxjRUAnb2KGKiKhQepW3a7jldp DQp+47PR4IOxt4wyZ5mK/M5Si+HAtdg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695824055; a=rsa-sha256; cv=pass; b=34LH/nUhINMv8SynrLFO8g9b+n9OQcI8jkUmDAdBv0sJPQImEkAOt6R3SagqTapct2k4F6 Kmyyj0TdwVk7NfiT0Bmmo4kNA6H7wP/RhDih7LaiLm3cFskkBmJtJSqc79+nDIam5tL3DI YMl6cEOiaKJ10Oh0lilRV0TPZQYO2E8= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=PcIZAMbv; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=PcIZAMbv; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.21.63 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com 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=0EZ1h56U3Pd2J5S/cTwJhPAkArNSg9poTD89fXTBttQ=; b=PcIZAMbv/1oaJ/Sd5k7DtzsuyaKfZSOb/zIbn9YdTlZlVrWDWgmllX/W10O3TnDXX2nVXDPm+kvppGmJFX4A2oW7rkvZPfkQBW874lgEoftFjsbFeNUryB1xm6U7Mw92DtGJLisp4QPDjEcR9PbbTo7JtK2u/66tsyR3vnMLm3U= Received: from AM7PR03CA0019.eurprd03.prod.outlook.com (2603:10a6:20b:130::29) by AM8PR08MB5764.eurprd08.prod.outlook.com (2603:10a6:20b:1d2::22) 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:14:06 +0000 Received: from AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:130:cafe::18) by AM7PR03CA0019.outlook.office365.com (2603:10a6:20b:130::29) 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:14:06 +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 AM7EUR03FT014.mail.protection.outlook.com (100.127.140.163) 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:14:06 +0000 Received: ("Tessian outbound fb5c0777b309:v211"); Wed, 27 Sep 2023 14:14:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5c7d011b31144c9b X-CR-MTA-TID: 64aa7808 Received: from 1f8463df0fb9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 09F6A995-E659-44B6-8F53-F4424E982B04.1; Wed, 27 Sep 2023 14:01:46 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1f8463df0fb9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bmN7cLEGyr+e0yUJADg3O5Pbth0v9izAYNNyxFNcjFgkHEX1mqu6t1+9HTjaj6j3Sc+7xHEHqMhVHAkvXI9BZ5UNKu4k6tVdk5rJiesR2KjQCMixPpi4VZwNsIu7ZGhOoDiONg+wZ2z4Jrd4p3m98cgKE5+gaClPJqFt0kitTS0P2VZuIJg9X8chxVAGQxRAP7cWF9TJM/Lode348dJ6hTid/wHxAo1fca5K5TSBuynrI4bhbIdk+k+hA6ouEov2ip+ShDYR/PgCnbXHtwUZRJKfjxvdX7HlmwMliVXjcgNpesC351acufnHFBW0nmTdX70WWoXfLtdoiwcWqjHH5A== 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=0EZ1h56U3Pd2J5S/cTwJhPAkArNSg9poTD89fXTBttQ=; b=AnGYt2ecbgLGevgkiQoUWvArpmcdiTWwA0wcbtXUJIcK+CDjgD9l6whxmJyHi6y4mpnCXgLL+74ytIPmiRS8ZrTwpUPelPtG3e56ekxIWF3uVjLTAivIFpvaUBgp/DuU7jgVK5Axc6yWSUQZpWjmUzJ+HQCgKdCZHRZ19LMQo42SLUUTFRwdUKjguXAxiWuLijny9uIKHG+yn0mfT4X6kWaHjHWaiShTvmSC9q+QZsvCCvRKyUWtuUwQoTxpF3hRmde1aPAehUFPJqITadK41fenB6JAIhflDmqUBVNFPCZE94C/LHH7lbuAgA5iZo/xiM0gxowrAcRZTyHblEkkiA== 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=0EZ1h56U3Pd2J5S/cTwJhPAkArNSg9poTD89fXTBttQ=; b=PcIZAMbv/1oaJ/Sd5k7DtzsuyaKfZSOb/zIbn9YdTlZlVrWDWgmllX/W10O3TnDXX2nVXDPm+kvppGmJFX4A2oW7rkvZPfkQBW874lgEoftFjsbFeNUryB1xm6U7Mw92DtGJLisp4QPDjEcR9PbbTo7JtK2u/66tsyR3vnMLm3U= Received: from AS9PR07CA0060.eurprd07.prod.outlook.com (2603:10a6:20b:46b::31) by AS2PR08MB8879.eurprd08.prod.outlook.com (2603:10a6:20b:5f6::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:01:44 +0000 Received: from AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46b:cafe::a9) by AS9PR07CA0060.outlook.office365.com (2603:10a6:20b:46b::31) 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:01:44 +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 AM7EUR03FT007.mail.protection.outlook.com (100.127.140.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:44 +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:35 +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:34 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 02/20] arm64/sysreg: update CPACR_EL1 register Date: Wed, 27 Sep 2023 15:01:05 +0100 Message-ID: <20230927140123.5283-3-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: AM7EUR03FT007:EE_|AS2PR08MB8879:EE_|AM7EUR03FT014:EE_|AM8PR08MB5764:EE_ X-MS-Office365-Filtering-Correlation-Id: ee742133-a588-4ea9-edcd-08dbbf64028d 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: I/ukxFs4CReOD/a+C3+XI40Euu4Ux3/cPdcq04dsaSlDpFXxyemJgCt/apV1XRlfNawwq/W5psNX3/DEIPDEYsb/fgMb6gLQ/8yXwJs2g7dllbaTIjvuMgMz2bX0dko84OKeCGumoEZBeAPcWfXBRHxALLtfrFUQfTP5iLUpgT0Gu3MkqHkzj/vXDKub7NaMp6O1Lqq4JXdu+n2hXs7Okf8OktL6x9KhMTIEV8ypQeH1AZkJ6Wi70YIvS+Hs0NYPmm6BcyHIQUWZXMZmU1WxL4rm+eudFZ2GM850DHPym2s/narlKSGLB+fIL+bkGaBlauuV0L17yxdITzWbKJv/zCW7o4SafkKVe+49ZwkWaFdNJyWANVuUeo5Dk6tlVynUW5UlGLaaNsYjaZB9R/8X4qNaq+gtxrQpXN2lwmNeFFeYZB0nyJIKOHtlLkSxRRW3zuRmD3HhmaKxQyW2KX/QA6Eirm8ruKgTs19a7tIVi9KTEjOzMDgUNEOuEjOARLYQfqE788dlCTH8beZOvYzwJ8RPBQXFtfDvA+xR/jdNIBhdd+cOhpiuqvOunmDwNkU7JgBCFvzS4ubnZ33SouP7fkJXiLwKZeTl4vSPcdoQJr/kMBd2dvrs5Dc6i7jL1vLya/BCckvfZhCAM5HFFH7Yph8+mnt2SP0f0GgODENDRIO8fZyH/L0fcRDLfHkYUFNrhZUz8EVg4u9+UjT2hBP5sZKUIGZyhAS5yqnWeu/aKwCXt3ZEL3lhoZb7Ke3o5yGCnXzYABx1LaBpt0PAgkRoFQ== 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)(346002)(396003)(136003)(39860400002)(376002)(230922051799003)(451199024)(82310400011)(186009)(1800799009)(46966006)(36840700001)(40470700004)(86362001)(36756003)(40480700001)(6666004)(5660300002)(26005)(54906003)(70586007)(426003)(2616005)(1076003)(70206006)(336012)(6916009)(478600001)(8936002)(44832011)(4326008)(41300700001)(7696005)(316002)(8676002)(2906002)(47076005)(40460700003)(82740400003)(356005)(81166007)(36860700001)(15650500001)(83380400001)(7416002)(4744005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8879 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3eab67e6-b0ce-41f4-6dc2-08dbbf624863 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ug2AK9xMGc6d1FxMU3YEdS3y4RJ1/S9dAI3K2Dfa/x+nCxJPCYZJEk2Ba07+KuD5znPfqB+T3Fg01qie6Iu85th1qmRvp7rnr1dGJrwL/URHBUWTkF9IqfznveiFGtolWdIQZqHOiNsYuXYjZzv16Xmw3Slbcz8Qm+hWTIWZqwYtVfadb53UkDDehP/zW4z48vAHUuuaEurFa656M6QLAAwH+63FPsDNnykhyNSUbisb5UD1RUGB4npmFqiWKNt4PHahoBNidCiEZnE2ELUDilgVpzh4HbPFGivl9NoTYlSfOtyJnl/JgsjKLspMoZNA4oPIXJM5YXdSK1HPY8oNDS2bNdGfvZA2PiCP2RmOFhFN1wp2MX2aindUf1Rr6oBmNw0VmUwuk9E8PgqBclZLXOt6CZP7SHJOpjIvHmsqhRUHLibVM+MJI89RU96VMS9UJdWHSYugvIdhCHYVALkZJ6Azl3oMFzU9V/RP/VUWlfQcyrLmxTpAOXmLp0IJ1SjJHsMbETU0xi3S+wRx4Qr8FNwaSYG+jOSSP1NH9dNvzWhKVGoHrBPlB1qj3RxKioYvA0HVCIgO2acuaIv7IFBRv+7NowAozDguJ3UErOaAEn9Kq9B38XxSGWW8TqHBD/wE8wmjSA9DNcKoOsyXXx7bREwRRhxSZqkpST5fLg8b2QwhG9RLc7sija7s6OegGmSS29SkRWE7pytg6hWZGUy8/rjapmJcjtjXepe4JymtneVrZOt8b0zTcHWq6R3l+8qL 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)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(82310400011)(1800799009)(451199024)(186009)(36840700001)(40470700004)(46966006)(86362001)(40460700003)(15650500001)(81166007)(5660300002)(41300700001)(44832011)(6862004)(8936002)(8676002)(4326008)(40480700001)(2906002)(4744005)(82740400003)(7696005)(6666004)(478600001)(47076005)(107886003)(83380400001)(1076003)(336012)(426003)(2616005)(26005)(36756003)(36860700001)(54906003)(70206006)(70586007)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:14:06.2922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee742133-a588-4ea9-edcd-08dbbf64028d 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: AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5764 X-Stat-Signature: wmfrmj6u7gnowpsr1dipbw34mujch3d4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 083C9100020 X-Rspam-User: X-HE-Tag: 1695824054-287791 X-HE-Meta: U2FsdGVkX18SDZDIokdRBRXbFxSH+Nh2+zfDXtIkJSKXgECE/Z3Do4FMhvj3tDeyF+5pEZ5faMRts1lDIfjuxtQMGyXnj/uJo/7gaWGWutvMwl7uQ/1E4WR7oXVzpZfkYPh93wd6aOsew+qEQN62GGTA1j3dNjdGQSuR+3Yp8Jus4ScY8JEz7DDKxfdi9GgZo7mR0Be4Df/T9SSYrxRMHQHsNgclBiZBCFsRH0jNAoRgNDFbc9XnjaJjy4W5TeSIA5f3I29LfD8xK5Pxni7L2gvMAgCvBjNoyg1GIsPU+xwI3OJu81WFfloFMy+wycHa81FOsNn9ybFCdAXLzyuOcc+MyoueiIusxCHJCKgZN9XuZHfSm/8jFVJG2OJ1C8dTqd3kWqaEy03yrY6oGeSafPgMQ53xcmn5olP0kYn10jt+S2u9FNrI2mhCmFLhT30BRjolvNBLj4wNE1+jBAPZlDANSXGUuEnEvTD3CRZU26vjehcHk87M5AlMW2E+0IZRie1X0MlbZUw0GIbFF9w4DDyB11qMJWdks18fnAS0AhiVyVynKVdOFkhYGphsYiyn7D6OSI/g4Vck33/uoBjtA88psnJgyEWK1rRXjC972IJ6GAytvAogNmwaKo4fNYbajayBUDde+uox9YJBun4L1iJBzZmkLg4nfLOYtnfnx2bg+rOp/mTw5Q827TaoTmlBZIRAkEYdjPDp21UreUCYh0EtLnNbQDEhj2Yg3zdT9ZDZBdZF65nSnBnomRjGcloPIGMwZsO2CuvcVAwKUlvThhyzQLYveBvm96B5HRq+mfI7pCu24kdnXoquMbKBD1aWRZqLTKrT+4yadJE6yYRf4seRhNe8FO6wbbupBnWK/0oDqQgS/nbWpIlXsbgDaL4fs7F5G14FdSFA4Kq5uA444qV7PQNCEf4Rv8EQtcm5ChwnRu5OIcQzGpwZpUwbW+Us8YMRW8HrO9q+gAFvds0 32L2LFWS 7fySY3QgybQQTLdMevHdhbf+i8AJbfctfCFTzHDRaBADXkyw6mFw6Xe3Y2McRVtE33nDJ8fle9RxzwdbVsh2b20dg8vMdKFj/Ajaz3rdYQF+YhE7H+hM0CMbqW833NWPnBr5Rmqf7ZyJVsZKqsrLKx0I+refYd3+SWgFLS789ozI8V/YEA17TM43T6Jel93rWOdK4SJaNX0z8wjXaXoDayFUMDrbnVf0v0SlbcL9ytFKqPXcIDhLi1Mn/S8tdKtsW8w0VKR9/PrC6VQgaJLO7Bm+Ft+iM5TeoE18tDp0q8WEGeXE8NUvGENIuu2yPcqT+vyLiTgCE7aQniX5K+l6iwL4zyWFQMWFYi03nFHmWy8aC6JiamwmeP2BdARK7Jj0+yDyJK6A32wRrzCSg0/m4BX9KOVUa+SfAkWX9zrPvMzOWyBB0n4hPQ2XamgsZePOc6pzHL1s9LDXjYcPKAEUUQHg/4a5N8OSQuAoXMTmr6p5fCC/5c0a3IOS+lHWxlVa5Zp26VfgTIM9A0+2895FiGUmSH40ha6fZ0X1QTNlY0keIc6KXCVMwVyRFy6kcALY/MwFw9vA/rWAM0K9L3cd5tOITU+xHMgzyQ81bAn/C8MA7r0U= 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: Add E0POE bit that traps accesses to POR_EL0 from EL0. Updated according to DDI0601 2023-03. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Mark Brown --- arch/arm64/tools/sysreg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 20f7dd25c221..a728176786cf 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1741,7 +1741,8 @@ Field 0 M EndSysreg SysregFields CPACR_ELx -Res0 63:29 +Res0 63:30 +Field 29 E0POE Field 28 TTA Res0 27:26 Field 25:24 SMEN From patchwork Wed Sep 27 14:01:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400866 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 63B61E80AAE for ; Wed, 27 Sep 2023 14:04:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE08A8D008C; Wed, 27 Sep 2023 10:04:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E8FE58D008A; Wed, 27 Sep 2023 10:04:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBD408D008C; Wed, 27 Sep 2023 10:04:33 -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 B71AF8D008A for ; Wed, 27 Sep 2023 10:04:33 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 87A001A0879 for ; Wed, 27 Sep 2023 14:04:33 +0000 (UTC) X-FDA: 81282547626.11.61ADC72 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2043.outbound.protection.outlook.com [40.107.8.43]) by imf08.hostedemail.com (Postfix) with ESMTP id B7F4E160118 for ; Wed, 27 Sep 2023 14:03:47 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=DuPWyC+u; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=DuPWyC+u; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.8.43 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823427; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=n2cZerk0+6PXu1NQWIxDK5yc5JLsqWJDlqir/wW190w=; b=stkArDWLG5ytnQZTNs8Lct9OC4aMirs0NhT71B2rDsJgavO4CFlO+x7B4/OlQHHobbNCGx CI93nBt4FESnfKHT/iQKQfwdxDjsHjBlUFTN9FBzRNJtB/jou9nLKamACsvq2YA3X5t0j4 UvCoVfc95sBxcbrYb+72AllgpnKQm6M= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=DuPWyC+u; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=DuPWyC+u; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.8.43 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823427; a=rsa-sha256; cv=pass; b=LAFq7zCy4J1gT4SebJl2+nVLAhBQy42D4lMilSFF8m8AKXVq90IAXaolzd3CNX/oMkuzdB WOi8ALZEzReoEObz8ZUoW1vQL5p4YOxx126K0HJ2czPlguxVWmGfaTdpJOHnnVfYraTFd3 LcckjeVk0X8PlQQzMU+7gEtsxBxb408= 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=n2cZerk0+6PXu1NQWIxDK5yc5JLsqWJDlqir/wW190w=; b=DuPWyC+ug+6tqqtcb8FyQi8GHmTo1s1UweQoatj3oAhKNBWGyl+ipcGO6RS36xEnKqZLicwMcwlZw0RK6Jfktmy758ICHgojuXA9C+qr45yfiG1CRGcujMlrtgdiqgMnYanhkjE0ZprJWcYHjKgdmaANTp8wokHTl6YOHyyjOjE= Received: from AS9P251CA0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:50f::22) by AS2PR08MB9450.eurprd08.prod.outlook.com (2603:10a6:20b:5ea::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.31; Wed, 27 Sep 2023 14:03:43 +0000 Received: from AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:50f:cafe::c3) by AS9P251CA0017.outlook.office365.com (2603:10a6:20b:50f::22) 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:43 +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 AM7EUR03FT017.mail.protection.outlook.com (100.127.140.184) 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:43 +0000 Received: ("Tessian outbound fdf44c93bd44:v211"); Wed, 27 Sep 2023 14:03:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 165230e19496bd7d X-CR-MTA-TID: 64aa7808 Received: from 5a43b32ff89b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0353F5BC-0A9D-49A8-802B-8FD8647BE74C.1; Wed, 27 Sep 2023 14:01:50 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5a43b32ff89b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lyMOyLxc3/M99D4ocLz7hhZsCLEte+wOfVYlu3KgNOJOFnAYxlMXICEGAb475HqzLKcj4KqzAohuL3PRxU2j0DZpVV4ms2e0MFTL2y7ReKBzOkYw7Xu3Gp7KxFrF03qiSxISk+K8YFbUr+lTs8PSIIzSUJL9YlgHVKfznqV15/iglRChgQalmvLvQ2o4TGholbgtmyt+qNoEfS52AjTehoAeXdkCYzXT1kecGhfRO3qmF8mIQyxEqMjSqtd5qCs5leoSrSpHeltBt56rd4PfrI3yQiJZoyx1uzyPuTyenRXb0OiSFlCAJvmhbNlzbpB+6bt39t21GIR9Ltaf65I2gQ== 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=n2cZerk0+6PXu1NQWIxDK5yc5JLsqWJDlqir/wW190w=; b=QzHdZCI2mHe54jBuhsei15S8FyEycsFLy72ODB/vb4lIc9aHQxkJLqW6TY0l3aO67XGkOc4f21thY2BPLqHE1QEnH14EzM7bDryokh5zWhuyet77uNa7Q2xN17Hhg2LFS9i/FK6P+7y23rrhxdZRRscz2MVgci1/NjPmhc4jiOQnQz+R1uXG+vPJV7I1H8t6z3QZZZQr7rrWnqHWoMsxL1zcVy1/lgiKS3UmPDz67xS0XlmfsDNfdX6/R/lOldXUxR7IY7Mx0cHkL0wh0SOJ9zc43gftQwTQ6VzmpQOjmMmW3FdOVt2GoRYF2quUXJUnaEwjnFI+6OMLRPN74g4OKg== 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=n2cZerk0+6PXu1NQWIxDK5yc5JLsqWJDlqir/wW190w=; b=DuPWyC+ug+6tqqtcb8FyQi8GHmTo1s1UweQoatj3oAhKNBWGyl+ipcGO6RS36xEnKqZLicwMcwlZw0RK6Jfktmy758ICHgojuXA9C+qr45yfiG1CRGcujMlrtgdiqgMnYanhkjE0ZprJWcYHjKgdmaANTp8wokHTl6YOHyyjOjE= Received: from AM0PR07CA0007.eurprd07.prod.outlook.com (2603:10a6:208:ac::20) by PAVPR08MB9064.eurprd08.prod.outlook.com (2603:10a6:102:2ff::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22; Wed, 27 Sep 2023 14:01:45 +0000 Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:ac:cafe::6) by AM0PR07CA0007.outlook.office365.com (2603:10a6:208:ac::20) 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:01:45 +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 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:45 +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:35 +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:35 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 03/20] arm64: cpufeature: add Permission Overlay Extension cpucap Date: Wed, 27 Sep 2023 15:01:06 +0100 Message-ID: <20230927140123.5283-4-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: AM7EUR03FT048:EE_|PAVPR08MB9064:EE_|AM7EUR03FT017:EE_|AS2PR08MB9450:EE_ X-MS-Office365-Filtering-Correlation-Id: e22bae68-0b61-4858-10dc-08dbbf628f5e 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: bcIwrLxeAPxfQ7Aryh5mE/7MMrmd+rDvgdNHXSsh7YFgpJNd3bcZdGkmaZfsP0kxDSr4a4kAXoQE/20slaL1r6ueTSPEf7cmbxwE7W0fynlLc+Hz11SK9TDwkpsWhH9WEbjYTSEVwM6dsYH52ENgFq930i3Ae0uYhEXSlisIWYCb7u+9p4RQrUzVHMl4x8sQ/mMHVosSnn4zihVJWqSunJgmj4PzfkVtZgntF8TJiZ2ZAmtQyUOwr0hT1IRg0cgZug8J/NvFMBSPiDPzFiWFhrNB6ViJX32RSRv5HL7JMp8YqD7uWnB0Xu3QTRcF5pKYHp22Ryzoe3899FCs+CMHDmkTErxY0cWBlsas9bPJZQClGRczRsVgRYSeJBVdzEFvaC5dcP5T8zW6+e11MdiOeNayTokU/ikvdppGtdYl4brCkxSJHBBOdoSsSXTQqdQQHnS237wL889Y6PPoq10+wEaeAJbayhAhIVkXY2q4s/6JB5vNunPnB21PqYO+t6+qk7iRKvRsX1T/zlkAvTbHt64xZFnAh7XaukwSPlU6OoAze9lsNLSHiO3LtXRyx3O3K1m4QVyDHGwxEhdVCJmedSrQ6TUeV87L1yPvJ1M0N8Cx21legOgqIHVkqmEHWracjVI17aqaNXnhg3YtkgHHKGxyj4GwyvZrLWNKqsRVTMtTHavCEYnGwm6OPAZIwT6w29TdXS91CJQViS9sa3BTZaQgPij7hAniF3izpzy+kr4V+Rxm3TmzD9/4l5wfPt1Z04bxOHa9yUIAco3fMromRA== 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)(136003)(39860400002)(346002)(396003)(376002)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(40470700004)(46966006)(36840700001)(40460700003)(2906002)(1076003)(7696005)(86362001)(36756003)(6666004)(2616005)(478600001)(426003)(336012)(26005)(40480700001)(47076005)(41300700001)(44832011)(36860700001)(8936002)(8676002)(4326008)(316002)(6916009)(54906003)(5660300002)(70586007)(70206006)(7416002)(81166007)(356005)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9064 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 94c6da0f-addd-45cb-c5f8-08dbbf6248b4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8SB4jaat4Uv9JRVNokOwzquu3pfTVPRwxHj3zwRrPIb+8WRhPm9BTZZUBUCujIbKDXesFTTzeMhmYVwkSf2/j5IUDRHlR7pTp0JzgnAzOp+1gj95acH11XTscRBjNJubdHcYW/Hl+258PgzBBdggddVZfCJfKLt2Aixi0jpsB4At83hojyP/EHgxasoFGGUCXLWrTtt1WmnkGWFhOAY/6ZWDGC5J4+FzPYdv2zd6ciqUifVEV+TRCo7/CEcYmg8oht7PaRP8nB79z1CpiYTyv7IvGp/pWUWm+wXhqhDbjdkq/3HC9gCNQkcq6BovZbu1NZWStnUrPcVSIPLN8xsGdOXoWOeB7q88mJrLN81bTfwCGvzBDECnagRhcH4CgWU6r9PnTqStRT4mhggrfcI/IC2Vu2m7oLfA1YJN+OV8eZbcZZlhuk8ylgBAoudXRImgVqlANQIp3TUcxUrAvkALLHRIEEVNMb5R8ln0eX1sVmh++3HVaN7ndTSxrNsaPHhrlbpAh/BZKv1tL061yvsmTQIPBstzrVi7tXkHumII59ddkgfGW6yAf03eowQOwDzBASUBpgwWj6uf4XR8/l32dXCxdvi/toX3P6uqecrGtn5c3epwZmAKHf5y/Fvff5LnGwTaBMYAVblVmE1qE3aEdsobiJub6KtyVsuwiawCqwawdLgLQfdmoP7Ycp6//qUBdDc0DvqF1xWUYskS+kI8r2JF+VNQq9yRUpIer4mRcJE= 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)(136003)(376002)(346002)(396003)(230922051799003)(82310400011)(1800799009)(186009)(451199024)(36840700001)(46966006)(40470700004)(1076003)(426003)(2616005)(44832011)(336012)(5660300002)(8936002)(107886003)(6862004)(26005)(8676002)(4326008)(7696005)(36860700001)(82740400003)(47076005)(6666004)(41300700001)(40480700001)(70586007)(316002)(478600001)(54906003)(70206006)(36756003)(86362001)(40460700003)(81166007)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:43.5126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e22bae68-0b61-4858-10dc-08dbbf628f5e 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: AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9450 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B7F4E160118 X-Stat-Signature: 9hgtzr7wn5osywxdnqesuuirn6ye9izo X-HE-Tag: 1695823427-58564 X-HE-Meta: U2FsdGVkX1+1YY4//mN0RuThpOnPQgfrLv/zN3AnK8xQUtYii61z6HNuKCzJ73ElZF9sOnVOO3QRJRomYu32NcTzM6DM14cNEeb06SHkw+xOjga8fECpRhYp/aPxuuDIiTvUUkIoQa3N1R00fwOdlKG63Wc8gFhRh0QmiBBYt8ddJJwDTv3FbmzpNSlAEI97E36xWSoEQHcP726udSzJ3vGG1lh0EzN4K0WZ+oxuDVZZGao7aqMpW5DcJ9O+HAYtQqH0c5PmZb/tUcJMP/VxOSujE7vrWnyodkEwFmnipz7pIsn2ogO6KDtCTms4Tedo0rHpoNSUun37EScr5Df8WibK/i6bfXWdwjnemYo1j1Sag49ZfHtQP7uWhyPqlW3zi0bPRylMMGfCB72DkDRefth437lKXRizjN2AgxROt9Tf13DLk12oApatCr/MbIYABkM8/JYFYlFR0GRWcDcxELyPYoC3jIKc56k5thpMHVzMIABkW+8n/MWo7esRkmVj9952+btdhZRBjTBy/Ed2MGFyVxcaaCFcJl39DDNkPgA3+mCgzxlT25gWD9K4ILB7kg5dL+B8GfOOnVpgKgMBTQivYRdKvAQ0zTzuN2neGzd/8r6TYnARUBAxTgP8BDqCCg/uoZpCjLAvvz0/B/WEvrpvnFrHxx5RCfbp9eVQiCJ+34+GdYLXV+dBQp9gfXrblsU9zSIHecY2cxZ4oPf70xQm6Uen+AqB+v22Y1ZxRUUnzNhVDYHtXnDEWRArTZ3r5fvc+qBLf8PkcyrllQebekVH/EAxk+By4IxAKT89ztlxGktLF7whNupXpUWOi7wwQoON5Efg3A6foScKqUhNFE7tBol2O1LXTLa/9NT+PzdkVbnR8R+kkslxUhX/zJypPEdCgPCNXeaHBtWWAk2r/ROaoCHVo8oI/RjMYU6uN8npPu6Apm77DoDJaqlZdVJWB/lOrwkXJpKLVK9gZoy CSwJpvA0 p1MicV0upsBuGNuOZ19ZDfWs/QweRAF+24tHKeu3M8JUP4tNiBrDOUmsR/U2jclYj15MtqYUelHGkj5TerEdemKAHCOBnyPUzO3TUJWFpQ1p/c3l08vUus2n0NNpZ+WHvILUau8hEqsRYAADrb7OvcCNEeWlElk5icjrG4Fwh5eXFeVxGJ5xmIXA0Y3ZRQGrE5HYQwhz9kBH/VVZJldsQqbfFDIgDZHSxkNUAfdOuI5IOKl2RyiHPBo52XzjkdsYkQ5EY8i+qRjxgOBmRH6kAxcmHLyHsz/AftQgxHqA+SsY82pOrBm4doKCY3Kh8UTRJibFLc/Mb12mM6rYYKi19WAMQ3DZhjaAHoPRVuYVSF0SVoY3/nme+9B+FuDiBDlxmieLhjhV3bPZXRUqXi+6gThZ9K+DACH7xQH+1mwGC3QYYHiKA3ZpxPizxveKIerd1POdxk6Hdmm+Qn4tRyAQjb9f+qbI2MNRNV7u6qohr7X+N4ucEE8QWzDzNsVrFFYhEwv3awrjBjW2ZUNrMwXQ8EiC0ZjKwVsyhCe14gWTgzbe526wZ2DjSF8Dj3lYplp1vhOxH 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: 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 --- arch/arm64/kernel/cpufeature.c | 7 +++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 444a73c2e638..902885f59396 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2719,6 +2719,13 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, ARM64_CPUID_FIELDS(ID_AA64MMFR2_EL1, EVT, IMP) }, + { + .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) + }, {}, }; diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index c3f06fdef609..b8348e40f6d9 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -43,6 +43,7 @@ HAS_NO_FPSIMD HAS_NO_HW_PREFETCH HAS_PAN HAS_S1PIE +HAS_S1POE HAS_RAS_EXTN HAS_RNG HAS_SB From patchwork Wed Sep 27 14:01:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400859 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 5278AE80AAC for ; Wed, 27 Sep 2023 14:03:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73ED08D007F; Wed, 27 Sep 2023 10:03:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EE498D007E; Wed, 27 Sep 2023 10:03:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CBA08D007F; Wed, 27 Sep 2023 10:03:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 378838D007E for ; Wed, 27 Sep 2023 10:03:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0D2BA1A095E for ; Wed, 27 Sep 2023 14:03:32 +0000 (UTC) X-FDA: 81282545064.19.67CDC1A Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2051.outbound.protection.outlook.com [40.107.22.51]) by imf29.hostedemail.com (Postfix) with ESMTP id C8624120072 for ; Wed, 27 Sep 2023 14:03:25 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6aQKWRsS; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6aQKWRsS; spf=pass (imf29.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.51 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823406; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IbrnELc79cTTyl8mSzRLYhNT8sC3fwyI3hxFhzA9Hnk=; b=XGwZSF1zUwxlKZitTVPDMT7wbmtqgH6uzUVYU1ie8u+e71pufgtBNCyI62MdXJy+KdZ28X LUauuGkGkGAdE4w5pSPHjjGrqCqHN60djJqIU80a7J8EPUPmuGlWXAFxVB3cC1SOIVCoIP L0x7EnwUqP0uhLFBpkMw9uYM+HGa1VA= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6aQKWRsS; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=6aQKWRsS; spf=pass (imf29.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.51 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823406; a=rsa-sha256; cv=pass; b=wjRH7yDEdiYhUGrxDtkpN+j9dtl3CvL2Hs6fojoCB/ZMUJW+7v89+us+RZ6alCv53TRlOx wXyb5iza+c4RdSLfoVAGxbOIgAbRxKQ/ix6j6YZYiDwY5kWp/cwwAAuu4zYiQk2PkwGIL9 CrofjxDfKgEW6CrY+T+L/XKyG57qDWM= 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=IbrnELc79cTTyl8mSzRLYhNT8sC3fwyI3hxFhzA9Hnk=; b=6aQKWRsScIzuVfSjKGLTQmcWu2faaUoQTjPYQnoXbjADikL3RRfMuCtb+7+bEueP7Ju1ZQtGr5SRzkccgiOSR9+Bf2u1lx6JgSiN/uTZRIFqaXr4PunhZVt2DkzaPS4Oul+p270vI7sifIr3KEq2zWvjKegATFFw03WmEkHmmyU= Received: from AS4P191CA0003.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::18) by DB9PR08MB9466.eurprd08.prod.outlook.com (2603:10a6:10:458::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Wed, 27 Sep 2023 14:03:19 +0000 Received: from AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:5d5:cafe::c0) by AS4P191CA0003.outlook.office365.com (2603:10a6:20b:5d5::18) 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:19 +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 AM7EUR03FT018.mail.protection.outlook.com (100.127.140.97) 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:19 +0000 Received: ("Tessian outbound 0ae75d4034ba:v211"); Wed, 27 Sep 2023 14:03:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2a9f62c7b57c88f0 X-CR-MTA-TID: 64aa7808 Received: from 6692e6f04f1b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DB31AE2E-8849-486B-AC68-2C7CE4026BC5.1; Wed, 27 Sep 2023 14:01:50 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6692e6f04f1b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjOUkYPs8AOGRxlPXGIkojfy6ug5wwNgWZ7T/YqxFk495Y6ggR9K7kHGCTZmGbIYW1HhGag/zVqoZq0g3CjSUq1kdjgxxuUXRtHwl8tK5F13WlwDSOowikbZxvj7qd9Wzf3XOZTTRIXxy8KfJ0MAat0yl7I6TOsDikW8CzoeW1GAmYLKd+wz200VToV3B2X1/eDZOIZl4LIzugX6Kc/1XfQmBP+faz3odddFz+kmLYuJolD3f/FFJVE8f4fu0PaHrdkRhPpMiY6+HYqR4K/kWMSWxzwZklBN4zDroYNPI2z6jXcU1tOz4WUeMgsFg8/AWpWKmIeyIEIe5deAWjEJgA== 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=IbrnELc79cTTyl8mSzRLYhNT8sC3fwyI3hxFhzA9Hnk=; b=E9UO6GBxo/Q2pCRIolUhyA5uFDcO/sp9tb6gOD4AT9kLw8ULTWIH/CL8zKOLa4eSA2jpZ8yuHy/LrvBjuer6tsCkedtjF+hsHvkKKk1JPzulzhJ/N8aHeXR4zF6ay/mv9FnkMaQegRB9VuK2T2XRM7qUdyZwP/sP5gvHDbamJRdMA/OtjupZ1bSo3lvHU3CJrC7vFObzadwn7GqKZMAGMVZaaLQYz/Lhas2Xv/qUchyPFNX0g2xZTCjBlkfFgRz+wZ54LA+gCqyyzRD9Ic4oD/DZC2G1u9WqOQy/r5XMwSqh563oWY4/9fOOCGHctAs8iU0gnzZG4Sn5ux7A5o7XOQ== 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=IbrnELc79cTTyl8mSzRLYhNT8sC3fwyI3hxFhzA9Hnk=; b=6aQKWRsScIzuVfSjKGLTQmcWu2faaUoQTjPYQnoXbjADikL3RRfMuCtb+7+bEueP7Ju1ZQtGr5SRzkccgiOSR9+Bf2u1lx6JgSiN/uTZRIFqaXr4PunhZVt2DkzaPS4Oul+p270vI7sifIr3KEq2zWvjKegATFFw03WmEkHmmyU= Received: from AM0PR07CA0006.eurprd07.prod.outlook.com (2603:10a6:208:ac::19) by DB4PR08MB8053.eurprd08.prod.outlook.com (2603:10a6:10:38a::17) 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:01:45 +0000 Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:ac:cafe::6) by AM0PR07CA0006.outlook.office365.com (2603:10a6:208:ac::19) 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:01:45 +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 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:45 +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:36 +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:35 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 04/20] arm64: disable trapping of POR_EL0 to EL2 Date: Wed, 27 Sep 2023 15:01:07 +0100 Message-ID: <20230927140123.5283-5-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: AM7EUR03FT048:EE_|DB4PR08MB8053:EE_|AM7EUR03FT018:EE_|DB9PR08MB9466:EE_ X-MS-Office365-Filtering-Correlation-Id: 477fe9b2-5abd-4135-92ba-08dbbf628109 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: 114EbaRsOdDyRGPQNFCG/BIeVUDVOS+O42HUP9oLsTBUuJDfcdQTBiLyYE1fJ3wgMZgX7bsroDT1G7hEmf9SMxRWpD7yEEqGNzn+Ewa/69Vzd2/konOZdPO9ACP8oOhHfnz7YeNdkiS1XysRzCzdke2Tz33qy3cJyGMoZ0Guh7hOH03xseSFGb50yGHouyKJeZC2ibeG7UsFQrsiD8HE8m/Dkz+ymwG4R2cpLo3pXR4nregWDR0mk+Wmy42w3QUQAczyyHeFOs5y6CMowJLX6259JBIIBZMEWQBRCgaSYfbSree1z5gx4DsnQUuO0euNMupU0l0Fgf5O/QA8TyBd0sw5nhY8T6YJrygldatlziDb4rej0/tPMJo6L5nMOEAhBf48iue30OOu85kb9Ro1DnSODjxoJj4Etqsex6S6mEJguyChZ/at39mJfO7Tfj0ZS364USnhotImCHmsEKbuI2h+K4a3JuEsjs+AiedeJyI4r68HeJlIyveoQ5KrjZFyLwwkrDpUNZwDbuydWp0M6xUpW+9VFq+Tyw1wcG7nu/Ng1tTbeMzo9/vopxnjiU9L53fMZDq1Czc7cB4bKCoALsGZT89p6b9rMczn0IUCP+TLtiqZMsnx1RWzHOz6jStoEH5UA+uQxrs18F6bfam8QxM5tKTlLzMaRV8bJ2wccJwSXZ/V6JGsNoysCgZn9+wldRTMBasPdmrU6EaMDX5zuZb54DpNlUThMtPgkzvwU8wXFsoo2XOhgsP579bVcCJQ 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)(346002)(39860400002)(376002)(136003)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(36840700001)(46966006)(70206006)(40480700001)(54906003)(6916009)(70586007)(2906002)(316002)(7416002)(4326008)(41300700001)(19627235002)(44832011)(8676002)(8936002)(478600001)(1076003)(6666004)(36860700001)(5660300002)(47076005)(7696005)(83380400001)(426003)(356005)(86362001)(336012)(36756003)(2616005)(26005)(82740400003)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB8053 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c359938e-8340-4828-5fa0-08dbbf6248f0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/nQFrlX0mFoV0O3BRVwl4A7foVHuINQgem0y1Brh1irn5aCAPdRupjSpz3TU2U/FLDTjwKRARTs68R44F6v4sL+OwV7N2OOlgMGzkW9Z2VKwK1CbuYoLqCl2YwLn6QFAQHpnfmae0J0ttAykEkQD+SX+bB7sla1jVxmLdz0xuj8NhXYu104iRspNPzx3MfIQBTz+CFmD6nBz6uzqLf6bAjXZY+pOxLrZOIq85d5tBS3VjQz4G8AjE0kDrRZyTam901bsA4wEeHg79jheUk2KKAsLW/8bee0OAIDIABNflA+rJpLVtRrEfP1MjSsOm2I/P2p5oE8ijf9c2O2rcqaBNbXrqrF3XSeRJjeHcU2AN5Rx0Gn7HWxcu1slh5w3upk8ItbEdCjl9RBLk3A+aCTlUuVRjRtyVrOdZzDEGGfkrU54Q/JcHJwqL/8nn79Gv27lm5AZQeMjOsPw4Xz+3s6O8bhRHq0Pn1GOl4cU7Pe7a7JXrwnB3vjiab9yh26lZA2bAKgE9HI8m/Kr0x7gVk1CQcWfd07mAa6tvhJNEcEqwV9ZzvYbCKapOAx5ewYnRaAlqdroIwPtN+qF4PHdAopcneMxsaQSXQitpaqghd0AR4K0FjqwVR0bmiW1OKBAStW9mkuf1zJSw7gRE5ioPAKeLaSwR2NiKwZ/1oCNoWFPTGXzwdw9jqR3lmRfU/vs2JznKDTLLOs48+rFy4cyUY/muWC/rrQAt76cPnWLLrioKf4Hs+eObh/KC5pZ58k+VyE 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)(136003)(39860400002)(396003)(376002)(346002)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(36840700001)(46966006)(40470700004)(40460700003)(54906003)(36860700001)(44832011)(7696005)(82740400003)(8676002)(70586007)(6862004)(19627235002)(478600001)(83380400001)(107886003)(2616005)(6666004)(4326008)(2906002)(316002)(81166007)(26005)(70206006)(426003)(1076003)(336012)(47076005)(86362001)(8936002)(41300700001)(5660300002)(36756003)(40480700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:19.5020 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 477fe9b2-5abd-4135-92ba-08dbbf628109 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: AM7EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9466 X-Rspamd-Queue-Id: C8624120072 X-Rspam-User: X-Stat-Signature: p8fdt5o867eah9aotr1rts8ed9bba6g4 X-Rspamd-Server: rspam01 X-HE-Tag: 1695823405-11426 X-HE-Meta: U2FsdGVkX187J877VYYo/mwhruJPEPka3Sw3B+FOCfMfV8kRy3Z3BkkyudGjZPfm/bdm9ChiYJ/KApq80hvYOSVsf1fynVcNIPp/Za/Oim5Kc30SpWKg3vIxxeKX8RSzGlOyfDXgODwSnWNBjKPrbmpNIXiUMpWXHKuZqYUz0McXA4SM0Ge8pn0A5uBv+kQodD7CUYYomvP/Da97oJoOVxDco9V4QtxZ9iYEwUAM7DsxM3XP9wEBaUPgNgZOpSH/jpmHWkfowTxeWaU2+6StiHaYK6cMfqNcMkoVYA8iYPQEV+yFtDPJAldAYHXRpQSU5T8/7eJePwDnygmAqcNT3pRvLtcvMq1wZ71HuVkz7Tr4+fXa2sJo306KvyDUiAkvVMZlxa5/laDsR9wzIS3UHNq9wMYfgtRx/WxSoV9wIy8uG3/IqGwUxcqhL8LdEzH54DfedpdcTkiYQf08gnAp0ulqRLa+JAgzSz3Eww2Ps1w8FJoJuzmkCz4KCAJumGnrghRSu20kyV8FJAj0Ew1g6Y51c8aKPfyd1pMTbw9T6Oxyv77gBdWoIbGZJfX+4QxbXSW6QssSbPD4JzojsNe+mH7njFqBAXdG2bPsoU0YAeKhsQoM4OFftopAqIPIB1f58E053TqcqXvRoUZ6evxBgVpavPp1KrHiQoFDQKuSenyJ87/fD8erXoRP9cYDzdkI1Obt9TpYS1uc+y5PN3Qpyd4mljnaxkCc6i+MNQAgyxEwDojpq14E2lXQf+paQkq6mjMhq/OqinNAHLLT2PsnY40ph1xnRWWbecOoKJavsZ69LLFl4s8bZEi/woveInGtM8vFoykR4U0EU6svGQr1ecqgtiwNOpb+71ZqHEAsfOzjqR6EgQ9hAdrQZLaSZnwrmHL10U+reZ42oy9SNOzkQ7EpANTcWVlbKH5k70nW+PEF4H/0YIFRiDOgU8LnsN438A0g/uk9SAwtChaPkfx JWVRQnIX Ly/ABMnzNod09aPgOJOwsFYly8iYJJiZzxFNF2FpaH2B3w67jblk7S3kuxfBWb/Da3KLhwcpvr3ivi9splDADd25UvNCSKkJEy7b8NP+invRdaqyOJz50nn3dTwRtXh4HloUiTJlFyPjqYT/A7t2uBZNCuASxajlwkj57L8IA6Uhx01FZK1PYigHMDoLFiXnkdZsNsVzyVAAXycRvdXs8D2ep6bOeUM8HDUmJK8y5IY7at6B7xGEojdYdxG4IU0C/KJTaweux/gKzZsU3jIe23bZYhomKdE/qvYmO8rEDEY0a6JihWUcuvr1O/4Lcl7j+TXtwhlNipEcdMZwzB3rrZES9jb6YfRoREa1K0ShTHXrjqWIUdiMzLKnPwRYVsagp/lnxXQNRMPugpGt4H3a1vAZtZmJ0zH28ngilabx3rx91ctzVYLIJWdYurJ1xW048Xl1twHVrZehVLiwyHe4dZbPtDxgpCbqUSTORg7YiWBfkeiUFFu9PvEef6kvO3QCT31HAGRJ4O2HII0v4KArS59gpL/GSExSIxq4Ft1cN1ROtSmEy3SdtH42Tx0ig3EuhwWTQC2crrarv4u57g83XSRn9gkT9zmLMHmSFDIHO9pNrg9g= 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: Allow EL0 or EL1 to access POR_EL0 without being trapped to EL2. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/el2_setup.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h index b7afaa026842..df5614be4b70 100644 --- a/arch/arm64/include/asm/el2_setup.h +++ b/arch/arm64/include/asm/el2_setup.h @@ -184,12 +184,20 @@ .Lset_pie_fgt_\@: mrs_s x1, SYS_ID_AA64MMFR3_EL1 ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4 - cbz x1, .Lset_fgt_\@ + cbz x1, .Lset_poe_fgt_\@ /* Disable trapping of PIR_EL1 / PIRE0_EL1 */ orr x0, x0, #HFGxTR_EL2_nPIR_EL1 orr x0, x0, #HFGxTR_EL2_nPIRE0_EL1 +.Lset_poe_fgt_\@: + mrs_s x1, SYS_ID_AA64MMFR3_EL1 + ubfx x1, x1, #ID_AA64MMFR3_EL1_S1POE_SHIFT, #4 + cbz x1, .Lset_fgt_\@ + + /* Disable trapping of POR_EL0 */ + orr x0, x0, #HFGxTR_EL2_nPOR_EL0 + .Lset_fgt_\@: msr_s SYS_HFGRTR_EL2, x0 msr_s SYS_HFGWTR_EL2, x0 From patchwork Wed Sep 27 14:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400919 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 06839E80AAD for ; Wed, 27 Sep 2023 14:09:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98C0D8D0082; Wed, 27 Sep 2023 10:09:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 917058D007D; Wed, 27 Sep 2023 10:09:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 767558D0082; Wed, 27 Sep 2023 10:09:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 64DC78D007D for ; Wed, 27 Sep 2023 10:09:36 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 397288025D for ; Wed, 27 Sep 2023 14:09:36 +0000 (UTC) X-FDA: 81282560352.06.3D6F306 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2079.outbound.protection.outlook.com [40.107.7.79]) by imf10.hostedemail.com (Postfix) with ESMTP id E60C1C002F for ; Wed, 27 Sep 2023 14:09:31 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I4OShfGT; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I4OShfGT; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf10.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.7.79 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823772; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sTujE6C4o9fP3xJ3TBrlqjM0PbAdtvHNtHcbgQKobec=; b=cDYxbPtRjCVjgUWMXCgxs3VJw8n/vxvTwpuEmGvalf8yGGV1vjQf5RhgeHUKrbUp6mL46M hxWMt1+O1cj84pALSTFJ4Cq5qjgFg9SgZnOUuJinceG69lMhFjVNi2qLb+RCNZZoISwSt2 tVyCvZZSw2WmIqksgj96KTeeoG4d9tI= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I4OShfGT; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I4OShfGT; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf10.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.7.79 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823772; a=rsa-sha256; cv=pass; b=OhHpP9I6BRYzSQer8JpwrBoFLkraNUQxqLtCiLO1vqFPGrT9W8ijAmxsoM+UXpqJV07e7F KxN5+npnvFw6Zf2jLvql/nAkQIB4WjqTuYrc5AmcM60eJaAqV0obAI9KPKNRxESwBuw7wG ZkRorWBoccLcYUChqebcXk3n2lab7sY= 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=sTujE6C4o9fP3xJ3TBrlqjM0PbAdtvHNtHcbgQKobec=; b=I4OShfGTjYEhuIIeUH7XOVnlRvMTsACqRxV/ODYoDPY28UIpgKtvQ/MJss3Sl2VWyjD4GKTsz5CJaMwViDtEoU4iTx+Jc8y0XXNWvmnrwTSEk/1KCTo+Geih6MYCyDgXphU0bM69aZ3zxbofpyMPT47MGC0wdvnIslaJUmRcXmM= Received: from DUZPR01CA0167.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::8) by AM8PR08MB6483.eurprd08.prod.outlook.com (2603:10a6:20b:315::6) 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:09:22 +0000 Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::35) by DUZPR01CA0167.outlook.office365.com (2603:10a6:10:4b3::8) 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:09:21 +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 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) 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:09:21 +0000 Received: ("Tessian outbound fdf44c93bd44:v211"); Wed, 27 Sep 2023 14:09:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5194c23cd01585db X-CR-MTA-TID: 64aa7808 Received: from 76efac2a2930.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E0103E0C-B819-4DFB-A3EF-E6E3CBA8C1E1.1; Wed, 27 Sep 2023 14:01:49 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 76efac2a2930.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jFy1futKXqxz/S8Vg45hRUNQYgYCWa7DtG18WDbTyhCasylGq0vNqpjUB/5BaKw4StGlGqjeOy6WGqf/cOeaUcAzO8hLMgd9B88S46DZ7baK5iL9HeiYJ1XJu9D3BA+q8Gl6qdYMJB8JwY5jyq7myUt2QZJr0nlUenwekCy/qUwStOM7pPiG4AurTKTSrrbhLO510d1N7i36tKcAcj03OTNzwJ+8nEe4+IReONh6TumtqXMQuQZSHe/TpYYNhHEOvIQ7IFG3Uzr4qCCDL837+CvQCrGSkVV60sMzDQFTUY7K+g42jBDz0gMf8rJx/U4qnwr2tp+YC2XDlDfNc/rcpg== 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=sTujE6C4o9fP3xJ3TBrlqjM0PbAdtvHNtHcbgQKobec=; b=YAEFnByvEGmdQ9wWoj7OCFXkcko3WAYc0NXuQwFNJ7epWZ/tkhHucNgxjZAIOYGubRFRqmZm6tL+pXX+zajZdQ3SMB9NX0+GKfVeM97Mhpm879S015ts5jv3Y8pxDiDBI7IWf8vB0QZdMAhmu/ZeL4B+dwjW0xG596XBGz3+2ZI1cNPEBB+foP0t1N6kHBO807wpUDXhgsrWeXmiGJ2hZoL+fgcAQlom0rtCgvI9CsIbxTLJOuUQE/oG3Kk/yzvVKMQHk+BNlQ9txao6XT0CbdQ5CATDDCOlkrKtf58BLMY/DBSyn02v8qIU2dI4b4GdjiujvltfFqBNgEbfBILshw== 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=sTujE6C4o9fP3xJ3TBrlqjM0PbAdtvHNtHcbgQKobec=; b=I4OShfGTjYEhuIIeUH7XOVnlRvMTsACqRxV/ODYoDPY28UIpgKtvQ/MJss3Sl2VWyjD4GKTsz5CJaMwViDtEoU4iTx+Jc8y0XXNWvmnrwTSEk/1KCTo+Geih6MYCyDgXphU0bM69aZ3zxbofpyMPT47MGC0wdvnIslaJUmRcXmM= Received: from AS9PR07CA0050.eurprd07.prod.outlook.com (2603:10a6:20b:46b::8) by PAXPR08MB6509.eurprd08.prod.outlook.com (2603:10a6:102:12e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.33; Wed, 27 Sep 2023 14:01:46 +0000 Received: from AM7EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46b:cafe::2) by AS9PR07CA0050.outlook.office365.com (2603:10a6:20b:46b::8) 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:01:45 +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 AM7EUR03FT007.mail.protection.outlook.com (100.127.140.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:45 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:37 +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.27; Wed, 27 Sep 2023 14:01:36 +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:36 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 05/20] arm64: context switch POR_EL0 register Date: Wed, 27 Sep 2023 15:01:08 +0100 Message-ID: <20230927140123.5283-6-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: AM7EUR03FT007:EE_|PAXPR08MB6509:EE_|DBAEUR03FT008:EE_|AM8PR08MB6483:EE_ X-MS-Office365-Filtering-Correlation-Id: a0c2931d-7e3d-4249-42fc-08dbbf63589b 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: kDcq2hUktXztxGEKJqlbLMdAt+6vkr+0IH1NXK5/eTeOohFtmudmma609vrOf5Fx3I1S51cTxk5FCqtIh9azBDziZTb48ZRnBAQNgu4vwf9NoDgt5j7G0AEon1KyK6MUCvaYvnFqKfXsywwFqvnYea0snQ2PBnm6LmEbGQssv82R+4K6jsy7sXJYPdM9qcy3+NjwjTNHfRqs/U9M1GXY2M4rOuIK0LH+E6T1tQVBlEPH7gLVD7K7wVvNx4oRxGXmyY0h1yV4Xw2db66KzvuwW/94P0KZsanmfCXGabU2C08oonTz3eQjCSl95+DBY+GBAnCKXbpFI0oO3ovyTjNk37Loz3zS+xkUMciXuFnvMYlxxshsElB0K7yPn9onKhlaHfk2UgLlG1qhtI2oacohhjYKkLkT/x8kTmoq32RFaNcbv4TnoxAt/X583p8pfwizkU9bjuAUsO0iBwwXYpO7gx4/Tpr9dOG5GbI5zQjgsnJp6qUgcPq0OY619iI7Sw8Ly/iYj55yI5j89JKnckzpBf0jVFOEWcG8+EmE7NkVhcOo3Uzax20Ja7GoGUaAiG4zeV693H/guByWo6FbwyGN6ngDeS7L8BEKAE8MaiTzUYdb0GHkiWkU/zG6qsAJ4K+ws206ANXwGv8lFqFLOhEQG9KecrUIWi2B5C5xAC5MKmRIWIpH49H5pzyYmLf3ujCc7y2AaIMQb1ikDJ0FdoXqt50C1F4IoDpBjcqSTIyycUJN2WVDJGQO0YAr3Ap/0/KalY4gHbBLW8wXRhrFqbYpXg== 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)(39860400002)(376002)(346002)(136003)(396003)(230922051799003)(82310400011)(1800799009)(451199024)(186009)(46966006)(36840700001)(40470700004)(2616005)(82740400003)(44832011)(47076005)(356005)(7696005)(5660300002)(81166007)(6666004)(26005)(41300700001)(36756003)(7416002)(478600001)(70206006)(70586007)(36860700001)(86362001)(2906002)(83380400001)(1076003)(6916009)(316002)(40460700003)(426003)(336012)(8936002)(40480700001)(54906003)(8676002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6509 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 621c8472-b200-4e10-387b-08dbbf624935 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xMf/5G6BIdGf/iJCnEt2NdJfjy75Ofz7Hff0gf/F4u2EGVUUm/zr/UcDtrGw8aBYKQrSO0BxvYrObYUV3YJayUHlW5n0c4kG2Co/FoUARF5/sNCqz/uipnhtAwLgaQJPv0IMVwKzyLgJLh4H5EP9GOhVUpVg5cOnjL5IwCita3O2uRc2D9mlp2CnYe4Wm+lXoZaMCkYhXj+CEicR2G8PhYOIcCkFXz8tHtf42W+BmuLC4Qo89P0MeMGWG0poCK/V1PnhaYlzKlTWvvMGwlwsY3izblcMZCVQ6Cs7VBVS8hq+hSOX839NDHELqgCv7LeP67WGVMyM+2cts9HYdJSlP1x4MMd1S5NKtxhSIkExLw/jLU/jIIC3g0SvfCK44FGfInrlmHjcpMaFO3fT1QDO5/lEkFID/m/tbJGXBFNqwSiwnaQjDS6LyW74jGzhR4GnopmY8tTWqvh2yg5yXsStY9YTEhSqync2fy0iw99J7heb3sGV1lWKvN6yee3QcLuB3xN60u35fszWO4CzDiW3fQp3tsIHIYcFSGeaUpLipiuBxrTw5geG6d72ZW1Y0z4fnxA5ycgQH38MgcPkqCBcyVOn7yg9nIFF+up1OAFxVR4EViSLRNUPjS+Jh0mZSWqZVhcqYVwi09Gn6J7tzk2S/cuKzwdKja7kxfQwdGIBWtOqwIokSHJfkGnMDegi5hksvNaOkOCq0JFzV6/inQe9QHcrwGGny77ujhkycqjY8LxIEL5qbscuqHx2gVSb9IRm 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)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(107886003)(1076003)(2616005)(426003)(336012)(26005)(7696005)(36860700001)(47076005)(86362001)(81166007)(82740400003)(36756003)(40480700001)(40460700003)(83380400001)(70586007)(70206006)(2906002)(44832011)(54906003)(316002)(41300700001)(6862004)(4326008)(8936002)(8676002)(5660300002)(6666004)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:09:21.1826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0c2931d-7e3d-4249-42fc-08dbbf63589b 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: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6483 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: E60C1C002F X-Stat-Signature: 77qc7s7cothf3hck67nig8c4rqwwbax9 X-Rspam-User: X-HE-Tag: 1695823771-708023 X-HE-Meta: U2FsdGVkX18xTAAehKmRtWa2iEtxZ2/mXzFcbseEwOUYhavc3KdSUdszpbkek0ExNh145yIRhaJrFPaA12eM6ach0msp6V1l0+0xw5GbM+sCWPvhkc6DxqoyLfQTRh/Gu46zQTeC/+fE0njwTotVz41yXUnCKE6yN5RSGO3uduqfyRz7UAMbp6dAkHG7Hi4aKbLA5ZAdK9e34g+tsRS1Lv6mxGbL8D9riidfIlpmLhbl3IgUf1RPkZ97sZge3IKq4gzQMpz6FuVLrLCa1miqDVvMEJ9Lyeh1nsA7FFkncHiZbeiE6pE+86Rl7GNkvlpaZz9XQ8SgjmUQcWYYXvGEZl9dpE5+9nwUXL8ZKgpuF1XG/747CyBxE/+K9348hInqT99q9+b/qnQyHuvgi4HwKBjlKS48pOoS6sDoNFZOiaGk5PU5HX9qPRYtveTcbkkYEI0TOMw7QmltfS0NZYuxXPQne/y4Zb7Z0BOi6BL0cvw6dsdC/5VmTj08g5JvdonGQcEbJVLCQ8ZfTKmIu5MZqHeoF5/T5wIsg64Iia/srQ2G9isVTWIFaDihrM2XL52hMKNlPN0wIdTMibcDTJO3Zf23PES2IgAfurgS5mfuWl+tpNRxkHUzl6RYG+q2ll2xo7+rqTVCQG7IrIeN1fW75gijjmqG52jeGuVOo7A3DJzcHIr/0B3zCsveHEO+wANfReUsl3Q178uSY3R85Gwi0NFE73BBK1SF9rtvaG87tcyBukRxu8kFuR2agc9ZiZ7Xzvx0ytXkU9X/1qPDFNoV6ekcaQljE9viTYaMifKY9kMaLSP5AiANQDnApio7ooa658ryM4wN6NRvtsTGVBNE4vmVQ7Pa9F5LqEiC+B3g6fl5eBae0lI7/rWkaEKxPzKC75dh9x4Misy4QSYqg8wXWWqlQyVwckFa/hU+Fw49bqDP/5vWLbp/qlQzWa/exeBtDLl2HJo1m1JH89+0PNq F929TXmV 79e7niZVUUVPgAThCoOy1BwGVw3r7h1QqamAcC+l6uO/DvvzmFTOrqZvE0ltLh2XNFePa0glZsNrpxYXEl3D4P2nrAWOe/YGAKcG5Ob0nhevVI1MMikE6U79cVnWNFDEv9VtZImVWD+lgSj+1hycOfUkiIhYaQ3lJ4is9OzZ915EypOGUA9F9xgIDRiIae/INJmLW/do83Sjk+8ax30IVcppRqKAGz+8Y32UOUTC9qswbl9I229ExYyDg0HmZbj7BRqmddGCyVorlyaVlgMR14Tbxfihw/wxDbEzeq2w8wkrKdIhvk4oKL0B3B34JdZrBC1HAzFe2S17Z7/gdyiR0etB2kgAU1QvKAY3SNIdbgXgur5XX4+c2kXanjPabw5jCpCOI9uhOnpqqDiGrFABBQCMikBjcFIMBuL83SR0vwIldnPipEzRyAB4oCfQ6i4hRIm014VjPmO3sBclctobXhMINy/QnIQ8wee0xw0nHBckFphcdWX7EKlPM3qlwSTB0g9f2V74AIR13QmOx1Wab6kxIEJOAcu53c4Rp8lcqkxKZa1e7+k9KdrhAzj066TNerWWJqNJ29csFg1hqi0rnogw/V5yZE3NPXgyyrVcaffO99h1h5TcZM9nDBQ== 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: POR_EL0 is a register that can be modified by userspace directly, so it must be context switched. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/processor.h | 1 + arch/arm64/include/asm/sysreg.h | 3 +++ arch/arm64/kernel/process.c | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index e5bc54522e71..b3ad719c2d0c 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -179,6 +179,7 @@ struct thread_struct { u64 sctlr_user; u64 svcr; u64 tpidr2_el0; + u64 por_el0; }; static inline unsigned int thread_get_vl(struct thread_struct *thread, diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index cc2d61fd45c3..0dc8ee423af4 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -1007,6 +1007,9 @@ #define POE_RXW UL(0x7) #define POE_MASK UL(0xf) +/* Initial value for Permission Overlay Extension for EL0 */ +#define POR_EL0_INIT UL(0x7) + #define ARM64_FEATURE_FIELD_BITS 4 /* Defined for compatibility only, do not add new users. */ diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 0fcc4eb1a7ab..d33f9717bfcd 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -271,12 +271,19 @@ static void flush_tagged_addr_state(void) clear_thread_flag(TIF_TAGGED_ADDR); } +static void flush_poe(void) +{ + if (cpus_have_final_cap(ARM64_HAS_S1POE)) + write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0); +} + void flush_thread(void) { fpsimd_flush_thread(); tls_thread_flush(); flush_ptrace_hw_breakpoint(current); flush_tagged_addr_state(); + flush_poe(); } void arch_release_task_struct(struct task_struct *tsk) @@ -498,6 +505,14 @@ static void erratum_1418040_new_exec(void) preempt_enable(); } +static void permission_overlay_switch(struct task_struct *next) +{ + if (alternative_has_cap_unlikely(ARM64_HAS_S1POE)) { + current->thread.por_el0 = read_sysreg_s(SYS_POR_EL0); + write_sysreg_s(next->thread.por_el0, SYS_POR_EL0); + } +} + /* * __switch_to() checks current->thread.sctlr_user as an optimisation. Therefore * this function must be called with preemption disabled and the update to @@ -533,6 +548,7 @@ struct task_struct *__switch_to(struct task_struct *prev, ssbs_thread_switch(next); erratum_1418040_thread_switch(next); ptrauth_thread_switch_user(next); + permission_overlay_switch(next); /* * Complete any pending TLB or cache maintenance on this CPU in case From patchwork Wed Sep 27 14:01:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400858 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 2945EE80AAD for ; Wed, 27 Sep 2023 14:03:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 960A28D0002; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9108A8D007D; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 789F48D0002; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 5E7A68D007D for ; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 27103140905 for ; Wed, 27 Sep 2023 14:03:29 +0000 (UTC) X-FDA: 81282544938.28.C33F4F2 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55]) by imf18.hostedemail.com (Postfix) with ESMTP id 710D81C0117 for ; Wed, 27 Sep 2023 14:03:02 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ejgNHPDd; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ejgNHPDd; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf18.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.7.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823384; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z0yT6aUiEgqGdFDJIzxPy3xP5u2DH8hDhZ8T2A+NsCo=; b=ojD5ECNh2LhGCWWjcpJ6EVYXRas3XPrHHWtn6HZoIcPmDxkeGtSNIOKCTPRmqxGkWtJ9la Af+fxoTkapktCrTIy6tRn5L3unvFyKyxSMOx7S0xOrzmC3/oLs7bTpnOeC18E9j/zu7j2n 0lpTGenp7aYCoGqaku8jHLd1vnUS+M0= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ejgNHPDd; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ejgNHPDd; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf18.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.7.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823384; a=rsa-sha256; cv=pass; b=Z2grdhUIOdpnDug/N/+2gn81po9s7jSXpzQgHeOhraYW26ZSYST70HhQNyXsPGaRhRqjSk n5Bid2VuLOiBvsKkVpaTrkP3++SKkFMX6+VFIQOxV0nQjjIVLp9EaixxSiXKz1lB/BPT5U n/mW3n9MxkvsZKNpxkLnPPNjCSyP34Y= 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=Z0yT6aUiEgqGdFDJIzxPy3xP5u2DH8hDhZ8T2A+NsCo=; b=ejgNHPDdMOxcV0sn2YhSvZeF6scd5vWcwHMgPVPim5DJYK3ia1Z/DBDVEwNGImIdGPzdoevaDeHztUTfyvCIyhlAeec6EElSVOluJCT1izxQrm0BcAYpS2aD1EmZSVna47d+GCLO07aWPVX0ylW3+55geKiEvnP9P204apSVBV8= Received: from AM6PR01CA0070.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::47) by AM8PR08MB5732.eurprd08.prod.outlook.com (2603:10a6:20b:1d4::16) 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:02:59 +0000 Received: from AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::de) by AM6PR01CA0070.outlook.office365.com (2603:10a6:20b:e0::47) 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:02:59 +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 AM7EUR03FT042.mail.protection.outlook.com (100.127.140.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:02:59 +0000 Received: ("Tessian outbound 0ae75d4034ba:v211"); Wed, 27 Sep 2023 14:02:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0ddc445098f639a5 X-CR-MTA-TID: 64aa7808 Received: from 071200549df4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C8FCD12E-D95A-4B9E-893C-1E0CD9681332.1; Wed, 27 Sep 2023 14:01:51 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 071200549df4.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=MBBQQLegQn5s6/3e0zRmdlUC9Srmc+hjhNusW2bVJKaPXuhlXV5kRHwdl+xotixHMctBGETyq78oadjPh5ahd4jGbkkdv35bFlC9k0J5j02XS4OQ6+6bs6HMWl1KmpEjuPkBx9Y8GoSJp7FEnaoyCAfOqXAikJMan7Iw1vZgDd2PxtdwcVkNV25RKvGmsNghVdWsmlUwjBganj+gmH1xtpSOvPtGcbTskl9JVpdIK32XxRsijbkZLodHo85/zo6huPWDjRtG2jrue7qSOzCVLAvPWbFl4XPKDUh5japidHw5/kpe+r0vCU/A2TvEMtrKclm39xsHKyO84yspOzX9rA== 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=Z0yT6aUiEgqGdFDJIzxPy3xP5u2DH8hDhZ8T2A+NsCo=; b=LiFQyQKhwYGOgvwDA1p/kxP4OFlRugzVrdN/18rjYIigyGLW/Z8q1tSMCinR0bXpEQnajK77f/L9bIVf9bXloSMwzEjXbpZ//B2jlLBx1XFuQCWAtH98tMKn7+VnI+X2Maycl2+rU1hbYiY4kKeo8iifuyoQWOljtcudMXcP4IsmpRbbg1rljyHlLDlO9owWK8Dyz20/NJjBMLtmVMaTJlu2NFKxxZjKSrbIImqSSpyqOtn+Ez/dl3UEINZyBKhtwcAtwUMQ10H8YmgGmm/kUxYHdEg5lYddcNiVWceZf3HeF5rPsSgeAeOUYME/lo/K86t84njEmkcy0lUZxYgJXA== 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=Z0yT6aUiEgqGdFDJIzxPy3xP5u2DH8hDhZ8T2A+NsCo=; b=ejgNHPDdMOxcV0sn2YhSvZeF6scd5vWcwHMgPVPim5DJYK3ia1Z/DBDVEwNGImIdGPzdoevaDeHztUTfyvCIyhlAeec6EElSVOluJCT1izxQrm0BcAYpS2aD1EmZSVna47d+GCLO07aWPVX0ylW3+55geKiEvnP9P204apSVBV8= Received: from DUZPR01CA0183.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::21) by AS8PR08MB8085.eurprd08.prod.outlook.com (2603:10a6:20b:54a::21) 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:01:46 +0000 Received: from DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::6f) by DUZPR01CA0183.outlook.office365.com (2603:10a6:10:4b3::21) 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:01:46 +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 DBAEUR03FT047.mail.protection.outlook.com (100.127.143.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:46 +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.27; Wed, 27 Sep 2023 14:01:37 +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.27; Wed, 27 Sep 2023 14:01:37 +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:36 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 06/20] KVM: arm64: Save/restore POE registers Date: Wed, 27 Sep 2023 15:01:09 +0100 Message-ID: <20230927140123.5283-7-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: DBAEUR03FT047:EE_|AS8PR08MB8085:EE_|AM7EUR03FT042:EE_|AM8PR08MB5732:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e9bfcf2-7b8c-43b9-fb77-08dbbf6274e7 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: 3dGPBsS+COWkvTcnukDiSEDwQrSEn1OLsk4fQ91fVbT+BNBVnu07rzjXVyYdCEfQq65mvUJrQih9emSd418aQPRlJQefsj/c7yqNcaaHtF+D2m+w452pvztZ0VlbonDWBxlh7BuF2kI9BJkpT7BSMYIcydCjtKFW+z8bI+3PsHkvyibS+SgPgHoE6RUY8YcVcSk2EaPex09QcT1ft6hLU8d3uBxaB37J87FvUYv+AcA8xlCSc1tFeWx4vh23tzWQigClJqWOjndMRqsrOyNk1E9fja9VmI6whW6/rH04qW98XOBgoPqRMPTDAu95MtzzXjDGMKBK3Khrw3wnevyNjJB7EE5joOXpn+6DPTVIWu8DHnDCzHvcKRC2bUe8RrodQUei/mPffNTNwtlDr0avGJU8RCfxIQp3XnJdsJBDdP6etEL690P3q/H1tF/yygZyrTfbLPGovDDR3s/J99bNLntSS6MwEdIslMjZGS1kRZI+Eu+65peuK5sAWVPQpRcfbEyAN5T8QES+cr4LS+cyCWu8DMQ2LngnxDVnsb/QPT/R2rp9JTzfqd7p8b6co/RkQRONpoWsejAscVy06wstXFd57oUdVxW+pFlDrlPwUCCza79TpWf+1LZgdC6xNp6TtyC6f0R92zaI6AgWd7tvh7Wgc6PUVl6ztx0x6HOizA5eAHjykbNVjPMvhbPM5zu0EZZEf2HPtuAR4TewUC+2fqjgB4eV36cb70PyeIgfuQHXvipUrxWmZkH0m4u+I5xYiroNr9NrgvLVsYOg8Vvn0Q== 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)(136003)(346002)(376002)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(40480700001)(5660300002)(70586007)(70206006)(41300700001)(316002)(6916009)(44832011)(8936002)(8676002)(4326008)(47076005)(2906002)(7416002)(40460700003)(356005)(82740400003)(478600001)(336012)(426003)(26005)(2616005)(1076003)(81166007)(86362001)(36860700001)(6666004)(83380400001)(36756003)(7696005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8085 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08b69d6f-54b4-4124-a6a6-08dbbf624949 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nd7+63pqVoReNYzzskYDnETUkahhzaT2AwyaG+W09RCAd6cOIQ7yS1F7o9oG0ABzFFrXjs/qMqVAaxxnKaadZtGrdDXUVe9njy6npv8rZjxmPVH9sL405dYkRcVr/DVxEDfZ8w7P1VdDcr/8ovSRpfcc4cwwN4V0WQXsT2T0AA3DHqDXtl4YGtLGUodO7UOJDlAbQ8ieBgAaJNrys8am+REpeMvCSdwJqIZVOreqjvPhgYkm5tZNgWElBKp6wzTZfuPUCf4ccP3D1fn6P5A8zi2bqSAtjRKi/62PMizefCO9x/2smpE5UEWMUArWbir/nCeWkq6jDctiTiFvXNeyCMI4E5EglyuTa0/ElFWhOEAY2r2ZoA+upM8dBhvO2rVrho3yh3b2BIJ2+W2KwUOtWnsa8d0kHrINUpc7H1ilxDTOAM+MBBpQWLj39pSlYmtU1Uwrml4XoALm3RYcJQlLz7UcApvgdstKZYeKgDz/FHFkNhv4S1dfAykcBGQerpmdYkPEVz6sx7Z6fRRZnHIfhn0OpAbfyJo0V9gpMweEd0n9j6+aMN4XT1ZyokksMcIXbxQMggucR20VuvvmdyNmmxnZh+cVaAEMtOGzwk3RbT79G3xQEhiIH7InvvBF8JgJifR9WkIqVFX/bdivTV/UKM9UkLE3Zau1KLnyDQKvxqp1j8rvcO5GYtJIJ0FWjzP30IgXSxlUzGfSxvKAHxLnfVjd7GHokscYGSrexUpcwvzvpd1mJUpRSNnWKjqLRf+x 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)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(107886003)(1076003)(2616005)(426003)(336012)(26005)(7696005)(36860700001)(47076005)(86362001)(81166007)(82740400003)(36756003)(40480700001)(40460700003)(83380400001)(70586007)(70206006)(2906002)(44832011)(54906003)(316002)(41300700001)(6862004)(4326008)(8936002)(8676002)(5660300002)(6666004)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:02:59.1023 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e9bfcf2-7b8c-43b9-fb77-08dbbf6274e7 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: AM7EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5732 X-Rspamd-Queue-Id: 710D81C0117 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: jcet6p6unk8eby3few9o49rmfe5e3xap X-HE-Tag: 1695823382-259766 X-HE-Meta: U2FsdGVkX19qegL965tAzDbL8W5w/r4+eJ2N+4BmZGORmRwrjPUkUm0US7pTvoKOne8WOf+ywBFuEIt3fJF13li/xUNoLTcXmgh3Iu5jOu1WLnRbwI4/F0fM/woRt7zvLkoQY96yHALr6LROllr2o01H04kZpD0m5qQKvzpbLHKO2WlRVokEwxJu3ti/1at9L3xYCcoFVWwZRaYM8Pz8h3VxweifoGOXtp0Chznhc+URUkhGa06FpVFzKC9slZ9829exnY/3tjCWC6LtnTLPqVyeNb+T7u8EDkXymJBJ2ZraNa3pqr7QOcju4mk1mL35p4RAuF+UjIHVWZOYAR9/pMThK4VhQp83RpYBLyX1SN9G9Vxvk2lA+ofVeFfN8tZvTZgitwvV3WmKwJQ8ccOIBeLAxmcO89E/Qr+QqUyLP+QZvTlZVF/D+RIYCIal8dKxiaHf1uui8B29lGkdH4MppwXj6THzDaqHbeSW+JwgWKam09KyrgDWa6bx5OAgorm4cTmxSY/cbbg/FcUozD3KZ/iB2dkbIR1Cb6kmw7cLasAmveZtW5UdYIYIk9MoAmgktdschVTfd++1+DUH7Db9qOFoX9fEycl6dGNqGzo75hVi4P4tjTYmAah+cCE3tbPCSF2XUGYP+2DfOokXK5D/trcVGUMIbobxNKv3CWm6PzcWGSdaKwD4h/ky5iedture84S4MViWR5SPjkky0vONfM3uXzRRNRPxtZC78iCjy7SUUux8wv9JO6ry+bS6VxNUn9PCpdgq+lLiWBbT0T785cETDCoB/lH5l5ylhgAVmvfXyP28sJ8zeUEqgUJ0iKjt7MdSTGsCeaDu0lUtNHp0XUbCAw9O3uO+QjX4JM5IHc3xQf/i2P7M7HrChC19JmZqoq7abSXQ6KM90sgwB9qrX4VYt7rxFgf+B3aOAdUEWJjYqWdkb3nZQWieGw6+vggUi+WVPM2ezPq9BNDMkFi moq71gxh i7xR9zsakXA3/rImxSttO91g9z2S79bagznPTMVjnXgzrV2BEafwdyIObk/fiQ1yRjMraK9eDVm+b+Rqm3N7xWuYcXg0WfT64HoVfxBQa3HEPvF2Q+mJrcxSAFTTc3ynlNkMPrwdypkurUYLJjj9/gaS7XN5i9NRRGfvkkNVxzSwa72Dsi9w3C+XVWF93FUwYqM3s4/JiUFwrI1BFMcSYf2+DnDpIoKi7pIQ7GGG+jBaXywcT9Fonx0aWgVkm3LiFt13EFAwFWGiTGGAtq4hyU2USanrtfN7DD82f8gfdhdfk7zMz+/wOSDgYgW4lOPlq3vDSHiQDfU9B/tyZYnLdO3cBk3Bryd8l89JuPVZkyIafL2Zq5pU0piCTs7lYDRhLEmgfU2h2C0NGRAX1F9EHiMYaVAkw4AoH/KlyCm39X0ZRltWTXb8z2bV5+OCyyx3f62862VvXLu6m2pUEAzyMHNqC4E3cwxTpnu/VAlE//xYjtyOWYX0OeAO4TiOJxYNI3na+HIJZbafVuXr7eY55m8qFmznhdqb4z4zWvtbOujjN9p5zfHfja18duNGZB/MvAhxE 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: Define the new system registers that POE introduces and context switch them. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/kvm_host.h | 4 ++++ arch/arm64/kvm/sys_regs.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index af06ccb7ee34..205653bc5c2c 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -365,6 +365,10 @@ enum vcpu_sysreg { PIR_EL1, /* Permission Indirection Register 1 (EL1) */ PIRE0_EL1, /* Permission Indirection Register 0 (EL1) */ + /* Permission Overlay Extension registers */ + POR_EL1, /* Permission Overlay Register 1 (EL1) */ + POR_EL0, /* Permission Overlay Register 0 (EL0) */ + /* 32bit specific registers. */ DACR32_EL2, /* Domain Access Control Register */ IFSR32_EL2, /* Instruction Fault Status Register */ diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index e92ec810d449..dbaddadd2a1c 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2124,6 +2124,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 }, { SYS_DESC(SYS_PIRE0_EL1), access_vm_reg, reset_unknown, PIRE0_EL1 }, { SYS_DESC(SYS_PIR_EL1), access_vm_reg, reset_unknown, PIR_EL1 }, + { SYS_DESC(SYS_POR_EL1), access_vm_reg, reset_unknown, POR_EL1 }, { SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 }, { SYS_DESC(SYS_LORSA_EL1), trap_loregion }, @@ -2203,6 +2204,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { { PMU_SYS_REG(PMOVSSET_EL0), .access = access_pmovs, .reg = PMOVSSET_EL0 }, + { SYS_DESC(SYS_POR_EL0), access_vm_reg, reset_unknown, POR_EL0 }, { SYS_DESC(SYS_TPIDR_EL0), NULL, reset_unknown, TPIDR_EL0 }, { SYS_DESC(SYS_TPIDRRO_EL0), NULL, reset_unknown, TPIDRRO_EL0 }, { SYS_DESC(SYS_TPIDR2_EL0), undef_access }, From patchwork Wed Sep 27 14:01:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400856 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 8A925E80AAD for ; Wed, 27 Sep 2023 14:03:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 061A28D007B; Wed, 27 Sep 2023 10:03:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 037B58D0002; Wed, 27 Sep 2023 10:03:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCC308D007B; Wed, 27 Sep 2023 10:03:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CC0818D0002 for ; Wed, 27 Sep 2023 10:03:03 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 02F451CAA1E for ; Wed, 27 Sep 2023 14:03:02 +0000 (UTC) X-FDA: 81282543846.01.D6D547A Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2052.outbound.protection.outlook.com [40.107.22.52]) by imf30.hostedemail.com (Postfix) with ESMTP id 44E4D80067 for ; Wed, 27 Sep 2023 14:02:58 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="5b9JoG/4"; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="5b9JoG/4"; spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.52 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823378; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D+hbZSgGHRByh5D4CmkeYpIKsNyQ3KdCY1O6oqp43XI=; b=1ruBTFRKEHYXKnYQIekeVFHT/MKJ9jrGDMa7addIZVihhIFU5u42abWxlLhr8vR15QO/rK 8Rs9JfWWGi+LMpf9aYnI716LYRYRJl9juKy/G7JvVv8nwO78mHv8EigE5CF7SZFAF1/yn4 SpJ57mF+X+DSLrbSRTwnE6ZgirryL28= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823378; a=rsa-sha256; cv=pass; b=6pyKEB4/wq3eStklRFwBgQlgsUgiGRo6rC+IxcAKb4o38TaT/7jZw9++p2QSVb1QN3dh6i krtt7HXTnd0NClM2g76pbRSTPwtRercFSotITPTQZrFbuCzfjyUruKa667Mm/OkbhcdzwW rSoQhjtGesKCeIYQ0LLJDFFmlXZaNHM= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="5b9JoG/4"; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="5b9JoG/4"; spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.52 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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=D+hbZSgGHRByh5D4CmkeYpIKsNyQ3KdCY1O6oqp43XI=; b=5b9JoG/4HzMQ2+E+aeIMJPHrNlngT+i6Du3lUkRCYZ1wS/5/OknNgPy7VIYjyzajTNpZm8UWu8Iy7EfmLtJ0OqwPr6rH9y6e2fip1MLK+MiOGAOm7qmKiAHJ/f1zQWTDzeMqTriphiPP+X67bZhrCB4daFt12KxNGxPZSPU2BpA= Received: from AS8P189CA0045.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::14) by AM9PR08MB6642.eurprd08.prod.outlook.com (2603:10a6:20b:2ff::9) 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:02:54 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:458:cafe::e0) by AS8P189CA0045.outlook.office365.com (2603:10a6:20b:458::14) 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:02:54 +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 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) 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:02:53 +0000 Received: ("Tessian outbound ee9c7f88acf7:v211"); Wed, 27 Sep 2023 14:02:52 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: afe11708d26285a4 X-CR-MTA-TID: 64aa7808 Received: from f9b540775bef.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 72E03827-71FC-44F6-8C41-12197CE46C00.1; Wed, 27 Sep 2023 14:01:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f9b540775bef.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RvBdRzv0bTPcnGqa91J2rOsB3dJDVm0FwYNFcwfRdpNsOdHu+hxbi5Vg+hPA5CNVMFXuaGmcozVr0FAmw4qbEBTmsu93nHD3ibcsCfq5dte/TN1AsbFsDCBxp2XuvFd2bX0DNxFfeI5l9lisbve/8mlRv3CNmS6hWPaOJ0BNXydQHN1nDE3w5l5OEn0bHKJHTPbLPXMD4CxrfcAw94O+SGqEBKNK0Z7YRE3MStIG6vuBeY1vS+ax2Znas+DUMGB0EhNpoNTdnuJfM6l3moX4VTG0szOSPme+GbPzhJ8xmXYZfEoddMIG/lRIFGgdb5vyzo+l6f8HjzKFYEqOwAf2iA== 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=D+hbZSgGHRByh5D4CmkeYpIKsNyQ3KdCY1O6oqp43XI=; b=PYf2bNPLVl/bGvQQyQ63Lr6RHNNEKrFnXfsBK85fGep3KjDC9RW5P9y79IhYD3gIoqjo/oIhQG8wevXxzrKqXwvqxKZfgrRrS2z6+QpztGtJ/1A1Tk3Y2bFD7FdcFyl5h4GBztEq7U0hcKZnIwuavQlvW9FWLH351+GoFG5Hy9i6rZM0tecs0Lm/vDA3kl0St+6nXtoenkG6WO+E33NQon7AfnO9fSftfK28GT80fN7K6oX0gxfrcXc4oAkqo/35V/Wve4X+XVqU3SInNNhw3JyFoRb3GWFHxC6oqOEvOlLLGpr7Dvs1hiappzIuuuwVAj9dybWVTjAKQPsX7yJwNw== 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=D+hbZSgGHRByh5D4CmkeYpIKsNyQ3KdCY1O6oqp43XI=; b=5b9JoG/4HzMQ2+E+aeIMJPHrNlngT+i6Du3lUkRCYZ1wS/5/OknNgPy7VIYjyzajTNpZm8UWu8Iy7EfmLtJ0OqwPr6rH9y6e2fip1MLK+MiOGAOm7qmKiAHJ/f1zQWTDzeMqTriphiPP+X67bZhrCB4daFt12KxNGxPZSPU2BpA= Received: from AM7PR02CA0025.eurprd02.prod.outlook.com (2603:10a6:20b:100::35) by DB3PR08MB8841.eurprd08.prod.outlook.com (2603:10a6:10:43c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22; Wed, 27 Sep 2023 14:01:47 +0000 Received: from AM7EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:100:cafe::89) by AM7PR02CA0025.outlook.office365.com (2603:10a6:20b:100::35) 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:01:47 +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:46 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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 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.27; Wed, 27 Sep 2023 14:01:37 +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:37 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 07/20] arm64: enable the Permission Overlay Extension for EL0 Date: Wed, 27 Sep 2023 15:01:10 +0100 Message-ID: <20230927140123.5283-8-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_|DB3PR08MB8841:EE_|AM7EUR03FT009:EE_|AM9PR08MB6642:EE_ X-MS-Office365-Filtering-Correlation-Id: df17ebc0-04f7-423c-19fe-08dbbf62715a 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: di3SMZtegmCx2TvUJPRIM7KmphLWNEHLmCl/stFEvahVwdpkAh0d5gho5Boit0UEnqGMf8vmaoVZ1unC+G4sYGoqsUch5hos2cPMGJkb4V3c5jM7IjqOiFBDde1Gqm9bDO1Xq4GB3/XOkrjZcehdoTfW28Qf+qXnmvj66ENWqv0VRcH+Ck+JwM5fUINYrB1G34pXx80Il3VwgQsm8u6YkwYCm6iTAuykY466BMZexUKwf9bCqxD1jvEbfE7s0EIrHzaJmegn4p30ghz2WWRNdwsOcJAHojld2WsQt2L0biGC1ZhFTpUtOpTxlcGY0zXoylPgH/+RpSRvS1oPPjIiNupjH5+iGozNeu6mww94IYxd006Qcxe8d5OUPu5bLgOKp8cqB70Ryd6qmAlv9wOGktyjZqdnGA5T6xErOddN39xgxl7gg1MZEXBLWTXjQJOfN+k1Zs6t85r7kfSVoDfOxXsrpPOy30HsDPQkvzohUY5AF/7elNKa29RDn4TCkBqSRge/XGGxYfb0sCOSJjZ40yKa3xHGveLtQVAXlKMfNcb7wr+hpJAeMyzHIhrBKZEgddHpretJlz/R9tAbFE3s7jkHfPFtaAO6ZpO9EJogTDsLrvtUFHUCxQ0eLD3GHh4odlrXfHjM7+3uRAVMpK5uhGyqKY9YDzoZ8QOgbRTlX7oP0zanKB9dGaCpFH0sGRbX7v99Elx7zk9EP1iuG1Oj7aaMA9fGSFc9gbd9YB86XE4F4x5BYQ0tam7l39ZDRtSX 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)(376002)(346002)(396003)(39860400002)(136003)(230922051799003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(46966006)(82740400003)(81166007)(356005)(36756003)(86362001)(7696005)(2906002)(478600001)(5660300002)(4326008)(44832011)(6666004)(8676002)(41300700001)(8936002)(40480700001)(70586007)(426003)(2616005)(1076003)(36860700001)(47076005)(316002)(7416002)(6916009)(54906003)(336012)(26005)(70206006)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8841 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9373f7f5-9eb8-4313-1ae7-08dbbf6249e3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z/4sH+q+kCMja51SAAcTjHLxiQlF45Xy3DuqPT0SWvwRPP4vfFwgxXFf0AqU0LVdXLsYlnsxb+kZ9EMQbe9OSeSiOhen6dYSSeynrrS5tJNGGMhFsROUtm/cyteAuYc9qt5eQ1TDtksAWCqx1OQVe68myK+blv+F01dOQXk6AQlIyYvdTngdnTMXTmczxr9+FzccqyCqiihNayTxXELk/fMm18Ls5fYLd3gZ4ZDTrOKUrduk2Gunyj8syHT5ZoBWTgGJYRkwFv+z5ITHhY9utCZu/NkPDh7JVXWbRY68W8cNOfk6xN8p7KPVV+d5VX7nCGeMJtDgCc4R13ph5nH8PoBEolzY+yAv2CNxejCMHRq5raTUko1wBpmBkfjQMCgSJfpxzEfTsztklcoVd7FhZNmxS5u0IYtb+4XyqiIlxTrid5+z4YOgxakaWQOS3I0KYCbqRywtvaTultq4EQuy6MazaYeslwYwD9O9xy9n04gXZLVrrccgJOVXGJ83jv4aDBf0/Ubl0Y0vhyEPMTAUDYo1IQCIbKQ7gqIMAiZqIqbnphifoIcBblNz/pCbHyr7siSty782ejbqWSS5o2QSomPWhdfR3xSRMNmzd1T0eiHVzNOL1KJwExsk2U5JkPK8/1XA3W45aOwaj52v47bogghIQKcADsz5oE1nnaHmjYgz4a7jezvpGADsU298aO4jIxh2Qk0d0NnhT3vSEGVFX4seFDinnKAvYTbfKUeSs8avanufIr8OynCFsf0V72G4 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)(376002)(346002)(39860400002)(396003)(136003)(230922051799003)(186009)(451199024)(82310400011)(1800799009)(46966006)(40470700004)(36840700001)(426003)(336012)(26005)(107886003)(1076003)(2616005)(44832011)(8936002)(36860700001)(4326008)(6862004)(5660300002)(8676002)(7696005)(81166007)(82740400003)(47076005)(478600001)(6666004)(41300700001)(316002)(54906003)(40480700001)(70586007)(70206006)(36756003)(86362001)(2906002)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:02:53.2018 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df17ebc0-04f7-423c-19fe-08dbbf62715a 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: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6642 X-Rspamd-Queue-Id: 44E4D80067 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 8kyebre4zir9j4q9ocd4gdq931nze7eb X-HE-Tag: 1695823377-98155 X-HE-Meta: U2FsdGVkX19D/uRb3kTIM0vObUKnO38TpTEn1SOEKUAwxHQrSSigU96ZbpyxAbG+qGy9o1XfyuWlC90B17YpCEuFb/Q7QzMTlaJJJSu/gqTsTh3yXy/eMsN3JmxEhTmosTnnrGOBncN8QxYwckY2Q2c4BNhhcJRkVxpzPu++bczJo009/dCBIfLueQrGnZEF5YamnPRbdewp0cnHYWGM6l6ppNN4iae4PdJYgC2XxhLMy/F0uX6I6BYpnFhm/Pwqw5gi/WXlqeaKsTz/xvKvwI4jr4YY1SCvewUlYspECIrv/UEi1e8asiGjqJ0G6D4zeOW+lu9P937xw+H5W+H6LuHwM1ajor09U7/oy3fILPi8jtqy2t4tX3Oeer+/9SfF96YPAvPzj397U5IvcIFdQBJKZScI1oaNZCK0hu+M3qGjhx3OnTHXB5m44JIIrPiZZLZoNdvULtDXoGd6fI6XqyLdPAIDgQecmelQibmla3qnEa3iiACwMQZeSg9OQkh4uSH+ElAdz0hnPCkmIgXevcKJb3jXXtP5uFmaXBDqMLaHk7qyfhu5qNPTD4lksUJf53BfNcMOiN3KbBtsEV1O1GF+pREEXanZgy0yyQWdF/N4qx947GRNvtn2NFFJBN/Yk86wumfal2xX2byVdX4HzkPb4HQsO/r61Yld6XVaVawB7rew3QDrQRXI67F+hI54nAw0su42Ts95JC9AbsmLe64UUkKZdG6TvORJ+Kocil51xiMHYnBT2hSBGhXVeDJTuYHYNScnbbGqdLPOcWh9bQTHMQ1JQA+OSInXEnioLpsQyB3ggTpNKqlCbcRHJUWGpfpbf+PVfqjm/SpqDi8QxcOx16QGCgd9G+RB0iUeCDmZheK2BTpIYHFOIMzjC/aggXf8VyGnRTe5rmpt413PxtaLUz+DhauqdZben8jSIEfIkZSMB14YYX1uXq35WWFm8axvQnlAVBpvfGjQ9uz mKFmdqyt 3fPNmu1hvxpLNPYnErQMQco7/RQdazcofu5kLWgGlpGcaPbdUjP6iUP67X+nR9pmyzmpG8kpPTnLsDR33Yz/4bMjYYTMX0xVAoeebiA5Pgo5bktQkgAl2rP+Wu0eg19USZgmCskuj/6TqwFCxGD0JdMDzzeNljO6omboErsxVr0xgqrH52DrGmx9znusV314Wytwnmemd8fYK/SxhBjevEMBXu65X6Vj1pCNh0nnYN3WC1wUnNFnvSazElKD1MQm4Lh0exjbIU3KsEgpFirxkAdgL3XxzkKYfXjnl3MkxbLhePY+dN5RgCkgpBYD+QbrSTV77x6IQMEImojpNH/MtW/oMN6jmCFSfY19BD9lJvpzGImLslzCYEn4xSciT5tCDxf8FPh2UWn/4jJRYScPXauykddNroRzZkyOetiKpYbxOP6bQJETQibJAb5FERF8pm960g3GM26QV4lCi0u91MsjLFBlaELJM4AzOaJs1BX/+GCWTH8iphRA4rUvbrCYkC14OErvzjHRtB97jvkLIyd+c0jHKhy5ExBOupbT9e11jfPN/SmFOXU7Foous5/Oab4tf 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: Expose a HWCAP and ID_AA64MMFR3_EL1_S1POE to userspace, so they can be used to check if the CPU supports the feature. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- Documentation/arch/arm64/elf_hwcaps.rst | 3 +++ arch/arm64/include/asm/hwcap.h | 1 + arch/arm64/include/uapi/asm/hwcap.h | 1 + arch/arm64/kernel/cpufeature.c | 8 ++++++++ arch/arm64/kernel/cpuinfo.c | 1 + 5 files changed, 14 insertions(+) diff --git a/Documentation/arch/arm64/elf_hwcaps.rst b/Documentation/arch/arm64/elf_hwcaps.rst index 76ff9d7398fd..85f6e9babc7f 100644 --- a/Documentation/arch/arm64/elf_hwcaps.rst +++ b/Documentation/arch/arm64/elf_hwcaps.rst @@ -308,6 +308,9 @@ HWCAP2_MOPS HWCAP2_HBC Functionality implied by ID_AA64ISAR2_EL1.BC == 0b0001. +HWCAP2_POE + Functionality implied by ID_AA64MMFR3_EL1.S1POE == 0b0001. + 4. Unused AT_HWCAP bits ----------------------- diff --git a/arch/arm64/include/asm/hwcap.h b/arch/arm64/include/asm/hwcap.h index 521267478d18..196f21b7d11b 100644 --- a/arch/arm64/include/asm/hwcap.h +++ b/arch/arm64/include/asm/hwcap.h @@ -139,6 +139,7 @@ #define KERNEL_HWCAP_SME_F16F16 __khwcap2_feature(SME_F16F16) #define KERNEL_HWCAP_MOPS __khwcap2_feature(MOPS) #define KERNEL_HWCAP_HBC __khwcap2_feature(HBC) +#define KERNEL_HWCAP_POE __khwcap2_feature(POE) /* * This yields a mask that user programs can use to figure out what diff --git a/arch/arm64/include/uapi/asm/hwcap.h b/arch/arm64/include/uapi/asm/hwcap.h index 53026f45a509..8809ff35d6e4 100644 --- a/arch/arm64/include/uapi/asm/hwcap.h +++ b/arch/arm64/include/uapi/asm/hwcap.h @@ -104,5 +104,6 @@ #define HWCAP2_SME_F16F16 (1UL << 42) #define HWCAP2_MOPS (1UL << 43) #define HWCAP2_HBC (1UL << 44) +#define HWCAP2_POE (1UL << 46) #endif /* _UAPI__ASM_HWCAP_H */ diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 902885f59396..9b9145fdb208 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -400,6 +400,7 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = { }; static const struct arm64_ftr_bits ftr_id_aa64mmfr3[] = { + ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR3_EL1_S1POE_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR3_EL1_S1PIE_SHIFT, 4, 0), ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_AA64MMFR3_EL1_TCRX_SHIFT, 4, 0), ARM64_FTR_END, @@ -2220,6 +2221,12 @@ static void cpu_enable_mops(const struct arm64_cpu_capabilities *__unused) sysreg_clear_set(sctlr_el1, 0, SCTLR_EL1_MSCEn); } +static void cpu_enable_poe(const struct arm64_cpu_capabilities *__unused) +{ + sysreg_clear_set(REG_TCR2_EL1, 0, TCR2_EL1x_E0POE); + sysreg_clear_set(CPACR_EL1, 0, CPACR_ELx_E0POE); +} + /* Internal helper functions to match cpu capability type */ static bool cpucap_late_cpu_optional(const struct arm64_cpu_capabilities *cap) @@ -2724,6 +2731,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .capability = ARM64_HAS_S1POE, .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, .matches = has_cpuid_feature, + .cpu_enable = cpu_enable_poe, ARM64_CPUID_FIELDS(ID_AA64MMFR3_EL1, S1POE, IMP) }, {}, diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index 98fda8500535..5b44e8ab9ab8 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -127,6 +127,7 @@ static const char *const hwcap_str[] = { [KERNEL_HWCAP_SME_F16F16] = "smef16f16", [KERNEL_HWCAP_MOPS] = "mops", [KERNEL_HWCAP_HBC] = "hbc", + [KERNEL_HWCAP_POE] = "poe", }; #ifdef CONFIG_COMPAT From patchwork Wed Sep 27 14:01:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400862 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 690E6E80AAC for ; Wed, 27 Sep 2023 14:04:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6AD38D0086; Wed, 27 Sep 2023 10:04:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E19E48D0085; Wed, 27 Sep 2023 10:04:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C93F28D0086; Wed, 27 Sep 2023 10:04:15 -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 BB2158D0085 for ; Wed, 27 Sep 2023 10:04:15 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1323CB3272 for ; Wed, 27 Sep 2023 14:04:15 +0000 (UTC) X-FDA: 81282546870.17.3DF1A06 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2044.outbound.protection.outlook.com [40.107.20.44]) by imf28.hostedemail.com (Postfix) with ESMTP id 517D4C0038 for ; Wed, 27 Sep 2023 14:04:01 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fBi8yVJb; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fBi8yVJb; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.44 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823441; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sgV4AndAd6/NO9/4ic2BHYdTbhCHHX5oZ2R85t/amgM=; b=NGdGjxc2PoPTdu3tOhzGeYBRkJHijz43YD0dahek9HjEMynjeVlaCIUbFEeVgn5s59O63X 6AIvbyJLHedkYIWNIdw/5+gTzSpNmoTLN8bx++TWAtZvjUEYwDlNJpCwtuSPWwlu8iv7M9 J+CW7ZgNiOZ6bF5ZEr24lEodunz/TUo= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fBi8yVJb; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=fBi8yVJb; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.44 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823441; a=rsa-sha256; cv=pass; b=t3F0f4EDFmJCnc8U84EdkMqMAt/Xjr1gDGmQJ60x7Wh4gzpz+TU6lvHKuTYOaVQwrDf/cM 4bI3txaZSTXGf0E2xtFhiSyGDLcCPXNngOuSKhAfQAzPevjKJR2ptkwNHE7S2+1KfdnoNO OtkFzUdQ+W0nb5lCRO66FSiTtBLCNQU= 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=sgV4AndAd6/NO9/4ic2BHYdTbhCHHX5oZ2R85t/amgM=; b=fBi8yVJbEZXVSIWUHLBgyyGhYw9wiKu9NfRQnbJOT2y1pvRUnexrLxHfNrlyUgxBs3ibPhf4Jn88n5hvhZbc3e2JPben+LA2qjU3uUakRYbOBN/XeILt/TLD0lrwmH7YknCu8fDA4TI4y36g5MFqPHQ0t6qSDhyF9NNSQ6ccCJQ= Received: from AS9PR06CA0011.eurprd06.prod.outlook.com (2603:10a6:20b:462::10) by GV1PR08MB7755.eurprd08.prod.outlook.com (2603:10a6:150:56::6) 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:55 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:462:cafe::b1) by AS9PR06CA0011.outlook.office365.com (2603:10a6:20b:462::10) 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:54 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) 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:54 +0000 Received: ("Tessian outbound 6d14f3380669:v211"); Wed, 27 Sep 2023 14:03:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e99df280e4da48c5 X-CR-MTA-TID: 64aa7808 Received: from a4cf691621f6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 41CA881A-83E6-4171-8877-73ABDAA70DAD.1; Wed, 27 Sep 2023 14:01:49 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a4cf691621f6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R5w23chlw+WPzhcOxhXesqVNDAly4nIVyV6JkxWWzEUHa7+fz9zJOPrzkygwrWl/4b2FZco1fjBBprZKlym6qu7PJ9Q/WFVdUwF1xBckMNkU8X5Ht7UVEQWKlSnjbaG18fyNPNKPKRN2IcxwncEEDDp2WtlJ+s4SJ4hRIWhQF4ZNJ2ailtlG1beTn66aD7KE+lhDqBvmD3ynfLgYFoJqFodBsqp7GYIWzgqPOtn9pscewE3XuN0ftr2OyCH7WaxEUvuJg9xRS39capA46UDdO6/DUQ75Jd16DahH38qLLxyrw3Kk1rfpBZ8ncffbULMDn0EXZUyXt5mwzliP2tjbnA== 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=sgV4AndAd6/NO9/4ic2BHYdTbhCHHX5oZ2R85t/amgM=; b=HwQ93XZqnHdxMcWP2K/O8OD5y4dkfsUXuB0ETWj+9+CsMz2PwhnFtexztmE2VqZNb3oqG2xSOvILBUHTYCOQcAXadSYlLjPxcrL54uk9fRRkeJiuh+NjM1nprm8Qx/l5dv8ue1ZASBgTFiuy8KbpndB+s7uvbL3K1PgPRj4ZqLuok8aTshrfjt+DEV5HxUc2cFw4USOV7PBJzijwJtyG1vTsmftGDaMJui8hO579vqK/tB3pqc9MRrsrPEYrI0yuH9lIUIYByDKOeNE/9s2jhVLGNmIW9QyO5yKOA+f7FGx85W3JpSRf4jTZgJgI+LjmrhAbMT2Raeam/qEj1G6BBg== 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=sgV4AndAd6/NO9/4ic2BHYdTbhCHHX5oZ2R85t/amgM=; b=fBi8yVJbEZXVSIWUHLBgyyGhYw9wiKu9NfRQnbJOT2y1pvRUnexrLxHfNrlyUgxBs3ibPhf4Jn88n5hvhZbc3e2JPben+LA2qjU3uUakRYbOBN/XeILt/TLD0lrwmH7YknCu8fDA4TI4y36g5MFqPHQ0t6qSDhyF9NNSQ6ccCJQ= Received: from AM0PR07CA0032.eurprd07.prod.outlook.com (2603:10a6:208:ac::45) by DBAPR08MB5655.eurprd08.prod.outlook.com (2603:10a6:10:1ab::5) 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:01:47 +0000 Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:ac:cafe::ab) by AM0PR07CA0032.outlook.office365.com (2603:10a6:208:ac::45) 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:01:47 +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 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:46 +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:37 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 08/20] arm64: add POIndex defines Date: Wed, 27 Sep 2023 15:01:11 +0100 Message-ID: <20230927140123.5283-9-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: AM7EUR03FT048:EE_|DBAPR08MB5655:EE_|AM7EUR03FT013:EE_|GV1PR08MB7755:EE_ X-MS-Office365-Filtering-Correlation-Id: b2003e50-ce4d-40f7-5cf1-08dbbf6295f6 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: EwkC6Zia9l+fdtlOVKrIkAaWhHI9KECKsj0V4v9u+YsodeAjUz6GymS1ERL2soArq1640WpiqTZ7FPHzJDLcIcbwIEr4jakWdrTCwhs5AWterK5RKH65ll+TbLVOuQg4CvAlYelVB4L/pxDyP46hnQL50bYwo4VxAVYui1Pq+S55IEIJe/QhqiiyGew6k6ur17NV9+gq1SUimGTl7Yt+AltQbysB6PF6fgGRKcasBWwg34p3aZcdmo8H7v16TNYoMRnwxhwZykzZ8jb2KpUUCBaiFI6nE3N0Q05LAnwqRVTQviRhFzKNAc3k3GPrj5BJvKg/HvMKq3DO8IbJhQIFSR+f3ZB2S4r9TNHcaVdEssFHZwEFB04s8qup5dHpzSEZNxeTIOAhf0MRmFSd/My0UDTOG+BeWp3tnkAOgCdCpUOL1cZiA4LHU7pRMiZ5ppqHdfYKJOmiRjUNFmYd8fk1VRnq1Kari650hufAfmd7Zx/TCYxQNOTzCq7xju6D7MqeCOB3a0ofSHZtpuhUmfkj8x6XCeAvLNUjQPJw+w7x6ewwLtk2+3gswaanT+OEl+WKzCJa6kiIjx6SeTvAw+Gk/X664AZDmJmk5Gg0X51YYsoCFKlG51A+JAialu4zDkKrBwwI+LW+m9TuZfHWQtS9uG+c0E9xXDBU9kz3E8jbA5BJYA68jUQXWvCnlhq04U8rYjhDocYYRHdePpr+uLka+z3cUznYHXtoE9gi+qW8cFC/vJXnCmjJVUHUndWQ6KOl 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)(39860400002)(346002)(376002)(136003)(396003)(230922051799003)(186009)(82310400011)(1800799009)(451199024)(36840700001)(46966006)(36860700001)(7696005)(6666004)(82740400003)(356005)(81166007)(86362001)(47076005)(36756003)(1076003)(2616005)(40480700001)(26005)(426003)(336012)(2906002)(316002)(7416002)(41300700001)(4744005)(70586007)(54906003)(6916009)(478600001)(4326008)(8936002)(8676002)(5660300002)(70206006)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5655 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f727312f-2a1d-4f94-63f4-08dbbf6249dc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ohENE1zzqYLuETzv3h1WlyAtqgqQdpCNkGEXcQ854RCIc7BfXQF1JlGqwWdM8kdgAXBHMOoSirGA7GhoNOhAsYvPeMPZvs0/ev9m9eQ7NDwQdkActYe8foOsMep0ZPBjSmZd05nbr1Yahwwxti69Y6pp5hyIH+0CH+1AqUsm2UM9Pfhx7XazgbHmac6WkRIJ7QEec9/9DTs6iXSFSMGqW8/i+2JECiNBBB03u9P/xucXG2DX/PQ+5hMM4aMqrGy/ilKFmyLMh7KIyGx9EaLgMQSfntMgEfYOrs7jbwlc4MnPUfTRn0Py9n5YD4sv3krtnxi8s0ZQSEgGAxaaPlBOhMw+hHTSgnY8/T5m17omFx4KkdtSWLVs4UsyxtrNTmCGRywPDYiW7TK3Ww6Z6EBBE9yFSgEg4KTTcclHOVDC20JcqmKs6k7ESEc4ZsHUzfN7XR/fxsdh7PggQR1xERiTF8Ea2gFDYQLMHVOnkJjJfrykObfyTlt2snAiE0pMCJumg++6/vIPkB8POkY0qBuvQysAlUFW10I+dezOSvqzXf657YZRz+xhRPt4yiIeTbWkOk/bJtRa0J19NLCrHxPQfUAiFq9CZ+rIV78+E5X9NV+zLBJTviMXDM5rTOA9qaok4Wni/09YSNCZnb/4nYtsu/eMNW/ujVXEq+KrohJ9toc9cdIoLYWanJJPcgjGV5uPNpMqeoiuJz/HuJhY9N4gwkN4UmljeTtw6Axirhsc1bz1gyx1Tg9QQhCx6J6m0Zv9 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)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(186009)(451199024)(1800799009)(82310400011)(40470700004)(36840700001)(46966006)(2906002)(36756003)(86362001)(40480700001)(5660300002)(44832011)(26005)(70206006)(54906003)(70586007)(2616005)(336012)(6862004)(107886003)(316002)(1076003)(426003)(41300700001)(478600001)(7696005)(8676002)(4326008)(8936002)(47076005)(40460700003)(82740400003)(6666004)(36860700001)(81166007)(4744005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:54.6239 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2003e50-ce4d-40f7-5cf1-08dbbf6295f6 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB7755 X-Rspam-User: X-Stat-Signature: by7ddqf1axq9uuyuzhfkkzq4nm9p5arp X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 517D4C0038 X-HE-Tag: 1695823441-44627 X-HE-Meta: U2FsdGVkX1+DWbwmw9FFX/IBUsYPjQuBnHsp04aF+Yzzmw7CFMvOe3q4C5PhRin4Wh2w6JbziDtuyDfcBagH+JmJB9mzWuJ8mqksjOxNe5zEXp5TjJOO7ExExaLiXf3lXUlyHs14VpeMRxGQ9t0Hc6BcfCaKVtT2T7y6BIBTyF5z1s1ZWB215b1wnwOSpkeacdA6bFERmZyfP4osKK0EKi0kBzFPayfU6KYM4FS9jN6KZBTD3ujuRjFtbctt6aV5FYF0Db9e9/noSwjsLySaoKZ7x4bFsKbDIawfSACG6Z/He8zHoUEUT+EBgxtqeE3nlULeJKaBOn7a9BJUKU4ZqYE8GIcygxRoZAolj73T8Ukcg0QT6qcD7r+e10naBbfytQYG0EBqw028R4tBgvJ/xij6a+/yFmEJN4pCmURMtw1ZXxL6OwMDtSl0HZW1Hht/x5H88I8zixYgqrfBmMEgxPF8fM9Wg0MNkH3p+7+OJ/5/ItVf0nyVFtRM3306hgKkt3638Si0aujJjWx2PqaP1JeiTiIJ2s//vecIxy26MgE2/sSQjOHNZ5cEkjBaUxOMYjL1wJqy6HOTKVZk2lwiQjZDwJfO3rwBAxiG1V10MqZSy4GfwZflvXvWviKf1Bt2LUE+aAkW2kEtwHS5XJ8i95US+w9HSFp2OK/83dRAVYIXVlFWl14dSaTAaW/Gsk2vy2NKiktGQZFgtOmyeXC87ZF2e4y/9U2ZbpxlanA9SBc/QTKTyw0urar44n6BqZ2I8bR28duzVytNJBZP6P3+lGoLGCAMUzCbZzd8APS0dOe5cHtVxidGZop1BWHDgauYywuNaN8Z1BIsuT920Fe/zjT19gntQC1TtrUv//JXz+dhKVNghcRD3JYKJ92PBOquq999XlC65rc1NIY3QnUej8hq0mT3nDfkjsLFdugi4Nh58Xm42J43CbZjiw5+sKHw3ZEgtuH6ud9QGtTwBC1 OZww04sQ eoy7O08PRxlaY305B0WXyUz3TiyhXG8gBRUW5F+jhQSe1ZLcFYPJb8XoXPmsX/oo9GkUH2Cu3p3hmBJB5Wu8ZHi/BW/d0ap33XoJFu0C4uF8DOLMch81qdvcc+erwPfHw3bDhKQv/M2EwjXlPwFbh7bnw5PwESop7hbLXANYXDZnMT+pdQMpETAgFHRLmN4be7uv8hVTCGXazIrfI2/v4fhdY0/d5T1Wv4Gx90pd6iIGf0KOCITPwA36+6Oa0xtG+5PZ05vEIeI+Y8dOb7j6TPMfh1VHN6vMYiivp8qhV7cdGKpyu+aAD/Z6zyAu1H1LlhHvblT+Bgw8NtHgjRdlWfcO/2ixvm0Js9Wjzoo3mghXLD8IhPwsYfDIDo/9t6BfPBxIx79BJXgN1XbroWhP3NCYunu1ioBFXcwfgWp36qDibCEDbKEY8iM88R0/CIgFUgdP8vi8/tKY7gkX4R/53StcU3mjljL2E8bO4oQLZJSCOE6XIJZf58B8/UOci0IIkSuoXgz9TQADDDQr9ij8ivZbL2+Mdy+m/de/R9X6SnigYuMBeionP4kJeElC2Yj0fbzi7 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: 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]) */ 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: 13400860 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 EDE5CE80AAD for ; Wed, 27 Sep 2023 14:03:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 827A68D0080; Wed, 27 Sep 2023 10:03:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D8C48D007E; Wed, 27 Sep 2023 10:03:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62AE78D0080; Wed, 27 Sep 2023 10:03:36 -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 50A1E8D007E for ; Wed, 27 Sep 2023 10:03:36 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 260FEC0A2F for ; Wed, 27 Sep 2023 14:03:36 +0000 (UTC) X-FDA: 81282545232.17.38E498A Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2058.outbound.protection.outlook.com [40.107.104.58]) by imf03.hostedemail.com (Postfix) with ESMTP id 7542720096 for ; Wed, 27 Sep 2023 14:03:29 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7ZtNi6mo; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7ZtNi6mo; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.104.58 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823409; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/jeZoJNj3DCve0zLnDradealBpu4fQiYUevBJ8HVNHI=; b=VO9ik+xjvo5h1/+TSAXqKptHNjvZgeNc1KlgaoMXKyXyPjrdfGCZh5vcRhknjPhGFmFOn7 086JF8RHBXQNFk9EKgVO81smdGnaJf+1aOYEeKWx4g/g3ZgbRfVhIfomtfz/ZxAsYbek8P KbPiPd4CJrFumfgl7wQ5xgk4Xye42/Q= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7ZtNi6mo; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=7ZtNi6mo; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.104.58 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823409; a=rsa-sha256; cv=pass; b=WAhqgiZWeESwBg+Jhr/zCEtKQ1A3qKjqtEDQOjDH4xf1QqCUz47Oe0g00Amx/ZXw0qW1N3 xaSdddl95wRrm32jAriwmqiSQHjnaxIQIrwaZk+A/ttMV6CZa6bv3A5hpaEqo4SmSWb/Hc mr/1ErAAh/0j0OoD9JGQ1S/TxoetwQQ= 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 DUZPR01CA0283.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b7::17) by AS2PR08MB10053.eurprd08.prod.outlook.com (2603:10a6:20b:640::12) 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:03:15 +0000 Received: from DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b7:cafe::fe) by DUZPR01CA0283.outlook.office365.com (2603:10a6:10:4b7::17) 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 DBAEUR03FT048.mail.protection.outlook.com (100.127.142.200) 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 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_|DBAEUR03FT048:EE_|AS2PR08MB10053:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b80050c-ba0f-403d-2f09-08dbbf627e04 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: DBAEUR03FT048.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: 1ZNETqiGL87je+Jcx7ViWIqFtxXWd7Amvka6BkhmZ7BkJHb01nIdgS6dpy1riwi/soZdvYYmKwf7D6v6+iduHRZL9kvqhCVBNhKX8Dvj/cDtsIYpCvXq0HKcKExQpzA1kU/FyRPUgB+XWY8RePt+jQ957Aqq6M+7/SGIT1M/q7FRyPsrufvDhZJKe+c2KGBZFi8xSgagX7UExowYQa1gAfrl5B5i/8HCTjcIliC2Mt6nl19DBBqoh0tWDEg+m3FhAWldHnNeEauHXA64IG7zLoKZiFbXOEYm/49SxlvsSJGiC8XcR1LIiOSvZs9Qmp1orX26w376mnLk8RJ8FXUXxMQpnwTpqIBdpOlSuVSKBFrNWsqrMV5y+fJ6LTWdGtLp8tNEEAUUUEMBDrFqMUhzWRV5WiqrkkcvqQ8ikf4RcTCaxKiMND1dPJCkefXr51KVdT0plx7+k8qQaLc3dgRdA0wRxmRHTTaJ29Xw/K46HMo9+U/4v0N385bpaly9hq0PDw6/OBZrUXuTGhbal1dNcE4w4ckyEwOqQsxSX+c/n0kdvxhUJPFUbXsIbQmciuCnQjk6/OjHcf9KF1W4IPmLHwMNgsKR68PlIgxWTLlrVrm/b34u9ls9yknsOWatJF5vFQr0+0m5JZynsyCM/ExR+hBT3UAISd06K95EX2mGuAjZ4af0J9z4iUgYr10U+iigaokFzyLsKH59hF67q4snf0SvWyLXXMsUv+W2neMeDU2rqsasgpItkwtnpjQLuxFf 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)(136003)(376002)(396003)(346002)(39860400002)(230922051799003)(451199024)(1800799009)(82310400011)(186009)(46966006)(36840700001)(40470700004)(6666004)(7696005)(40460700003)(86362001)(36756003)(82740400003)(40480700001)(81166007)(47076005)(36860700001)(107886003)(83380400001)(426003)(336012)(26005)(2906002)(2616005)(1076003)(478600001)(5660300002)(44832011)(6862004)(4326008)(41300700001)(316002)(8936002)(8676002)(70206006)(70586007)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:14.4492 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b80050c-ba0f-403d-2f09-08dbbf627e04 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: DBAEUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10053 X-Rspamd-Queue-Id: 7542720096 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 8q5do4y9qdqtkegjt433md5zfsbz1ap5 X-HE-Tag: 1695823409-342100 X-HE-Meta: U2FsdGVkX1+wa5HvDk2tnEQGaBRz9mjPgpnY7BqiNQpeT6oFAzF3+e3INKwoOkzZBTzU8LqZlltic0LY9QXOCcTOPJ8aqcBvSCOonzOWGKK1PiS0enS4sMuB7BxeC9n9Gd8K/EnrSPb9jBEkXtKKL41IJm/0WRw+uy81jUvapKA0OKfLhNd8sALJIuncQCR+wFqixCFyrc1fOtZmpbsuIRNjSdfwEQNtHftzTcDzYhNMcH5I1lhqa0la0Qbxx2Gl0PW+JVHOEKYYyDBXYFOzT4LLTWS8h52lPWmt6h9Osmst6306ZRmLnm4ZMVg8gk7fatrm1pPOvaQZOAnOYE1hQnC2gS7X7o1ZpLHbo5mi1W3cjSA2a5AVLxo6PJtdk68DgV8SkN+vxUiNc7A/zR5EHwQgUxuHovL22Yq7UJVjCHvrV3/Ta4tO26kKdKJEO8RjsmIzoK6VqO3NIkP4wM6n/gVRpmJtV4y65IvfTxzXZ4QRIF0SrH4UxqXhTPXoQ2QCgaP/FUY1SA3e9edTAWR4NOGKuB3pfgzP2pkC6WCKvzpUcg1ap+PjGnZK9KgVv7Navu7JqC5RrIUHMqbhCme0/n1YzEvhDBDchjs9gqybwfrKOPAoH2jaNYJxtQL++jjeeBotbshUWtCBQD2AIEMghepCjx12gU1zkInXnEN7l0pwwm9Hlts7XY20oWdwN5Wfl6S3ZX/kYs2ELBgBr60lRAQKJmCKDgdNkZ9I6OWCGrBr95XTdSJZB6A5N/eIvLLLADs8/bgQMSINt2Yc1xboOHCGkATlJ1N6kRV3xLP4swaOo5JmWCMrcz5YhQLYhUaxrF7CVBKSqvyb/xPeooS0HdQ1PfgUAIGm4lcJbq13lGUBY1bM4pUgf2bETF44GDN55f+omAg/sdSiSkuKsdLWjv+iWNPKsU1NTXp2h/wfWlZGsVORiTPn+1Mhu/aEXFmb+Z8O7YkyxkE5l6LcCRK pyy0fTY2 TJuG60sHxv3OSrV+El/a4UR0C/ROUqABKcKMrFpAixAiNex+bbUldRPWHoz33Ick0D1+DAMj3sFhImvmq7BEGXroEwNjIDpNTBOPqecAIxswaGAD92oY05eFitOi4RyrqNdrdeQWbHffGBTRA6lGcrn9XA5YJNnhOOtouZ8crY2SaPv4pg6H0XTDOYSwjfGHp8U0ZzhMDTXYrLo0IGI52YpbO1G2Yswcc7G99S0LkhQ9iZ6PAey0lqslbxHQc6okSRgDWocRr2k2ARtBxlmmHO37Ur06iJ816awM76CSw5LBi7YZzKXR9siqwXbo6H5RQl69fJMJWifVDFnUWCf5q9uLXdYPESCtKcgYt4kOp+AmJ7q1p5uYbE5Q/fFYHbmmUdgOJ8LvA9SxPG6Nsb984Rt2MCYEdhAsNXWbuwG212zsow+JyUe3Si48BSbcFVSJ/GmQHVBAR0x7ROilqybJeJduhzH6TuwP0Hkw8PAyrBq0tphMeYmezUnUkJ5HHbMaEadPd8KWq5NbNknSF0jFn7O+Z+RN42IY+FfFLI2iYRoNj6zk4BVhxcMju/hC1AHQS0RniDvmk47YFRTX8RrFHtAdjDv0pFPAjUJWz5/k+qSG0Ejg= 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: 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 From patchwork Wed Sep 27 14:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400857 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 B57A6E80AAE for ; Wed, 27 Sep 2023 14:03:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 51AC08D007C; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CADB8D0002; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36BC78D007C; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 25B948D0002 for ; Wed, 27 Sep 2023 10:03:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0351B1CA9F2 for ; Wed, 27 Sep 2023 14:03:28 +0000 (UTC) X-FDA: 81282544938.28.7914DA5 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2053.outbound.protection.outlook.com [40.107.6.53]) by imf19.hostedemail.com (Postfix) with ESMTP id 8091C1A0121 for ; Wed, 27 Sep 2023 14:02:54 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5Ab4Y5tz; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5Ab4Y5tz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf19.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.6.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823374; a=rsa-sha256; cv=pass; b=4us4n/tBCGdx5uTgaodapksee03Qan2bgHlzemP/E6m4qRTP8fPhiNHtrIF4D6EoMiurZ/ XrKcikU6Y8ERHcCtD1poF5CC/Vc2VqUOmdvT334YOvWhkFhb5V8XgJ2khPIMtCFBDap3B+ NwtydRZ+5yxy7Ak0imRab3yVJFGRJ18= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5Ab4Y5tz; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5Ab4Y5tz; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf19.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.6.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823374; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cEphZ7FSAyhFA2gyPB5fSFck49IXGee0EHT1BdmiAgY=; b=12MxaaIWtDo3TacavQ8HV8ocf5RzFNqCH41nvJJuSDlCCNk4z6ChWQUCi6voZvKgvhKy0T XzAGMduSaFI435Ip4SISrPwOVip4Zzat5R84opMQ8/QHzdQsM0x//9WRWTyK9+oCF0d7hQ DIcgDK2PpI2QMO2qbMXpWfXcaSdPF0Q= 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=cEphZ7FSAyhFA2gyPB5fSFck49IXGee0EHT1BdmiAgY=; b=5Ab4Y5tzLAGhgDjLLGh54MhvwGmLAs1NyAVkA4UIK2grMeKrZg1hlmV1TVwfHLz7stzrZtPXP/KVM9hjDUkKnCjoD9BoSXP8/D+EcWMiyE3vDM3S39FsaSpgRmAyWHzccOBRaw7rvQBaKEK8I0REHfDX3Djm9X+ASieBGS/OUtc= Received: from DB3PR08CA0015.eurprd08.prod.outlook.com (2603:10a6:8::28) by AS8PR08MB6536.eurprd08.prod.outlook.com (2603:10a6:20b:31d::13) 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:02:40 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:0:cafe::f9) by DB3PR08CA0015.outlook.office365.com (2603:10a6:8::28) 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:02:40 +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 DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) 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:02:39 +0000 Received: ("Tessian outbound fb5c0777b309:v211"); Wed, 27 Sep 2023 14:02:39 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fa27c0bf9af9bd5d X-CR-MTA-TID: 64aa7808 Received: from 2ea7227955ac.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C42703F0-08CF-4811-87E8-7D027541B34C.1; Wed, 27 Sep 2023 14:01:49 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ea7227955ac.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VhY2LWKO9C0VvSLR6ovgW5y7O832Bb3a8WKiXY9XO+tZtQD7bWTiGpkZLfQMuONPwqVl3t1Uaaohnc+yrURC5FspKo4zx9arUz8ltzgYaIfXD+AJtR6zpCUiZA6a330Oj4nosz5s+MSpEo1webgnU2nO7EvLrwoBu8sF087ncNpAoX6V/tKBSuziL4MkeGKnMoZEbz3flI8ERmeVfWubwptH/8Qgdzi3MH4zlLKRw098iMx74S7jUKKq0OnNHPyKilyiua8Q9gmry3ZEsP3ZitkKoz0OaM2kiAWfKrOFyg7dmN58fr43lbMei6jaBsSjCrh0b/marAfbsgKkyArWdQ== 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=cEphZ7FSAyhFA2gyPB5fSFck49IXGee0EHT1BdmiAgY=; b=ehHhM1heIzlzjpIs/Uha3TjD1IEgUssuYpWuHfsOa5b5u5nJAuIlKCz8LeJr1nlXYx0J12dl2oZTYGDkFzRCHRbz4ugfzESDkKZYxwssdeLV9DdsQTycOMI1JwXlYo9Qvc9ZTCj+bZgi11cnAJbmbER022U1eW1VGZdYlCBMnPmY804rI1ny+DlxppyB8iUlPO967P4kQA7juhu2E891Lo5oAV48B0O2xsyhfy+4wk0jhtyjHgM/4K3QStLuhbQd6pygBObhvBaVJi1QEwOFJeN4Rc40L0HCWLzyBCyn4t8kKCRnNUllg9RpjOjkNwG9d9S+8HLV476l8OwvHQSNGA== 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=cEphZ7FSAyhFA2gyPB5fSFck49IXGee0EHT1BdmiAgY=; b=5Ab4Y5tzLAGhgDjLLGh54MhvwGmLAs1NyAVkA4UIK2grMeKrZg1hlmV1TVwfHLz7stzrZtPXP/KVM9hjDUkKnCjoD9BoSXP8/D+EcWMiyE3vDM3S39FsaSpgRmAyWHzccOBRaw7rvQBaKEK8I0REHfDX3Djm9X+ASieBGS/OUtc= Received: from DB9PR05CA0013.eurprd05.prod.outlook.com (2603:10a6:10:1da::18) by AS2PR08MB8718.eurprd08.prod.outlook.com (2603:10a6:20b:55e::13) 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:47 +0000 Received: from DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::e7) by DB9PR05CA0013.outlook.office365.com (2603:10a6:10:1da::18) 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:01:47 +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 DBAEUR03FT051.mail.protection.outlook.com (100.127.142.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:47 +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.27; Wed, 27 Sep 2023 14:01:39 +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.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 10/20] arm64: mask out POIndex when modifying a PTE Date: Wed, 27 Sep 2023 15:01:13 +0100 Message-ID: <20230927140123.5283-11-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: DBAEUR03FT051:EE_|AS2PR08MB8718:EE_|DBAEUR03FT040:EE_|AS8PR08MB6536:EE_ X-MS-Office365-Filtering-Correlation-Id: 70443957-3278-41e8-3f30-08dbbf626933 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: AhozLqvD/pQmxSKeVXhotmDCw+96hsgWioF2MeqpnGubt2mzspKsM9RprcSvKVCF+naCllJlaYBncoVfcj6kPfD1yt8fKpH+d/OEcQ0OyYEmrZBxgSznTdnXtgmtYu5jozqaMXE2OKfPUnuRl9FzL9lhtfP5IGJNh2jDlOZxeYoYkYuSzY5X4HzPnWEqQ7q5gPYCO8wyhfpPR8mdau4tPyH4/7PPwD/dtvSujvNL78lc4fIEf7vSwnarLA/YSdFjEt6CGSy1enWJV06xs5ZEGarT63G2YIWQPmhLPBZYWwzaUnS7Dt7eyR7OwbamkgdDIXGYiV/lSx42TGkcggHegqjzVci7fWVLDKtTUx+tIOHChzOINrqK+AMZcY2uWBw6ne3AOcvsjJeS3REZDB1ZxSjYXQ1Um1ncKHALU1GecvqF7DwZIZxjWWxnmLVKMCT1NVFJuPRzQpv64vHIKTRz5YNJUBQ8SPgR/363AUn7szDrl5tsFlEs3gBgT0lyAt8tKMd3TWjpTN2Vb03gsImSAQkzfjurRM2SW19ya6iziLYuGgQ7mHpEW/b4wKmZ08/5XgKl4242g2vf6HzGdFlZG4h/nsaa0Hv4dHOvqm3IxMc5mrS2SDmEEIs5V1wqEAjP8Fm5XrOVjnEv1pV37QNuC6oEzsbejoDu60ShhTj0R1BWyfcPLKk8QxfIoZy/ku8bkcZkEpMeZFwChtQqSaFHR92Dr9laUnhhQJHyZFOps09WgdzfheMthAreK1a564uM7BQo2oSF6aMEKEC3G5S9FQ== 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)(136003)(376002)(346002)(396003)(39860400002)(230922051799003)(82310400011)(186009)(1800799009)(451199024)(46966006)(40470700004)(36840700001)(40460700003)(44832011)(7696005)(6666004)(70206006)(81166007)(356005)(2616005)(70586007)(6916009)(54906003)(316002)(478600001)(86362001)(36860700001)(47076005)(426003)(336012)(82740400003)(1076003)(83380400001)(26005)(5660300002)(40480700001)(41300700001)(36756003)(4326008)(2906002)(8676002)(8936002)(7416002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8718 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b42636de-6186-4c5e-744e-08dbbf6249ec X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NGkbyQ0HBy50DzJvmcjx77sStos6c5r5Vz9vwgfwdYgYcureJbGji4tuIaaJSg/eNGo0v4x9Z/C/s+y12/wpKC7Zyy9teHAz3+j0W+YsI9y5/D3CQmto7flxTI2tABlK4xfOz5mOIkHbO8lOnbQU0h8+wwhbcgwB80MGW8HJF1S20yxatqE3j3wrcMUXNTtVXmKSkTwcL0QagZpGCN0wA77cUOaHygBFnhQbxyyVA6V433T6xIa6DBatkIivfLRd/ppj1kK2Rbv/qjSeGHX5peJzSQ8aEQ+cSOGC3KBoi1cOT9EgLISLqFhAU1Mc/3n6mtEd6kcEFTqaaSiT6SuXDITutmGUaXHjBWNgOicIjF/ytV8MMVk2n90tf0YCsUQQu415Mq+5BA4VzZ8eQ3vtr6JyKdEQZCVT0b7klaGFimpij5cRRWHUu9m/4A37izJ6zYZkqgZrN7Kd5MMgf8nOoKgp5vabCgE4fP2lfqYT/pVoIiyYZSsGCZhkZU/xa9fVfDeBid6AFVA//GqGVAHStTjSF84hu03HjOSrVAr098wMphdBSqlQtrln6Y2RwNFNEdZ3i8YjV+D7Ujc7urPhji6OK62oP/vAv2mAkzVyW9VmeyAIcg471LSSD2pDVhacPCSUgMbbGJGsQON8MKHmXep1nBpyhmJ4CKBYkk7byCBRkeVce6K5gM/fpJLTas5itn+QII0L7ymE7iZmf8+8F41tHa0w4nQDhiNvXzzkCsdecI2tmmFE3GQiRoVPSSF3 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)(376002)(136003)(396003)(39860400002)(346002)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(36840700001)(46966006)(40470700004)(2906002)(41300700001)(44832011)(5660300002)(8936002)(4326008)(8676002)(6862004)(70586007)(316002)(70206006)(54906003)(336012)(1076003)(107886003)(26005)(426003)(478600001)(40460700003)(82740400003)(7696005)(6666004)(83380400001)(2616005)(36756003)(47076005)(36860700001)(40480700001)(86362001)(81166007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:02:39.5254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70443957-3278-41e8-3f30-08dbbf626933 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: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6536 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8091C1A0121 X-Stat-Signature: xdf5js7ju1ebg3fbdw64ubtykf5aj498 X-HE-Tag: 1695823374-467205 X-HE-Meta: U2FsdGVkX1/G9H8nnW3ZAl1GbcOmq3XocucDhRYXRF67jbcyqVroH40cd8mK/YkPR1eCfjC+OM6vwWLhXahX6oxYxsFyfyFFiJKqSfr+YeRPuZi1x1LZIBg03KmO3HudIS+zYi9++xeGw3mF0aJDhV00LTjgtgZnf4TrSmartHA03IP0bmiMZsSIbKSC6WB08Fi5kfeiwJ1/ODwhNJtFTkDMFcxmKk+BX8FGsoncLcInH6dUZt0kmPSLN1zpyy2yd9CFQeQot9gGQjgqEDq4bJ6vrnTkfTvoeTIJsAgaJuSJWp7KTFFQXZZtL3/6lW6vCdvi8JvPZYJT009drW8fwqxIqyur82/LkqoZQdkZ4AHckxF7W1OwFa+q3pV1xhrNwWdYFjxrPPBXCp8VUdBjuTN+6pm0u9z2tr1mzXf6ewmmYax4pITOSYRWW8CCgyHl6Q1KC0bsvHGPAo49qQc5zqBa4f6wHa5gsiYdqQ5oztE4Rh7Pi7pz/OcC9ddkJ2quKWusnRFQ6XdStYzWE3IJx1OUoxK1rGGTqh2EoJQ2BKhfT7APef7XMOB/rXjeDpvn11fr3En5RPQ1fQKFKBWiNtjxQ0UMXlAimcCVCnG0gE9L07cLgIA/evscY2R1A5eYv4FrOVAELyu04cnU3M53xDyxUttvZYw/HhmbPX6b1ZdzMDIeJQjc4++ixJlhufkcnEw7W6BmvxO0wit8LDWJNkIFqQ+81OE4+bjhusaCRPnheYoPW5YIdkUoPYRL5uNBYjsJCBPo5jIlIU/xAI96ZaCosB9ZX0W1V4Wtc12n7jIrNamMOGOzSdlIiWZ6M788EzcaTlrb73ExuK8aeCvDFtUShnyGtFx1WiwVBi5/G5hNIrH+wiXZByQT5AKyTIRDNF60JJX/tIuhVPqJHqJSO7MKg/I/Hsc4Wni73EEQvYaGFlbN/KSSR71BTi0jy8x/r4FYRjIoFDQ+QRJBXWc Mjn6Kwev MN4QWIsNF5l3Crq1jRKKBecf5niCwqjycozFBgQ6T8cEkFI5BTXmgHjDslmjmMaNX2mjyEk7WN+IUUCerLSERjD38L5UQebskP5ALealjwdfuKAJMT3asmPWxZeNPjXuba3lAOt0YO//zyyWwtkmLQJVnFRmGbW7WDtoFAyFytEPVt7R8zm4P1nWPyuNAX1plXnNt+iGsU9PqTzjFWSvaPIN0Z9mCH+qzNN0IY7DvZAn4bKFU3TsXkcSIKdJDDRgj0pRHNjYpr37MIUwUsLRrGbVv+iKyczYVAjH+BdcBjQT35Sbyf6StpJ9ZIYRtFo1sGunnvvKtcGPEXfYgnCEA5DvBLv03GZXQ3nAbGUZuwcgZ80Ur7RmBxcALYwt33NqEuM33I+0OosJGHwAePYszX6j7tZWAK1wTYmTzUye0+j+SNVM4szjAqOCAsjCgfTzWY9SsT9+36gAnu2k7uaJxe2WnOCEvKAG6mXMKYoplyEzJ0HakW9qfswOwaPQGVsergfKjoPiQImJOgK/nayfvdBFzYbHLjrikwvL53wZD8AWrYsH2nHOAYsKr7DiHk4+kXjFm 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: When a PTE is modified, the POIndex must be masked off so that it can be modified. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/pgtable.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 7f7d9b1df4e5..98ccfda05716 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -818,9 +818,10 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) * Normal and Normal-Tagged are two different memory types and indices * in MAIR_EL1. The mask below has to include PTE_ATTRINDX_MASK. */ - const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY | + pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY | PTE_PROT_NONE | PTE_VALID | PTE_WRITE | PTE_GP | - PTE_ATTRINDX_MASK; + PTE_ATTRINDX_MASK | PTE_PO_IDX_MASK; + /* preserve the hardware dirty information */ if (pte_hw_dirty(pte)) pte = set_pte_bit(pte, __pgprot(PTE_DIRTY)); From patchwork Wed Sep 27 14:01:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400864 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 EDEEEE80AAC for ; Wed, 27 Sep 2023 14:04:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89F588D0088; Wed, 27 Sep 2023 10:04:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84F2B8D0087; Wed, 27 Sep 2023 10:04:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62C2F8D0088; Wed, 27 Sep 2023 10:04:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4D85C8D0087 for ; Wed, 27 Sep 2023 10:04:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0C47E120970 for ; Wed, 27 Sep 2023 14:04:20 +0000 (UTC) X-FDA: 81282547080.13.FC54128 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2040.outbound.protection.outlook.com [40.107.8.40]) by imf29.hostedemail.com (Postfix) with ESMTP id 9F1F5120041 for ; Wed, 27 Sep 2023 14:04:14 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=H8Hg7w6A; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=H8Hg7w6A; spf=pass (imf29.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.8.40 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823454; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/I92rNNx5TqEbey9j1hFMnq7mlmwNIJKGHIEaPtAbF4=; b=qwe74xk+0yDCHmjilB4PB1sksjj9wq5uQUNMeiEb/34CV6et1yqx/ulO0YHdLe8n9pFmTA Sby2qj65N1/pDhlvhoLm1/jiZEJ9Q5Vj8PNoiiCP1I5SS3qFtJb8H2uS6DTDFk0DpGzNcM OxGf0f4UvAK/5iOof0ZuYcSRazo6xhg= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823454; a=rsa-sha256; cv=pass; b=UtES2S/PGs+Sx/YNpBSH4KTRrIWKm9UoJKlTIh72xeUUSNF++9NQwM+NDS8NH/+MFHoQwA TM2Kj6zh4Nqspo2PPN+2k39wjJosk+SPyrdkolg88woBxrwqfRMEIWZ6go89PjFZTuqQEK 8ESFJmRI57L0Zt9PXgfARkmUaAo2XS8= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=H8Hg7w6A; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=H8Hg7w6A; spf=pass (imf29.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.8.40 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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=/I92rNNx5TqEbey9j1hFMnq7mlmwNIJKGHIEaPtAbF4=; b=H8Hg7w6AF7OPMaH+VaipT3jPK1K42vvXg9JCuSTzC5i+dlyDofwHIRXQ1MY6ps6b4izIMs4y2glSN78wCOJ2usso3fI3pSxP5BSghuSEHnAcA/aCriehlgQxZoHVEEX9Ic/he40x7j/rjE7ltloJZR2dBBofJ21TkuScg6CXr8Y= Received: from DU7PR01CA0018.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::12) by VE1PR08MB5677.eurprd08.prod.outlook.com (2603:10a6:800:1ab::17) 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:04:10 +0000 Received: from DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:50f:cafe::34) by DU7PR01CA0018.outlook.office365.com (2603:10a6:10:50f::12) 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:04:09 +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 DBAEUR03FT062.mail.protection.outlook.com (100.127.142.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:04:09 +0000 Received: ("Tessian outbound ab4fc72d2cd4:v211"); Wed, 27 Sep 2023 14:04:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ce9f6ca37187b3a7 X-CR-MTA-TID: 64aa7808 Received: from d2cae1e84635.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50FED27A-8C4C-4666-BC8E-587532D495E0.1; Wed, 27 Sep 2023 14:01:55 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d2cae1e84635.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zlto4wgR4Gv99odT4ptsR25bqtIAAHTsGfkPBPz/Vq/ol1fvZCogvFu3ZWrIetRB8EaT8x7efpLPf3FGjaiUnqoAfbph5JFQkSaLGLpWCrdDy3l7YZ/livp/OdinHah6S8SwrcvF0JP3jz0dpWHNp9VIIGAO6uh/PKgx+sNYVMyRzs/Uu+eUX0X+b1uZTN6MXo4hfTx4KdUFboUuhAdiQdc9GKuXs33hsGhdfcIWAypVSuz11Vyq+JosrmNYE3V8PyFznnc3kkzg0Bc6erjMXA0NNZ2P8YtJ5gDTC6fXLz2XErYsqqZcv8Yb8ocD3uqOb0iCC8T/OO6gMFkjTgJG7w== 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=/I92rNNx5TqEbey9j1hFMnq7mlmwNIJKGHIEaPtAbF4=; b=kKnmc4iLPZiDuKpVpni2AQsHMrku8mIkP2dmhqCM6veHpjeIMCU/bcq1I73BMqj3MGrJce+y2W7Zdt4HVVoc3Ah3Gmu2ljqLXEkmKG0ASz4IYIAB7tJrRYmUyL8JB1pNHQo1lQrv1OKbXlF6yNafOCzwqlA1x66wE1YeWkHGLf9IF7xguVztMGPmynJ8xyLLO7P31QhjJHO6SO/STlH1BmPz/QEFGI6j19KUGT+4rGnkWdN7V93uW17gKwFi1/w8eDxrsozqtEFf5GO8hzrAt2XwldP1kPWpyGItUzyPpbnNyFxJS/CarRsSiTcUSTE0Kv2APbrt2XvmQIEXhm2GkA== 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=/I92rNNx5TqEbey9j1hFMnq7mlmwNIJKGHIEaPtAbF4=; b=H8Hg7w6AF7OPMaH+VaipT3jPK1K42vvXg9JCuSTzC5i+dlyDofwHIRXQ1MY6ps6b4izIMs4y2glSN78wCOJ2usso3fI3pSxP5BSghuSEHnAcA/aCriehlgQxZoHVEEX9Ic/he40x7j/rjE7ltloJZR2dBBofJ21TkuScg6CXr8Y= Received: from AS9P194CA0026.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::34) by DU0PR08MB7785.eurprd08.prod.outlook.com (2603:10a6:10:3ba::22) 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:01:52 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::6) by AS9P194CA0026.outlook.office365.com (2603:10a6:20b:46d::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:01:51 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:51 +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:39 +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:39 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 11/20] arm64: enable ARCH_HAS_PKEYS on arm64 Date: Wed, 27 Sep 2023 15:01:14 +0100 Message-ID: <20230927140123.5283-12-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: AM7EUR03FT013:EE_|DU0PR08MB7785:EE_|DBAEUR03FT062:EE_|VE1PR08MB5677:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bd687da-dfea-4c6b-08c4-08dbbf629ef6 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: xYCsGDyUPN/PmUgZAqlashireo/7GWtX1/tR36YaVmBBuyikWn0RalufWOFYAfSi6zBDNAh8SLBOFC4505P0mRwC/bazQdkMceBPoxPjWWt+CTd6K99zYUnaq4PSyGIBybXLaIDZknhNRs+iR6MdI5kVVZ7SVZf3bx3bGmEd91ohTv6LLFNR76+nALNftxEZt9bQKSeP9tDtN/hIdszi10QBJZY489+pYF0UM7cfLX7r7A65W/1xenmMqQ8nGEGVCoQZ/C8ZkAuwb9yRUWjyDrirU6xjR+aHQXVLUgcdcwWvYQfJg6uttSo/82BKOgxVEvkykhEguazauSZtm7pqFz+8rNclvAuqBZXG83ac4pybtMnQbK2PCTwhuOQ8d67+bbVOcWp+jAi+S2NCU0dq49Ba+hGby5FQ3i6JkL9KLaaoSCrRyaJIh8BC1TfFJYPTYT9el8cpi0AVOEJ0jRIwb7lasFgUC7W/u/6IbiFjbKSKRG2aM0qmzlup5Fid/hzNTYFA1eUV5R+Ad15qECO4KIvfAHRXvhkkD2C9i1tfouPnV1tWB0fC0HCM9C2DnGgPZ3/zttm7XaOFG1p7GCAamXTiwIOZHgpY5SqaC47rVrtER7hQa9a2JtExf0q7Db2h0Hqby2Hm0at5nDkdcIaaJwi3YoDllwSss0JhQUM+kN7tujUR+Wi2QlEi99A48q0ifwM4m9j+wy9jiAAxIyrub8sbssd6PYD7eSuSgBWOtlyJ0B1Kaci+2rZv6PnSt7tfEMTHhvYxMxrQbnJ4/UN66g== 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)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(1800799009)(82310400011)(451199024)(186009)(36840700001)(40470700004)(46966006)(26005)(6666004)(40460700003)(478600001)(1076003)(2616005)(336012)(426003)(36756003)(82740400003)(81166007)(83380400001)(86362001)(356005)(47076005)(36860700001)(5660300002)(7696005)(40480700001)(8676002)(4326008)(2906002)(8936002)(41300700001)(54906003)(316002)(6916009)(7416002)(70586007)(70206006)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7785 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 11a7d343-b7db-4e37-6fe1-08dbbf624cc6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R4C7bWhG4sip56f13doigCcMJGkq8qqDQwZPAWqerLps/BEX86UXnWPYM7fjLbCxIgzd/er/4PEGhrTxJZm2tGjvhNk+iJ6Wqf2gYr5DPOL704/8OYqQV3ONQrNd0pscZdj6Nfv2VRMQLpG77dnsWyYR7dEcnDtsa71MuytUgiSvY/P0npKEYpqr1pnlW7jLKbb4t2rwphCPKIl4mv37yn7ZJ1vgGLLXmyoK+ExouT7mkjyaFbews1goLKlMFdnfoqdKmKJnqBhQk5jLfzspD53D2OR3QwieeU5wNbIee1c6vj77WT7rpU9tKYckyR6p9ezW4DwTu07AIJMQNs0PQh5xeUbm7ueiLZJNZyh+D9HhZ9Z/NkbCdLg2NMftor0jXc9FCFdqLY3Qrz51xxiztVzBStesPLyZCsz8CICtCzbqLnOIm0Uz/5a+rTKFVTwpESkzREvs8WDBebFEyt0C4iTHEa1+wow2YgbLYel3il0kH2I9LWuXjMPku98ATCg/4dJZteOu5jEN4lmrLPSijdYc/wl79tUsUtDDqekbSukIupbzjbrZTJZqMQah48DtmKQecWGjeDOj+rFsNoVTgTC5lnvyYk/Bv6CMlV+DSIRB7/DpoZoSduHsrVKrP9hrfjLQERiNXkDKSlZqVR5n3kiQamByPnpvjPoFMB+yJ3yl16RxiRIcDX10FPL98WpR/R7/caF7H6QxqJWaLhd5xQDPY7PPDWsoKWLDTaQR9su2Kxi3oSzl7wIvrNQTvHNq 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)(376002)(396003)(136003)(39860400002)(346002)(230922051799003)(82310400011)(451199024)(1800799009)(186009)(36840700001)(40470700004)(46966006)(8676002)(8936002)(41300700001)(6862004)(44832011)(426003)(336012)(40480700001)(26005)(4326008)(2906002)(478600001)(70586007)(70206006)(316002)(54906003)(5660300002)(7696005)(6666004)(107886003)(40460700003)(36756003)(36860700001)(1076003)(47076005)(2616005)(83380400001)(81166007)(86362001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:09.7212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bd687da-dfea-4c6b-08c4-08dbbf629ef6 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: DBAEUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5677 X-Rspamd-Queue-Id: 9F1F5120041 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: dpd5dob8jtuipx6s67bcxxxdgduoh868 X-HE-Tag: 1695823454-941529 X-HE-Meta: U2FsdGVkX1+GGbygsBlsJwwk7aHMcHZKZkZRdaOcMotD8ch/IfQPZRZWpMXnDSBzSyjVYSXjujBwNXXwoZFlSPccprdtmDwZva8OnVDnNHu58nDT3hUQxD4q9BFC1NetAluE+i3oWHSxQqXPhBJfnY6qCdKiKH7BvSOdDay1pzD4KXuGKOPs9n451+BWc7s4FJwqhps9Ew+iGZmhcrGGNZBXyZV1VgqfZXoIuWXSCoXnUWjiAkDMNBoV5MGY7dpGtuR1Gb5XrciBj75/fFHqznC/EPUcaM32xCE/70d8zYYkyhml0pEifWIkQNhf5vHLNBoYB5C5OCm/3rQzZeDsUwn1/Wjr9ePShXoQgO2PBQKpIV+BNSAbg3OpGJfeEJTRzkiRCp19lQWlfQGvA/exndPGlY6bBqXf5QmBaXjsmPpVXZClxAOBmnba8fC6yZFUK03R/3K2Lw1dinL6+pXvUicZHgpu7WqLu3+yKvbocG0W0makGUpYrCLobmEdC5MvLdDi6nv4AsslrOljTSBa7meZSRUqhEwFuVHNZO72A4LhPJ7W0QvUZA2oO6SWd0TBCf+elKfDBEGnq3sYIatbgNKp8hkGx4JYMw8QR++sgXeD0CvuePsT8LsjnSloC8Yl5ug93I0dExNQPqJ7aDPbnEMpMbf+5nHLzXs5/r3oeEnNIrhEYXthlUXCk6rOWJGyDh25iCw2d1adqfI/2wdlcsuG3mN9eAppekH++qLApFXpUFNmfqu8JMQBTDovAeRkRoazgi9q1bXYUIo9UtXT/xHp4X92lh7Tfh3w5MABeN817/NW4V1n14p9e/uGztwPa9RKtRmHYQzPKYdPjpoVtpBUbJeagt5fb7OJevVFEPH/TBU+igW4kweY8UAJfj7vB9d3a+mk5l+2v+ngLnE2dnXY6EjIcU8pFRXxHOmsLi9xD9f/3gsiNDMXLYPG9qE66pP7xTaneuEIfS9pO+2 O0JYlqIO /AHsNUYbA3VAFrkRvw+fIWWDIAOmPH7o0UfBtSZFCsHPwfwjKghnrULpbJe99engrwNsZcHinZtiMsJqCeSNtYnwcKU/ECMQo+lh4gufibp3koOfKHkqlOLLhoSmJB13GI8WmBKKgYHiLxtj/lZd6ONtngHXLpsStrdqkDwbHuYONBSEwH9Fm25rk/KYdcdOUQGG4+b3ueBFdglDUBIWPd5Ao33Z3EitktilJeujiAcRWVhJEeEG9tEVrU0/HI2mgRvn7YgtzfERE68ITE3KzFfvBeCaDfFLmUY9McZvwHneJqwckRs2kgsFZcv1xkKhZKIXiX/WRe6TB2Fqoh5dYY33VRdewyJPgSnO68uzThvIioGRlfdt32oBhO/wRhkHkNfhbWvcZty8wEKoNOaUIrneF5rdsMMadHcvzmqzvO/o6qR8J3DJZhWNdLIK0hViQKftMf2Sj7z49cji4rMRGOAAmWWSXXqpC/FjsL0H+npAmbJ6rAPDHoOzg8TGNs/MHCAqNP156uYT/PsAvv4Y50X0WNlrYN0+iavZZgqzPa1Kr0SXX7qfnXluvLS9qv4c97i19AxmiW+ohtXIKtUbcC9BSA1GtZu/xfT9QR3e3kAgTGgk= 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: Enable the ARCH_HAS_PKEYS config, but provide dummy functions for the entire interface. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/pkeys.h | 54 ++++++++++++++++++++++++++++++++++ arch/arm64/mm/mmu.c | 5 ++++ 3 files changed, 60 insertions(+) create mode 100644 arch/arm64/include/asm/pkeys.h diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b10515c0200b..c941259e0117 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -34,6 +34,7 @@ config ARM64 select ARCH_HAS_MEMBARRIER_SYNC_CORE select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_PKEYS select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_SETUP_DMA_OPS diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h new file mode 100644 index 000000000000..5761fb48fd53 --- /dev/null +++ b/arch/arm64/include/asm/pkeys.h @@ -0,0 +1,54 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Arm Ltd. + * + * Based on arch/x86/include/asm/pkeys.h +*/ + +#ifndef _ASM_ARM64_PKEYS_H +#define _ASM_ARM64_PKEYS_H + +#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2) + +#define arch_max_pkey() 0 + +int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, + unsigned long init_val); + +static inline bool arch_pkeys_enabled(void) +{ + return false; +} + +static inline int vma_pkey(struct vm_area_struct *vma) +{ + return -1; +} + +static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma, + int prot, int pkey) +{ + return -1; +} + +static inline int execute_only_pkey(struct mm_struct *mm) +{ + return -1; +} + +static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) +{ + return false; +} + +static inline int mm_pkey_alloc(struct mm_struct *mm) +{ + return -1; +} + +static inline int mm_pkey_free(struct mm_struct *mm, int pkey) +{ + return -EINVAL; +} + +#endif /* _ASM_ARM64_PKEYS_H */ diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 47781bec6171..3b7f354a3ec3 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1487,3 +1487,8 @@ void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte { set_pte_at(vma->vm_mm, addr, ptep, pte); } + +int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) +{ + return -ENOSPC; +} From patchwork Wed Sep 27 14:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400863 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 B69AAE80AAF for ; Wed, 27 Sep 2023 14:04:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36E5C8D0085; Wed, 27 Sep 2023 10:04:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F6588D0087; Wed, 27 Sep 2023 10:04:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 171A58D0085; Wed, 27 Sep 2023 10:04:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EDACE8D0087 for ; Wed, 27 Sep 2023 10:04:15 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A4D4F80989 for ; Wed, 27 Sep 2023 14:04:15 +0000 (UTC) X-FDA: 81282546870.05.CCFFEBC Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2041.outbound.protection.outlook.com [40.107.6.41]) by imf09.hostedemail.com (Postfix) with ESMTP id 7F0A3140036 for ; Wed, 27 Sep 2023 14:04:09 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=C3G5pwol; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=C3G5pwol; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.6.41 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823449; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CtQhUKKAeciLMz8eOcAzcWfX0r2cwo1XnqJpJwevaOw=; b=AZ/bQpr0SQRId/GlnSLf0fazi7xP+4QTvc2hcF2LkN/n5xUfA1QxifHfbP16uKs7YFLivT 6B7oKV9s/c+9tnTtlYpALdlscMi5LzjFcyRP4kDyV0vdo6dF/da5w+enZdVSJ+1oxVpOIE 4s4XM4VOoLZRXzF/U73RtZc2Lwka4Vc= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=C3G5pwol; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=C3G5pwol; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.6.41 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823449; a=rsa-sha256; cv=pass; b=WJRIsqUBHEfxexJSKQfUj35vhm2b+ezN9YKw0B9P3phuzzg9aS+n1M+hN5XTgSUzuQ4q8G KOw4yyjKXojErL3b+OjctV6Vb4SpBWYa3dcU547ujEqiiIc4DlZWeM+16/y3dJAOKH/M1N GYDB3vv3F8ldwCJJNp/DqYZAgVNp/rk= 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=CtQhUKKAeciLMz8eOcAzcWfX0r2cwo1XnqJpJwevaOw=; b=C3G5pwolId6E0/SNrrLGnc5x3R1MZyvrL8fUc//Aucc+Rp0cbtgWoO1K5JSvnE0gSgs8TUA6iLfslmrqm3K/UMw2ULdd8blsEcq93AxrzIUxSBETZH0fAiuBMhnSnTwNE4ly2I15D3fyE3naBrvVP0r/KwjmOtEw+zbbgMao6AA= Received: from DUZPR01CA0171.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::17) by VE1PR08MB5678.eurprd08.prod.outlook.com (2603:10a6:800:1a0::20) 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:59 +0000 Received: from DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::e8) by DUZPR01CA0171.outlook.office365.com (2603:10a6:10:4b3::17) 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:59 +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 DBAEUR03FT047.mail.protection.outlook.com (100.127.143.25) 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:59 +0000 Received: ("Tessian outbound 0ae75d4034ba:v211"); Wed, 27 Sep 2023 14:03:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8c0c49c206008a61 X-CR-MTA-TID: 64aa7808 Received: from e06e0c146651.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 705B4AD0-0930-4F3A-A271-0479D60E97DC.1; Wed, 27 Sep 2023 14:01:54 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e06e0c146651.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iTgipIyIGLUaqx8CnxNrhipBpXF/SlrTYhzx+lH3ilrA1+fF0PQmV+dG+MuIuVXfkobWhfBqy1LhokCWi6HOyUjX9a+TkB4qGNQz9lDmyeTlBtAqEQNwVVawk1RdrWNP4cwftkiefK9xaQ+dDmShdj3mdZ/8RTNNGb667Tf8kfezTjGYnHr76peXYeG5+hN2q+UL+IVqj8Pyx3KxjFAZsx3TLeD9qKRBdRwCR56l94es7tudaEt9n0CF+adVncu6ptJalZKKxDbyZFoiFiUhZ/j1JlPOIbIp/WCdyDK5jJXg9jMEQ0dJpxuOc2tQEGzOLmf/9+n/qfgha3idczB79A== 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=CtQhUKKAeciLMz8eOcAzcWfX0r2cwo1XnqJpJwevaOw=; b=VKAOf1uaRWHTU7wrOMiDdqGz9B8/CKRUVV77bPVlDM/zZZV4/4RRDeUCJfLDzOKmqwBuyPKLR3ZVvksBkIx3a1ojM/zcFyURIWRZ67JyyBeqKllZmAq9Yc5zdt6s8+SNHTZgGplOkY+5j0TBR+GJOXBJg3w36F88JLbTSaPZjmS865rVtRoDkDjnYKmATneYozMd+1WU6VIbs050S03jlleqbK6M+95WkFQC9rtXvL+oYC/dyxdqZRuAp/vi+hjCfCMQ3Xu4IK1iB65EyGzZG9ijFUuSvuuMOFBoQ25krnwwo4zPSNHwOyioyLUhFzZNBtJpav1PYSevnqjC+NUWiA== 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=CtQhUKKAeciLMz8eOcAzcWfX0r2cwo1XnqJpJwevaOw=; b=C3G5pwolId6E0/SNrrLGnc5x3R1MZyvrL8fUc//Aucc+Rp0cbtgWoO1K5JSvnE0gSgs8TUA6iLfslmrqm3K/UMw2ULdd8blsEcq93AxrzIUxSBETZH0fAiuBMhnSnTwNE4ly2I15D3fyE3naBrvVP0r/KwjmOtEw+zbbgMao6AA= Received: from AS9PR05CA0256.eurprd05.prod.outlook.com (2603:10a6:20b:493::23) by PA4PR08MB7595.eurprd08.prod.outlook.com (2603:10a6:102:271::14) 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:01:52 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:493:cafe::a2) by AS9PR05CA0256.outlook.office365.com (2603:10a6:20b:493::23) 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:01:52 +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 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:52 +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:39 +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:39 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 12/20] arm64: handle PKEY/POE faults Date: Wed, 27 Sep 2023 15:01:15 +0100 Message-ID: <20230927140123.5283-13-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: AM7EUR03FT046:EE_|PA4PR08MB7595:EE_|DBAEUR03FT047:EE_|VE1PR08MB5678:EE_ X-MS-Office365-Filtering-Correlation-Id: db7e54f5-eac8-47ef-819e-08dbbf6298b4 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: AzNW/jfyN/py6pQnyO+mnLYMGlf7+Ka8Zv3VNpmpyhalAKo+iPntU4LF5pPlWJHLVa+H9foC/UAzAZekswYuh9DhOMQvNLtCNTd7pqvjWlQWpfVLvEUR1IbBBdrLH4vAhADdmadNdn8OIjNPwrDyJRwQgkdFRs4MSrf6rYt7Ilk6rZZZf7XyGHV3x8ZGmG4rFqlQ+4TkyWppjFU2Vw2TH5qwHM2GdRrfzfXudmGP6nCVLYmBq+W0m2bKEQrzDE+xs1LEWYfmh3ytpTHYs6ubNZUM+356zQc7b+LYbN6fQVYCm+9UZsSpIiCXKxSnoLwOc3qGPIOo3izhCE3MmHmeB6ZFY+Scl9Ayjo2N48+xoIlRHM5LsY+EVj/NSWweZ3mGPcOYwH4KQrS90v4XRF1TPYVucrOabF8ZkipQ/e7gGvuTQU8bhaoMNrO07c7dFGDGnKP4oncbJJRE0upySoaUxybRCB3iwGLdOMDf2OXBxeNxNbrit8dL7xJlhtlGU1ISug/ut0Ub5u2+MgSM0iigG0HnFB1LL382f7sFPvHF5tgJ+YuMNCrY6UafBt6duiEx+jW7s047dxAftF4qB+AVWihAWljEkAYa4xoDpu+EGbz1rjLMp5owpcCQQe8SbJEOo9Ux2aj2txihbg1RZWABNL+hDio4QpIqbJg86Q7hLx61kkN7iNWlGsg+La/1BZOfPGbXvSl4NzAABNmHMzblgepjqSpRL0taZZIz9YlBd97NJ8mCRpelrZLKX4cpybGVvyb98KlL8DIo0H3ILHTfig== 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)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(186009)(451199024)(1800799009)(82310400011)(40470700004)(36840700001)(46966006)(2906002)(36756003)(86362001)(40480700001)(5660300002)(44832011)(26005)(70206006)(54906003)(70586007)(2616005)(336012)(316002)(1076003)(426003)(41300700001)(6916009)(478600001)(7696005)(8676002)(4326008)(8936002)(47076005)(40460700003)(82740400003)(356005)(6666004)(36860700001)(81166007)(83380400001)(7416002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7595 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4725d3bd-55f8-4bd3-0ad8-08dbbf624d42 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sy5J3ItjMB3RGoprMFaNZFr92fFrE0Xy8ubYy/rYQDnyesj10z+DGMhXxRFLQscFqoc0cGGXY3x1jSWc2m5EstAY4pnY+txO23xr/pPRPKhuvvNE08yNepdmKY5RJ1bqHo/901Y9LznKwgRoIGrXGEoYjFBk3MmD2K8jRBICwGGi1VWp79Vw1pVUxHOGoNeeVlKaPiPEsVqbowsAEXQEOSSkW1Y2bbBNRGOw4osJvMZxnyKfyQHq0tlVX+mFt/BXO5wKzqYt1dE6U0QJHVKdFNoSG+jhIPcBCytQeiZsJXnx/rHmKecgqxCEK2suvCU3A6aZapKnK/HBw3PBmHmO4m4/QvPmXhOs4plbbpMLFjGGryHNeThYK1cOJjxTUBonM6FhIjLMxeDuA2BmvMCvgvrVFMuCtHA65s7lCjq26o9ZqEqV6NJUIuwhrLhEsbA5jCFoGtBhNBiwK2S2z4qGMs4sAPZWPSr/qhDVzdT+sPXzUb9VP0qy2U/UH3214+IAxeZtRYa5VTvydhBF6EOhuxaTL/aZT0jgkuEFgIm6JCo1ylGDmXQT6hYRuvlkJ2/YfQyUpaH4vmmm1qkJpaPS6mXjLse7ngen5HB5M2dw5ecUntJgK6i1IvTm/KlE5AYPK59KZD4ceBbzql8Igiw6Q+iRheoe+6qaLHnmivUve88FXKH2bd7ouTbYSKGfjRel+U/oxpvCiXqj1yawK/qGPb9OKVm6oH2Q9Gy8kMruj/TgEEdUTOqoY71Uif9yq2Ou 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)(136003)(376002)(396003)(39860400002)(346002)(230922051799003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(46966006)(40470700004)(107886003)(6666004)(7696005)(41300700001)(40480700001)(1076003)(81166007)(478600001)(336012)(316002)(2616005)(26005)(426003)(5660300002)(83380400001)(44832011)(8676002)(70206006)(70586007)(54906003)(4326008)(6862004)(8936002)(47076005)(36860700001)(2906002)(40460700003)(86362001)(36756003)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:59.2411 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db7e54f5-eac8-47ef-819e-08dbbf6298b4 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: DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5678 X-Rspamd-Queue-Id: 7F0A3140036 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: pfcw8kou4moqukbjpfira5xm78f38y87 X-HE-Tag: 1695823449-297427 X-HE-Meta: U2FsdGVkX18urF5pR+vcqGiI+rfZDsydCVUgUX+nJ1kvSsSzdblAdB60GVtZ/V1EnZeWlpSKdrJWrcPpUAQKBgASAf2zxD486wMqPuy39XHVtyVHKFRMcOToysuKL4xFGrxISap4Rj9MRIb2Dc5cekt/hH0xQxUnPegg5I8F/lMoSO5MGT3I67Dv6tEqDo4E/OXHOvKnQb7R3qynVpq0yqKr1IqQD9uw3Vp/LSAntRjBa2KG3r0xE8WR3bapcoeVPpU6WF4XivCQl1NQyEphBdR59+lLXNLR6wAjlrpg7e5vDMk6kbe+iBQdQNyWICxcp8qtC573GSYYjxZUIVguRihz3Dn921csnbE0t3KjiaS6x48snzyUAsLFgUwpszC9KUuulO/g/6T106fuBk8XqdwKas21pChq4osrU2FjS3g6yipbIgDkRC1cB17jVCbTenR+lWs+7f0G0l5iY4G4LEH2R2Gh/h4nmikpX17BkZxbaoFc3Qum4vcmegmXRs0ExqDhp/GglHhaHVMYiBzRoKVLervyWbRbcrc15USl/JUS4vMCkL+VB8djs6sl6n8V9oDKpodC8DCFwcjgUEFpcISGAJPQjNOXODg8ajE+T/RpuxcNM8xZPFFNgjwRovDXNYgc/f73hrPEr8Gf2zv7ocf5fZ5ksD7fkiY03mwAall8kX5ipqRpWK33V86XUcFCrQHIXf7/UadSKKcIeclX+nbSq1cxvipJoCJeIwmwoffGSH0kUq2B2ua9f3N7evXgjxM2LVa3/EbZ+40AtFugBl4237jPZ87WZRg6Fgps/gnlqTRbFhe/3zAOorjfp2LbDMVddCYWksxgi+pebpwOXQggBkAhBoJevTfinaG3bP3Mh/VF/Tym6XYJW13MEyH/biQZ3bAWOoAlpg+xGDJ3eU1DGDYiwVI5/T78QMRxmmX4EXNm5pEsAenjZi5m8zSzLwL+krcpFIhukpKptK8 YZOQ6+y7 GavU8amTDKgHth7l3W7yS3Grt+ESBxdq7tiPMomHF8hdNBYnUZBDnABUsggMLNadq5dbdEnGwASgos9lk7lJ6a47vXgZ61qJaPcfkT1d5Z1iILUX6zB/JnYdarjLtpfvRWBebQ03OMRLO4tBGpKnlKjZUHdsAWruLtn8e4l5APtg1QYmYB/0cOo01SuebeV1bag0YeIhtsDI5chXmF5hoU3Si4nrTwnr/FdZxnyvKwT0VyHB9bG1DPJCeLDcSEetuxZN7yhNq/g4psK6G8oPcKBuFXMmokDyfXJ+TDjYm9lXCKGFB7NX322bTpyVK6rX8CypZfW1s/IvGxoE12fh1XG51iGyeElsYGJsNUAFsAwboslyRJxTSMsJty3eNXMc5BR34l0VwWrdw36tDzhnVG8+3zdYFHUmtOs5pcVTfFSxCpzPrOd/WVQKi9FPThjwkp+Gk9tud15cYgMUH1eTYLhxRoGx3MGZNbxre1NZQEI3PmcQTGus56j9C6rZ3RD1Lz1gryyoHnkFUWIQKoYGQrQYp990yIMf3Ujps1ag7qSfa5bpebaiXq1agoEM7MtsDWP8A 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: If a memory fault occurs that is due to an overlay/pkey fault, report that to userspace with a SEGV_PKUERR. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/traps.h | 1 + arch/arm64/kernel/traps.c | 12 ++++++++-- arch/arm64/mm/fault.c | 44 +++++++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h index d66dfb3a72dd..dae51eccfc19 100644 --- a/arch/arm64/include/asm/traps.h +++ b/arch/arm64/include/asm/traps.h @@ -26,6 +26,7 @@ try_emulate_armv8_deprecated(struct pt_regs *regs, u32 insn) void force_signal_inject(int signal, int code, unsigned long address, unsigned long err); void arm64_notify_segfault(unsigned long addr); void arm64_force_sig_fault(int signo, int code, unsigned long far, const char *str); +void arm64_force_sig_fault_pkey(int signo, int code, unsigned long far, const char *str, int pkey); void arm64_force_sig_mceerr(int code, unsigned long far, short lsb, const char *str); void arm64_force_sig_ptrace_errno_trap(int errno, unsigned long far, const char *str); diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 8b70759cdbb9..b68682c284a2 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -263,16 +263,24 @@ static void arm64_show_signal(int signo, const char *str) __show_regs(regs); } -void arm64_force_sig_fault(int signo, int code, unsigned long far, - const char *str) +void arm64_force_sig_fault_pkey(int signo, int code, unsigned long far, + const char *str, int pkey) { arm64_show_signal(signo, str); if (signo == SIGKILL) force_sig(SIGKILL); + else if (code == SEGV_PKUERR) + force_sig_pkuerr((void __user *)far, pkey); else force_sig_fault(signo, code, (void __user *)far); } +void arm64_force_sig_fault(int signo, int code, unsigned long far, + const char *str) +{ + arm64_force_sig_fault_pkey(signo, code, far, str, 0); +} + void arm64_force_sig_mceerr(int code, unsigned long far, short lsb, const char *str) { diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 2e5d1e238af9..a76906199479 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -497,6 +498,23 @@ static void do_bad_area(unsigned long far, unsigned long esr, #define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000) #define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000) +static bool fault_from_pkey(unsigned long esr, struct vm_area_struct *vma, + unsigned int mm_flags) +{ + unsigned long iss2 = ESR_ELx_ISS2(esr); + + if (!arch_pkeys_enabled()) + return false; + + if (iss2 & ESR_ELx_Overlay) + return true; + + return !arch_vma_access_permitted(vma, + mm_flags & FAULT_FLAG_WRITE, + mm_flags & FAULT_FLAG_INSTRUCTION, + mm_flags & FAULT_FLAG_REMOTE); +} + static vm_fault_t __do_page_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned int mm_flags, unsigned long vm_flags, @@ -688,9 +706,29 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, * Something tried to access memory that isn't in our memory * map. */ - arm64_force_sig_fault(SIGSEGV, - fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR, - far, inf->name); + int fault_kind; + /* + * The pkey value that we return to userspace can be different + * from the pkey that caused the fault. + * + * 1. T1 : mprotect_key(foo, PAGE_SIZE, pkey=4); + * 2. T1 : set AMR to deny access to pkey=4, touches, page + * 3. T1 : faults... + * 4. T2: mprotect_key(foo, PAGE_SIZE, pkey=5); + * 5. T1 : enters fault handler, takes mmap_lock, etc... + * 6. T1 : reaches here, sees vma_pkey(vma)=5, when we really + * faulted on a pte with its pkey=4. + */ + int pkey = vma_pkey(vma); + + if (fault_from_pkey(esr, vma, mm_flags)) + fault_kind = SEGV_PKUERR; + else + fault_kind = fault == VM_FAULT_BADACCESS ? SEGV_ACCERR : SEGV_MAPERR; + + arm64_force_sig_fault_pkey(SIGSEGV, + fault_kind, + far, inf->name, pkey); } return 0; From patchwork Wed Sep 27 14:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400861 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 173B1E80AAC for ; Wed, 27 Sep 2023 14:03:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4B808D0084; Wed, 27 Sep 2023 10:03:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FB9E8D0083; Wed, 27 Sep 2023 10:03:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89C488D0084; Wed, 27 Sep 2023 10:03:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 74C978D0083 for ; Wed, 27 Sep 2023 10:03:58 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1E745120A54 for ; Wed, 27 Sep 2023 14:03:58 +0000 (UTC) X-FDA: 81282546156.21.CF600C6 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2053.outbound.protection.outlook.com [40.107.20.53]) by imf10.hostedemail.com (Postfix) with ESMTP id 2CAA3C0026 for ; Wed, 27 Sep 2023 14:03:52 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Yrx8MYtK; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Yrx8MYtK; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf10.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823433; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=fP0hZBQLW0r5LPMNDw9vkQWBkTgVKFZIvfc9QkLlChM=; b=AJLGHzLNCbosLwkhjdYr1WFSysf4ebZgajdV2LE0OkqHco8f5/UsBv7z68sAWtqPZmC7vN 0TQESWfC2oMh/NU2LiB5FdeCFQoUbv5s9lT8kOwo5iRODn7pOgTaVpUSwv+lCXH/dFsn3p 2LReKXFeqWb4B/VK4R3Ck0l0ZuV6+yQ= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Yrx8MYtK; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Yrx8MYtK; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf10.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823433; a=rsa-sha256; cv=pass; b=QgB2jfnRbI0b1A8o4TxRGo+koR5nSqC2IspZvwDl0NkRQL1/eS4In0WjHneXXLaNE8jp9p I9/74axbVwWBVxIx/v+zMEoRPJXhJZZ9XIoJCDJ0lXmoN1tVH4/aPiekr88CZJ/otrLYJy yhqvWP59gmuFUtFN/9uDMrwoAWgs94s= 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=fP0hZBQLW0r5LPMNDw9vkQWBkTgVKFZIvfc9QkLlChM=; b=Yrx8MYtKqgv9lvFMg6MENe9rLixHTzZ+HgyngQg4Xu3XO/KXDeB/We1+Z9727+I3RgXDmySuAoquSk8F/fk7MC8hbGS0YLS5LiQs9vYzaUdB+3nklBpY/N1DFOD6PmZPizrtUjSF99GFTUBzNS0Mg18hb8R5/ccQvnyUJvIZcA4= Received: from AM6P193CA0139.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::44) by GV2PR08MB7955.eurprd08.prod.outlook.com (2603:10a6:150:7f::21) 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:47 +0000 Received: from AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::22) by AM6P193CA0139.outlook.office365.com (2603:10a6:209:85::44) 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:47 +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 AM7EUR03FT012.mail.protection.outlook.com (100.127.141.26) 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:46 +0000 Received: ("Tessian outbound 0ae75d4034ba:v211"); Wed, 27 Sep 2023 14:03:46 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ae231f9e02a9b0cb X-CR-MTA-TID: 64aa7808 Received: from 42361384454a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7EDF8468-9F69-4C21-BA86-2E1A1B912054.1; Wed, 27 Sep 2023 14:01:51 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 42361384454a.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=dPJCUUrZNNyO177ukqeVhbgMpCT3DoTiFQBkauYBSbcsjLQnQgayICGsdIlQh9CKb+DKgkWgpwZwIt0yLDOXkppkkLJQx/iofqdAhPR1AZ//EGi+9Wg/gKpNKJe9KF7eUTVLPWiTPh1xIfussZyc/1q1UlNlaUX2U+PI3IfBysPIEHlorOHNSYqHxBYdqEIjvqM8zuCJXbBU8nlnqtYWZXn0cPetWvL7dnqnYluVAZltr3QcclojYTFcLMn6CN4w3MRAxTN0T9vauLSr/+lowiJJEJMxHSIOjeAkvk9svzXtpdLDt7ILiA1mFTX5ckPpq3Ux0dy9uVIEmrqAC8Q6Mw== 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=fP0hZBQLW0r5LPMNDw9vkQWBkTgVKFZIvfc9QkLlChM=; b=N3ZJcDjUd1sbw5LgCA5Ljo9fzFb9wQPxto2aWnel/ldP6MGDO3bPDqAeeWWeq8ZgSDNO1B+bhbwuqz3T5W73VU1JS4OqH/0KgmsC2GI6cjRNAqdtVA/WvZwppwDZPsX8F5DMFtdZZHpOiWssvW3shHI+RDIBrWaiclzYGKfSTvliUCGXrrdNJOFy2PiHS2Sq5KADEEb4+/tsIi2mlYUW+fhBqdG3Dierm+FLAzv//R/Pjuatwb6NNRwSNZaHnMwHSDKcWICNC5t2NHHPhhgCQNdXzVHG0y80o73y04wTFCcxVFrXijvics2EqJbaROiVU095TzAgXVGu9GxJ/tUt+g== 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=fP0hZBQLW0r5LPMNDw9vkQWBkTgVKFZIvfc9QkLlChM=; b=Yrx8MYtKqgv9lvFMg6MENe9rLixHTzZ+HgyngQg4Xu3XO/KXDeB/We1+Z9727+I3RgXDmySuAoquSk8F/fk7MC8hbGS0YLS5LiQs9vYzaUdB+3nklBpY/N1DFOD6PmZPizrtUjSF99GFTUBzNS0Mg18hb8R5/ccQvnyUJvIZcA4= Received: from DB9PR05CA0009.eurprd05.prod.outlook.com (2603:10a6:10:1da::14) by AS4PR08MB7653.eurprd08.prod.outlook.com (2603:10a6:20b:4cf::5) 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:01:49 +0000 Received: from DBAEUR03FT051.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::a3) by DB9PR05CA0009.outlook.office365.com (2603:10a6:10:1da::14) 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:01:49 +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 DBAEUR03FT051.mail.protection.outlook.com (100.127.142.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:49 +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.27; Wed, 27 Sep 2023 14:01:40 +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.27; Wed, 27 Sep 2023 14:01:40 +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:39 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 13/20] arm64: stop using generic mm_hooks.h Date: Wed, 27 Sep 2023 15:01:16 +0100 Message-ID: <20230927140123.5283-14-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: DBAEUR03FT051:EE_|AS4PR08MB7653:EE_|AM7EUR03FT012:EE_|GV2PR08MB7955:EE_ X-MS-Office365-Filtering-Correlation-Id: 769c5fe3-d8cf-4d0a-e48a-08dbbf629169 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: du8ahLLIPeC9aWNg18cDj6DAuuvBKq7TIOCwkSO9W6bRQvyJ8x1dUN2enprZH2zUd1C6a5buJDsOSePUj+WJXweB4a+8l7RXJnCGukKSaRGTAhM9QGJSdEOF45cn5vIgmN5UhD08LlZb/jK6gbd+5rAkJv7zwxT/bfHKS3AQwgM1IelX0ckDQPKKQkwKgZ6gL7mmL6E/nv4AMvsbJ+t4zIB8UGfhqF6YWaBP0iNaT6JCPnjHA4EEtkI7WBlU54DrXZI+GgtA6dqLbeOHVrWlrFLjEcuTukEN2i9CCYWQ+3IJzEDEZinhMf+OPXUjXOpueiqW0elFhUfyoGHffJAotL0bzrcyYwvqtH6A0d44dICctd/tlBGe6bQLqTM8c6BO/kspiTD+UKjG4EQHKVckTlUKg6/43vbcnPrtI4AB4kkCbJGUa12I+Zhydz+2fPisjREOABuf9jLhUI2e7peT8BbJBsBk2FfBGUPJVaoeXby+Th/81Z5sQQ0OgW4uiVzkVEJlvLs4h4z3uzDIltD5EMUeogK0/J9/dBz+ufGGCWmvyBvh829lohATA2mJbJjCMDO8+WS2QlgRbWzJbzE0L+w/Dk3Syg7JJe/aSnluf6p1HSf1kwFuS3qWgmO69NT6rZxEeN7sExHW0Jdzo2auSviK9iar04gcpB5OZ1x8Z2sEMDsQ8s3nwiT8T5Q3uCYpThqF5rO/rrU21o+/k7BvUjTCTSU4Tm1+DoX5GTx45V6kfWNxAkvwxmz/oaS4Nly9fK59ysQAr/c5PwqlIYa1aeaiOwoG9Rmv2E8BARRPuHs= 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)(376002)(39860400002)(396003)(346002)(136003)(230922051799003)(451199024)(186009)(82310400011)(1800799009)(36840700001)(40470700004)(46966006)(54906003)(316002)(70206006)(70586007)(6916009)(7416002)(40480700001)(8676002)(4326008)(41300700001)(8936002)(2906002)(44832011)(478600001)(40460700003)(26005)(6666004)(36860700001)(47076005)(83380400001)(5660300002)(7696005)(81166007)(426003)(2616005)(336012)(36756003)(1076003)(86362001)(82740400003)(356005)(41533002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7653 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: dce59fe5-efad-4c43-be7a-08dbbf624b62 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uuAbhUYzUT2xF04BELPTLkRYxtkwVEZt74/KyGYbdkcRtFsgjjAVZv90MIFIbF21mbnz9dt8lIYBS76hO4jAWR+E0P2JVi6GVjszlfA4lLqFjpxZ1xUjvBf/5L0S9qwfvPfTEHegf+69cUvEJ8BuI70kmCGvgs1IlBIkUqWvEjw3P+CmNgDKj9Cqnc+1K99GTjtRVfYmvrmq4R9aJ1my45vyeWMg+43WNxvL2zOfMGpanyG2CNhGO0usJakrNEyzwsdivxPXpKSXBKP3oRUni3f/SSq9HB3IVo5EWkcOJLsSBykbfHq7rPUfEIfZyX9vUg6HSR4VfgEhW6j936iGYpjzDl+YQPaIel0+qa5GNCt4d6VzUlUoi2B29akQhNvYacD2wLRITvXPjCGqVBkEwpsDydShzzADT1H6ed2XRRV/TBNSNEEHb0mdYrxcNpSf2PVmUGDAyWsGX+ZnqKtbuDpCr3kuKMUnbMTK8DNtbCmdc/TP2HWqq3VwXOfBoNP95PXv+wltebGX1arITnMUJD3F21crPpsk9YLKmqnZGQe+qRrtH4DlPDRFS3C3rjYL/b8D9KIYjcX3vEW294ywvxmCqtLWfXWHVXwpJ8MXxxLkyEQrQMoWG3Ct/eHiGnT6PiIptT9wh1vzHw0mPlzEEZyUCx1yYHUpwwDCDHhbAc0bBPQPYMGmJDEZws/05vAgE1M4wp+FZM9G3BTLy6TtNmn85ZsXaDYom5bO1FOphKyzmA9/8rcYZbrc/Q2aAISkjBnqPWKJUS5HOT0kJCkHqQ== 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)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(1800799009)(451199024)(82310400011)(186009)(36840700001)(40470700004)(46966006)(41300700001)(8676002)(1076003)(6862004)(2616005)(107886003)(8936002)(4326008)(36860700001)(70206006)(54906003)(70586007)(316002)(426003)(26005)(44832011)(336012)(86362001)(2906002)(40460700003)(478600001)(81166007)(82740400003)(40480700001)(47076005)(6666004)(36756003)(83380400001)(7696005)(5660300002)(41533002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:03:46.9768 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 769c5fe3-d8cf-4d0a-e48a-08dbbf629169 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: AM7EUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7955 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2CAA3C0026 X-Stat-Signature: e5r8mycotsenh94tipwsdc5dwgkxpnud X-HE-Tag: 1695823432-975591 X-HE-Meta: U2FsdGVkX19e5E6gA/zTQ8h2dP+VyJFqnSJ/HiSx/xLSVm6IQAj67ayRbWmJbKWj5zcbFRVEk/BNjMhcPPUHdAQQ+9WV9XpF6VoxJWYdYEZXE6f1gb9seDYW0whmyigDJWR1Gjvwa+kfp+qSWsLzAHQgr/fq2leOFTYrvGwUxcFXsxSr9iKp7pNQTdiCFhyYXvIO2E6kkETcWfgZcpPdwxdVWTUNygHJkawikf37FKR9ETKil4FOpRj0HcUsm/8E7x1b1dsdYK+AGCURqOuTmQkzfOrr1i6uF3FSaiFeeVG0sknS9Ncy/kQikx6hIXk2s18B+8bR8NI8mt4tMP/0epr1MyG/j+b6jV9X1Eux3UBEu/NiM6+YSFJiznPh1OmCZiQ175pwtnJCPyT5FbcvCl1I+6g2H5zCshSczw3AH4M7XEPkIg9eXL66AFKqWBb40kWjU5iTfSdtedKFpYbRQ1foRCv1WjMGAl/jzEih7ozobDzw5nGOATP7dl93M3K4dwL5/OIDRBykPzzCQNx8ikuxDgDrRV73/w83R1qu2CIVDhnpYJ9O+ormBsvO3vh1Ai/t9BUfM1gZzNx/+X1iHvToKUqZMBuvkiwYTYw1xms8uhzUpXcTBWpIBpcsqyRYh3ruLi7cnHMD4EsWzrV4ZgT2CGQhRLndIiTGmNomzCc2malpojEs0P3q4fBBky2Od1eS+kG/KkhQS1VfH8GGaqiyxTnif6awM6AkWxKncL0r6I7i7rjvf/ZVh0zrEhyYGPca777+Xj7p9RMK+yXELNIYAYOrYwWnYkMRA7LjhDE+BaCXfUa0vb73FRD/x4MQ4XpN+GMTHI7VMHh0pytPbkr8BH4KxNNwtDhiBqCJpPJ15vsJ7VLjgC2MsIKsv4JBIBU7FmA2hA0LWbmd8V5iE1X0l0Qi1i4RFAPGIac5d02GIwuDzndZjBzAfTQHl4056FV2xaQ5lh0TclnKMXQ tfsyCSKB o06BbPSeu9jUPwArCcF55sfuSRFAuH4Z4bCnhD5LPT2D+22xXc4Gy3OS2UBVszRMX7TjJjMyM6/D+Lll/bHlTrNGVZ8RTYhJpEbOP6W4CF/PdJwJU4BkoZVmDK3AifTQGYMkJ/4nCDpYpApjckx9LPNoScGWWX3FEMBWDHDGBBvCKfn5S0HyT57RknDk/AKWdRKGmi1yOs8t20zX519wpYFoPpmVJ1Fdhq7Blwwp5DCyKsJffGRKngeR5DW5Qbb/q+LlcLRIV2CDPKFv1y4m+sS/Qux762wUfay/hf+gFpUS2ROPbi+j51gLwoP7rHFXkCKDYgdM8MWiYhhn4AS6Gp1UlP+ge0jktZAByA5hLW1hKG5vZ04g+3W48CkOltpt0+DCpQQBZoINGWA6IU86mbMOC0FGADYnoMPSk0+EU3XH4cExb+RI7k8OWZa2zJK0lkzkT7Nhv8vTbc/F0zDc4tAWy1zYwA0uR89XylVDo2kkKH5208ulghwXzuubGLEAJAQXJjbwUd5W+/VWm5fwMatuRSm1JHPnT9xcgIUneq8me/EaQ1uxp+mOBdOp8Mpf3fU6I0QcnNwr6TqSEEIM+ObwRHcOOG3/v/JFjc6zgSu54u9UgGn3NgRCIqw== 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: These functions will be extended to support pkeys. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/mmu_context.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index a6fb325424e7..c0eeed54225e 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -209,6 +208,20 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) return 0; } +static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) +{ + return 0; +} + +static inline void arch_exit_mmap(struct mm_struct *mm) +{ +} + +static inline void arch_unmap(struct mm_struct *mm, + unsigned long start, unsigned long end) +{ +} + #ifdef CONFIG_ARM64_SW_TTBR0_PAN static inline void update_saved_ttbr0(struct task_struct *tsk, struct mm_struct *mm) @@ -298,6 +311,12 @@ static inline unsigned long mm_untag_mask(struct mm_struct *mm) return -1UL >> 8; } +static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, + bool write, bool execute, bool foreign) +{ + return true; +} + #include #endif /* !__ASSEMBLY__ */ From patchwork Wed Sep 27 14:01:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400897 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 1632CE80AAD for ; Wed, 27 Sep 2023 14:04:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9B928D0090; Wed, 27 Sep 2023 10:04:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A498A8D008F; Wed, 27 Sep 2023 10:04:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89DAF8D0090; Wed, 27 Sep 2023 10:04:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 74A8E8D008F for ; Wed, 27 Sep 2023 10:04:42 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 46813120970 for ; Wed, 27 Sep 2023 14:04:42 +0000 (UTC) X-FDA: 81282548004.17.566E3D5 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2083.outbound.protection.outlook.com [40.107.247.83]) by imf09.hostedemail.com (Postfix) with ESMTP id 3A4E1140053 for ; Wed, 27 Sep 2023 14:04:32 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I1NMAhMH; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I1NMAhMH; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.247.83 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823473; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zDVJtt2pWINnf3TSGFuSxIJFr+mtevbHDxNk3ZClcxI=; b=Rv2QhBkfkEWrSXiaW8FpVOAw2Y1AAsClt/eEmtnE+cuaU95WNE69sbU+yRuBpTT4SFiuZ0 tsdLFFRHZ0C9gPbUtELval2/9GAK3jMfLc3IvCCB8ODkYqdh/nKLWM6SjsESSHYKDW+7o7 HXhtkF7bPDS0kpWI3gvOoH9eO6yUYeM= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I1NMAhMH; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=I1NMAhMH; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.247.83 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823473; a=rsa-sha256; cv=pass; b=Qq3cbXG0DyJrLvNKFzNvhqFcof55B9nG4MOO/pnJw9UOhs9Zd4ekXtdRcyEYgmmaeigceU DT8qQom0Wef3OLbCVIOd5cqoKnfk37YwFKDHufN8gUCwUWmS+ewrXXjvefID5zxCH9MA7y 2bEyIBe3sClth9BhTaykzCGSPd8X66E= 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=zDVJtt2pWINnf3TSGFuSxIJFr+mtevbHDxNk3ZClcxI=; b=I1NMAhMHiwGsDyWNr7QQwjDOcATrkZ3/F+1pYxo5kXwXnwjW6NfEKLSgiOrd/mwZMZrmvkWpW2cPjKj3MV79VAW9bHlJmPNpwNtNmiT9T2daKCthMDdPGnE9Qob94oh5tabXOosM4lFwxPwR88hQrsGpiROwoD4BfBsarPjxaMU= Received: from AS8P189CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:31f::34) by PA4PR08MB6077.eurprd08.prod.outlook.com (2603:10a6:102:e7::22) 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:04:29 +0000 Received: from AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:31f:cafe::4e) by AS8P189CA0014.outlook.office365.com (2603:10a6:20b:31f::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:04:29 +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 AM7EUR03FT016.mail.protection.outlook.com (100.127.140.106) 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:04:28 +0000 Received: ("Tessian outbound d219f9a4f5c9:v211"); Wed, 27 Sep 2023 14:04:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f108e32c4a7920f6 X-CR-MTA-TID: 64aa7808 Received: from 063041436e08.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4519EA8B-F84C-4E9D-B06A-C68E8452DCDF.1; Wed, 27 Sep 2023 14:01:59 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 063041436e08.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dwaSpW1FQk7APf6Iop0PJQvZLJcsrOOvbGUa4sBv0fCqB12CjfHmQtjbunAHhJ8HaFnoSxrzj/FtxcMl+aGiiLdwe1k9AG84E4Q92878OGcyKkoxQ0hMR+tFHO366FBq6HCGlEEiO3Wpuu5EcdEtfnNGwwNderR9gWqaI4ob1J4NchCdyyT9abwN4XHc4AmdRV/s8Io1wQWa5UiMiG/T5klFipLYcB9j6tZLx4axe8DrNGrpSgygcwQKcIXN1tuqNORDz4GGYB+9tfCmdsafjh577lgv5sbXAXvF8LeWwmQNGO5vrTuhDy48sOBqHrPl6fodr7WsKZUXPEB4vU6gMw== 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=zDVJtt2pWINnf3TSGFuSxIJFr+mtevbHDxNk3ZClcxI=; b=bYTfaGj+eMNZLYFDTSTQ/YOxre1Nlhc1Rzylbiqa7RwGP/ScPu/wNwT2Dzn2/kf+DwBB99hTYDyVSc1bGdqKtLAdP3XsG69QLzo6Lxes3lkT34udzG17KlbLLDiLvKE9wOC/pJ1HMhPR9MLaj4Q+yS6XNP8i4YFsAI7sHhynFzEqd8IgZkxuA8DzBEnyR7gVQTsfoh1CTMR8RFs/P21QXazu2UDFvppuURYsRAdtjA8O3SDkzbnrnbNHQjojRjRC/uDz6NjeYC6/oCDdOQbEqkZM/7kn1jZbxk8DfEyD5n7L2Wp/qdGgZNps6pTx163sOstKTSDXLjV6o/4ZCfGg5g== 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=zDVJtt2pWINnf3TSGFuSxIJFr+mtevbHDxNk3ZClcxI=; b=I1NMAhMHiwGsDyWNr7QQwjDOcATrkZ3/F+1pYxo5kXwXnwjW6NfEKLSgiOrd/mwZMZrmvkWpW2cPjKj3MV79VAW9bHlJmPNpwNtNmiT9T2daKCthMDdPGnE9Qob94oh5tabXOosM4lFwxPwR88hQrsGpiROwoD4BfBsarPjxaMU= Received: from AS9PR05CA0270.eurprd05.prod.outlook.com (2603:10a6:20b:493::34) by PAWPR08MB8983.eurprd08.prod.outlook.com (2603:10a6:102:340::14) 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:01:54 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:493:cafe::cf) by AS9PR05CA0270.outlook.office365.com (2603:10a6:20b:493::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:01:53 +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 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:53 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:41 +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.27; Wed, 27 Sep 2023 14:01:40 +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:40 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 14/20] arm64: implement PKEYS support Date: Wed, 27 Sep 2023 15:01:17 +0100 Message-ID: <20230927140123.5283-15-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: AM7EUR03FT046:EE_|PAWPR08MB8983:EE_|AM7EUR03FT016:EE_|PA4PR08MB6077:EE_ X-MS-Office365-Filtering-Correlation-Id: 2aa5a7b1-8570-4870-0248-08dbbf62aa4d 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: 6/cLMf3Q8iIhp3KKdbJ4BEyfE5C8NX/R7qNr1B623tyhqxaex+39uS3L+4oOA0NUWNs42H5lORZCTdudfWIW8VcZdfEcC0+i0q6vSmp5wXKfXYmf6Qd8ERgllGDwiG3jFFl6R0eoh4fjOi33GnavieAwjWaKZt3KEM0cnFpyvcYDqZDIbC+P8s2bSs1O+ZjUdaDlVM+siGLJwybwtMMRukmW3cWFZs39Npn7xmtrd/vlCAcfy1uiqkGect723TE/9X0w2dLRTwFi2en+AAc+6HNFT0xh+7DMNgS6xZH9y1EWas0ckLOepI7q82xMwhWnUDLuoo5gzQggYLSdOAkpSjqaPA50RHMALM7l37H3KBr1BWIc2Bfi5+FBZYEeFb8Xt2vxhQ7sQaxC6Lzw5f/ISK8N7U6SQwNMCiPeO0fgJA+20aWRJ+OZQLVXBqD8W+ipMZoeE8xDf1po+tnS458db3/1vElCrI2KOP9ze04IWzdqGWrk73Th4a8T8EITbdtEekaZmjQS26cqdyE5snHvJcNWYCN+nMDNnze8U47zyd2mJ3XynsGExy8+TTieel8YbMptr5IhoB/2Ipz+A0p0dPxUgIXN4HUPykxiwq7M/3B4bVrxEzEyWwI2TKE+1mdNe3h850FO08IX5fQCwJWUA0t3/EXNwMT0dLA1p/Z8MSz/WdAEHFgClSUHH1D6YXT/d6F1JZO+R0FX8dFJwmVhKqivGAhk2Bt4AFo0qRHQhFQtAfl1fJGbttse6rBrgjnRyCYlEWhRj88lfaFhZvs4CQ== 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)(346002)(376002)(39860400002)(136003)(396003)(230922051799003)(186009)(82310400011)(1800799009)(451199024)(36840700001)(46966006)(40470700004)(40480700001)(40460700003)(2906002)(47076005)(356005)(36860700001)(7416002)(83380400001)(82740400003)(81166007)(70206006)(54906003)(70586007)(26005)(5660300002)(6666004)(7696005)(1076003)(336012)(478600001)(8676002)(8936002)(4326008)(316002)(44832011)(426003)(41300700001)(6916009)(2616005)(36756003)(86362001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8983 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a81df06c-8b94-4092-dbe2-08dbbf624db6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UKDRw4vuxQ6ZUTT6Hxb0G38udVqBed7a3rsobFonZ7U8XiC729FuHxSNAjS3OUa1IYVeBjm7zOkSIdBpEN+wwcx19EnroHma1vbrdop2zG0ppYHgZrynY6CT6Y1T9USVdwB4C6vcH0VtZRVhRZTTVzJqlaZcXNMjWESmDu+KupxlE+VT43pMTSD4rO1pcXdJ00RcDtsxi0Gl1NWwUAOK4UMXQ3u4LEJSC1qv93P0d8an6LXFKC3/bbTQk/+pizCWDD0wCUrpE90j9mSJaUc/QP4rDSleu79rcTISoJz5QMacIaOG31hdyDILHx3/KEkfWUUst68DwZd1UW0U2cUEtOo3iobsxLY8XnyOg1++wSgWMs0ghPh1zWCC35fD50Y5cgRDfMvz+vmHWXbC8oYzmckH0Hui+U1blISVFwvzFOAUXqvFGg8PgqDYA61rQsyq0WbTNyatrsTfhvxLAjdRPin0YLn6F2XvsCuFAr8zMsB9i9CbEmri8ypW47B4IIYxZngAfDYCPjvtmKSpm1bxw1iD0a7R+0iJdKfxeyEjUOeXg59FYvIK8VA/J8fkF4cRKw3ezhNnkiEHSa/XoyZnxUTwYB9BcV/IiXgEF3OknrUJv1qnvK67+I69YZihpjAO+zvgdTUWS8lVhajyzmc+4skV8WeGEbQIh2RwIKn1dKNXVvDOtzvfQQ0c/aSSO7aHMZhyMIXtiA1Z1wE0npO3mRHDLKCbKu+lyU60U/nVEbA= 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)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(107886003)(1076003)(2616005)(426003)(336012)(26005)(7696005)(36860700001)(47076005)(86362001)(81166007)(82740400003)(36756003)(40480700001)(40460700003)(83380400001)(70586007)(70206006)(2906002)(44832011)(54906003)(316002)(41300700001)(6862004)(4326008)(8936002)(8676002)(5660300002)(6666004)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:28.7149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa5a7b1-8570-4870-0248-08dbbf62aa4d 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: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6077 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 3A4E1140053 X-Stat-Signature: oqwqaqq41wxdgw7kk9jx7yhhhmp4psh6 X-HE-Tag: 1695823472-365782 X-HE-Meta: U2FsdGVkX18al0a/Ik627aIvcZGHTaqwzgBsLY14xKomqoOSnz3QL2ETIqualIqhfWSxTTrrUOx+grWOkEJ+UEZhU+s0JOazKwU7P/HyDclHmEal+xECAb+9CSlJHIqzW6e4J6tw04GoY5PLVkYz0X9jjP/WtatsEUkWO4ut6F3q3cN67JzkX+k1AQGKDqGTxh+AVz0S8ApbiZYBQRz/Gjn0NCWYTbUiPMC5DZ9FHMNgtyCvX4h6LJVm42M0hR3WAwwHYdhl4DhCFGGcDAgZTzvUC3fOWwf1zkfnDqESSLAjutnbS+xwAj3LOGguQdu2m+iNUdJQDLDIxRycmf1EjEwBWfW7rVUctfxPQCoVZHA8I0RSDu1r/OaFbUjpmHaFp66EEIhQ44LeXddg7PycxG3qmso2ddlTDZyGV1I6ZYU0uQbcXysv/uuPtP6ee+EBcFQtZd/eo3TQpM4DAIAj+F+MOZKUe9Gqei3m73NV7S4z7y3vGxpcFUJXjf2Ge5aBE4RPiFa9TISIQ5SjqaPmvANU7aGs/d+E2tadGXc0VMkhmI0FCHuie3jnTSy/GAGVkhryLGSiRfH8CUHV1oCAVp6tmjsLG04cL3uPsBPAoeB65rZj+Q2Fzs2wwKt5/HDx9hzHbwt4OU7h/lB7WRIAmjfGLsmbESF1iw1DvwHDalLVfEmsBMd7Io50lTyGyZh1/2nTntYlAzLOdQFozSVeD2XC/J/FyWpqmg638sE/7k5fAo88URdg4ZY6HO91GbphT8sMGyceuXtO/GwtAszKh85mF5VOsGWhVtQIBjtu3RuvflGD+4NG7x5Ian8sIRJMCiuGFXiSkuhPOS3mVd+q31C5hrGKwYrUX6aoy7+EFtD2Drr7/Rw0oegJLzgJTNzxfU9bDAeKO0iOzVDItV+4nHHOD+smygUd/Qd33HndU374L5eH2g9Aog3jlhtrDf4p6krdFy71O7YS42ExUep NX9LWvU8 n/q7oYAsc7E/Tb3bNbO/Z54QRZcU+EhRQ0gHyjAqbSQzU9ZPX/gTQ05cgdKhNmJhswhRwJPa6w763HXrvoDOS7msqPRCc/dAmFFOOGwLjpnhpf3V27vSZ8+bCzWFXhP7WAw3D8Z93088KJUfWCHQSnXj5YSVTGrhiKEu8DHRRJq95X0avcqxUtw8AdzA+9Cj4z78/mdA7G4f2C8IFr1fqG/hjiERwOcHmK7BujHYT8SVKCPkfEHGvh1q5i+R7JfzF2eLTcKamrJ3A38IMDi5TeyVFFxDY8SMDjiXNKaG2K3eObekjI/hPw89DPqac27285G0JRvBCwf29KjFVJHK0yblYNNsrepyk7bj4nkRoLrb6gQnu6rsgkCQJzFan1Frl+piIegsRP0Mmxta7iDa2th2JS5v+KhddEC7Zg8qRB1H72shwORIdOI0Vrt2fvPk1NFJy/mnoyYZyeowHdhb2lJS5ThI5LT+gRkRBDxVTe+teIOoqb3Fww7cvSJI1BIrf688w8jF5LP81YtA38N0QmSSw2GJyWhPYJu/GngGpxuBPS//X5lPzr8wpwA5Np1d2CAWk 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: Implement the PKEYS interface, using the Permission Overlay Extension. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/mmu.h | 2 + arch/arm64/include/asm/mmu_context.h | 32 ++++++++++++- arch/arm64/include/asm/pgtable.h | 23 +++++++++- arch/arm64/include/asm/pkeys.h | 68 +++++++++++++++++++++++++--- arch/arm64/include/asm/por.h | 33 ++++++++++++++ arch/arm64/mm/mmu.c | 35 +++++++++++++- 6 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 arch/arm64/include/asm/por.h diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index 94b68850cb9f..ed2cd66347d8 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h @@ -25,6 +25,8 @@ typedef struct { refcount_t pinned; void *vdso; unsigned long flags; + + u8 pkey_allocation_map; } mm_context_t; /* diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index c0eeed54225e..aa739b87d49b 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -205,11 +206,24 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) { atomic64_set(&mm->context.id, 0); refcount_set(&mm->context.pinned, 0); + + // pkey 0 is the default, so always reserve it. + mm->context.pkey_allocation_map = 0x1; + return 0; } +static inline void arch_dup_pkeys(struct mm_struct *oldmm, + struct mm_struct *mm) +{ + /* Duplicate the oldmm pkey state in mm: */ + mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map; +} + static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) { + arch_dup_pkeys(oldmm, mm); + return 0; } @@ -311,10 +325,26 @@ static inline unsigned long mm_untag_mask(struct mm_struct *mm) return -1UL >> 8; } +/* + * We only want to enforce protection keys on the current process + * because we effectively have no access to POR_EL0 for other + * processes or any way to tell *which * POR_EL0 in a threaded + * process we could use. + * + * So do not enforce things if the VMA is not from the current + * mm, or if we are in a kernel thread. + */ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { - return true; + if (!arch_pkeys_enabled()) + return true; + + /* allow access if the VMA is not one from this process */ + if (foreign || vma_is_foreign(vma)) + return true; + + return por_el0_allows_pkey(vma_pkey(vma), write, execute); } #include diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 98ccfda05716..761575bbc943 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -143,6 +144,24 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys) #define pte_accessible(mm, pte) \ (mm_tlb_flush_pending(mm) ? pte_present(pte) : pte_valid(pte)) +static inline bool por_el0_allows_pkey(u8 pkey, bool write, bool execute) +{ + u64 por; + + if (!cpus_have_final_cap(ARM64_HAS_S1POE)) + return true; + + por = read_sysreg_s(SYS_POR_EL0); + + if (write) + return por_elx_allows_write(por, pkey); + + if (execute) + return por_elx_allows_exec(por, pkey); + + return por_elx_allows_read(por, pkey); +} + /* * p??_access_permitted() is true for valid user mappings (PTE_USER * bit set, subject to the write permission check). For execute-only @@ -151,7 +170,9 @@ static inline pteval_t __phys_to_pte_val(phys_addr_t phys) * PTE_VALID bit set. */ #define pte_access_permitted(pte, write) \ - (((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) && (!(write) || pte_write(pte))) + (((pte_val(pte) & (PTE_VALID | PTE_USER)) == (PTE_VALID | PTE_USER)) && \ + (!(write) || pte_write(pte)) && \ + por_el0_allows_pkey(FIELD_GET(PTE_PO_IDX_MASK, pte_val(pte)), write, false)) #define pmd_access_permitted(pmd, write) \ (pte_access_permitted(pmd_pte(pmd), (write))) #define pud_access_permitted(pud, write) \ diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h index 5761fb48fd53..a80c654da93d 100644 --- a/arch/arm64/include/asm/pkeys.h +++ b/arch/arm64/include/asm/pkeys.h @@ -10,7 +10,7 @@ #define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2) -#define arch_max_pkey() 0 +#define arch_max_pkey() 7 int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val); @@ -22,33 +22,89 @@ static inline bool arch_pkeys_enabled(void) static inline int vma_pkey(struct vm_area_struct *vma) { - return -1; + return (vma->vm_flags & ARCH_VM_PKEY_FLAGS) >> VM_PKEY_SHIFT; } static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma, int prot, int pkey) { - return -1; + if (pkey != -1) + return pkey; + + return vma_pkey(vma); } static inline int execute_only_pkey(struct mm_struct *mm) { + // Execute-only mappings are handled by EPAN/FEAT_PAN3. + WARN_ON_ONCE(!cpus_have_final_cap(ARM64_HAS_EPAN)); + return -1; } +#define mm_pkey_allocation_map(mm) (mm->context.pkey_allocation_map) +#define mm_set_pkey_allocated(mm, pkey) do { \ + mm_pkey_allocation_map(mm) |= (1U << pkey); \ +} while (0) +#define mm_set_pkey_free(mm, pkey) do { \ + mm_pkey_allocation_map(mm) &= ~(1U << pkey); \ +} while (0) + static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) { - return false; + /* + * "Allocated" pkeys are those that have been returned + * from pkey_alloc() or pkey 0 which is allocated + * implicitly when the mm is created. + */ + if (pkey < 0) + return false; + if (pkey >= arch_max_pkey()) + return false; + + return mm_pkey_allocation_map(mm) & (1U << pkey); } +/* + * Returns a positive, 3-bit key on success, or -1 on failure. + */ static inline int mm_pkey_alloc(struct mm_struct *mm) { - return -1; + /* + * Note: this is the one and only place we make sure + * that the pkey is valid as far as the hardware is + * concerned. The rest of the kernel trusts that + * only good, valid pkeys come out of here. + */ + u8 all_pkeys_mask = ((1U << arch_max_pkey()) - 1); + int ret; + + if (!arch_pkeys_enabled()) + return -1; + + /* + * Are we out of pkeys? We must handle this specially + * because ffz() behavior is undefined if there are no + * zeros. + */ + if (mm_pkey_allocation_map(mm) == all_pkeys_mask) + return -1; + + ret = ffz(mm_pkey_allocation_map(mm)); + + mm_set_pkey_allocated(mm, ret); + + return ret; } static inline int mm_pkey_free(struct mm_struct *mm, int pkey) { - return -EINVAL; + if (!mm_pkey_is_allocated(mm, pkey)) + return -EINVAL; + + mm_set_pkey_free(mm, pkey); + + return 0; } #endif /* _ASM_ARM64_PKEYS_H */ diff --git a/arch/arm64/include/asm/por.h b/arch/arm64/include/asm/por.h new file mode 100644 index 000000000000..90484dae9920 --- /dev/null +++ b/arch/arm64/include/asm/por.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Arm Ltd. +*/ + +#ifndef _ASM_ARM64_POR_H +#define _ASM_ARM64_POR_H + +#define POR_BITS_PER_PKEY 4 +#define POR_ELx_IDX(por_elx, idx) (((por_elx) >> (idx * POR_BITS_PER_PKEY)) & 0xf) + +static inline bool por_elx_allows_read(u64 por, u8 pkey) +{ + u8 perm = POR_ELx_IDX(por, pkey); + + return perm & POE_R; +} + +static inline bool por_elx_allows_write(u64 por, u8 pkey) +{ + u8 perm = POR_ELx_IDX(por, pkey); + + return perm & POE_W; +} + +static inline bool por_elx_allows_exec(u64 por, u8 pkey) +{ + u8 perm = POR_ELx_IDX(por, pkey); + + return perm & POE_X; +} + +#endif /* _ASM_ARM64_POR_H */ diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 3b7f354a3ec3..8241bdc365f9 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -1490,5 +1491,37 @@ void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val) { - return -ENOSPC; + u64 new_por = POE_RXW; + u64 old_por; + u64 pkey_shift; + + if (!arch_pkeys_enabled()) + return -ENOSPC; + + /* + * This code should only be called with valid 'pkey' + * values originating from in-kernel users. Complain + * if a bad value is observed. + */ + if (WARN_ON_ONCE(pkey >= arch_max_pkey())) + return -EINVAL; + + /* Set the bits we need in POR: */ + if (init_val & PKEY_DISABLE_ACCESS) + new_por = POE_X; + else if (init_val & PKEY_DISABLE_WRITE) + new_por = POE_RX; + + /* Shift the bits in to the correct place in POR for pkey: */ + pkey_shift = pkey * POR_BITS_PER_PKEY; + new_por <<= pkey_shift; + + /* Get old POR and mask off any old bits in place: */ + old_por = read_sysreg_s(SYS_POR_EL0); + old_por &= ~(POE_MASK << pkey_shift); + + /* Write old part along with new part: */ + write_sysreg_s(old_por | new_por, SYS_POR_EL0); + + return 0; } From patchwork Wed Sep 27 14:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400896 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 BA062E80AB1 for ; Wed, 27 Sep 2023 14:04:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 239658D008E; Wed, 27 Sep 2023 10:04:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E7818D008A; Wed, 27 Sep 2023 10:04:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 011FA8D008E; Wed, 27 Sep 2023 10:04:36 -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 E02A38D008A for ; Wed, 27 Sep 2023 10:04:36 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B1DAB40CDF for ; Wed, 27 Sep 2023 14:04:36 +0000 (UTC) X-FDA: 81282547752.02.58F169A Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2052.outbound.protection.outlook.com [40.107.15.52]) by imf30.hostedemail.com (Postfix) with ESMTP id 7B3B38001F for ; Wed, 27 Sep 2023 14:04:32 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=akfdtKzC; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=akfdtKzC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.15.52 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823472; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Od0l8mHSmhLv4umuTQwuKNu3i05N7Ly/I3FztsMYFC0=; b=hEP1rP7dMIbHjMB7lkYAlMbdFpom+4ITMfT+zKos2p24OoYs+8rU5G05wYOxkMivdr16b/ +e8O/0fXI2aL/6Kei6hoBbJSg228/wblBEueRE8dR5yt/7KOek9mwTpoe7kw+taeCXYkIM Sjmkvy6nEW6v8AMKSW6p3cD3Cy24bWs= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823472; a=rsa-sha256; cv=pass; b=i1uwzdn84AajmfpZVehUcH39onErl/PhVWeABRJTZo2UPKP872YIFTXImA3plOlqPbLuV1 ulzZifii7KM3t76s4bwE3yNCF1S2fLWwJ01fkkxg3NFvDyaNXXQEuJle5LZjz0ctUHmz0d krnBeAiIcdtcuO8R91w62zyyOmQwmV8= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=akfdtKzC; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=akfdtKzC; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.15.52 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com 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=Od0l8mHSmhLv4umuTQwuKNu3i05N7Ly/I3FztsMYFC0=; b=akfdtKzCRWyPyTnfUzlVFcILOoFs/X+BHxOoZO36rgkqEmPBKOl3rU06ptwftgMd2MekPOCX/PrevjniHKaVSZAG0w6sT2wl89mmyyEQAdVDtgeYvwqMyFWVvj3VUd0N9N7iIJxHZnKi/5uoztbxae6m77NvYLJHa/hdnIJlx5I= Received: from AS9P250CA0010.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:532::13) by AM9PR08MB6292.eurprd08.prod.outlook.com (2603:10a6:20b:2d8::21) 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:04:22 +0000 Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:532:cafe::4b) by AS9P250CA0010.outlook.office365.com (2603:10a6:20b:532::13) 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:04:22 +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 AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) 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:04:21 +0000 Received: ("Tessian outbound ee9c7f88acf7:v211"); Wed, 27 Sep 2023 14:04:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d5b120ad5dc25d2d X-CR-MTA-TID: 64aa7808 Received: from 1113c25b9f7b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 662B7813-5865-44DF-9FBF-61CA59EFE735.1; Wed, 27 Sep 2023 14:01:57 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1113c25b9f7b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PwBz08+uKQozklGnMLpdumFZr9TmwJghIDx5KPf4hXo7Nyg3INiY8jTSbotAJ5sCBtZaaqj9jgDrEz6K5wzTaa7tkr5vw+Nyhj0wLtnRa5/bsnOLCOmC7qYOibkIpusDPgJvBv4J9ANedevZ61URtm1cye1hGIjMtnHJgx+rIGms60I8Emz5kjCzDo8fMVE+50fC6RjTMz5jgveN3CArpdgiQQZFqUQJ7uhO/dkWWYNvRSWlqlfQhfncecOe9R5R2ctGUKS5NyK0LE52j1+IZDl4hRysbgwCBd15VIPzXzhIfz0AzNyswAs0hJCdaKeckIAYT0riZPPErz2A46CUKw== 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=Od0l8mHSmhLv4umuTQwuKNu3i05N7Ly/I3FztsMYFC0=; b=OAE5WIxeYHStQfoi555s3AWdBaSRg+fjFR7Lnt86po+DdknQNQyopbwwHxYCoH8h5aHUip6irDwi2PvsPsV0tPnrHj+ccfrHz3laDkI0X6mKwPmpL+cfbZxsndAyEAtl5aFbOmNbM3eVfjscVWkE8k5isfZHeuYbBN0eKBxuriQuZ16yJhoK0HrIMh939H9CdRChvsgxVFyH6j106+Crm8OCEsiEt7j/0awRcD08+zMScK2GgJZYdC/Evm47vp4CADcxXccIDsSUvU5Z0qvYoT4IjcHRcpMYtIXF36U9nnma2B8uyM29fkhy/70Qs565tSU12BYW+Xfjv9n+z6ixHA== 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=Od0l8mHSmhLv4umuTQwuKNu3i05N7Ly/I3FztsMYFC0=; b=akfdtKzCRWyPyTnfUzlVFcILOoFs/X+BHxOoZO36rgkqEmPBKOl3rU06ptwftgMd2MekPOCX/PrevjniHKaVSZAG0w6sT2wl89mmyyEQAdVDtgeYvwqMyFWVvj3VUd0N9N7iIJxHZnKi/5uoztbxae6m77NvYLJHa/hdnIJlx5I= Received: from AS9P194CA0010.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::10) by DBAPR08MB5797.eurprd08.prod.outlook.com (2603:10a6:10:1a1::20) 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:54 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::3c) by AS9P194CA0010.outlook.office365.com (2603:10a6:20b:46d::10) 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:54 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:54 +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:41 +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:40 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 15/20] arm64: add POE signal support Date: Wed, 27 Sep 2023 15:01:18 +0100 Message-ID: <20230927140123.5283-16-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: AM7EUR03FT013:EE_|DBAPR08MB5797:EE_|AM7EUR03FT022:EE_|AM9PR08MB6292:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a077710-277f-4700-f452-08dbbf62a61b 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: CQdD+2jBTYY2KgNKgi4Az6yHoQoUULetqFrzsQQjO+TmKnj64pXs5WPZrcMdNLtmJ8+60fQsHcn1z5G1JbrOWqVuL6wJZL8Rln8x8p/wGP4fryTcEoKu4BVFAGKI15XS1WlRXcC10TQzjtq+Dv5J1lnwt8iBhCfe5npM+HKhLhME+fZS6IV3z23JJYSHGA8nMevbc606N7z4Ads0D856TBIIQh12WO1RObr8F3ZSJjhfYkeX+fdL6Hoy+4iShbQtTkJBdIZhY2lsBwBqPsdJpm+3mL1A4TpI9nLaPTeL2NjavNLtwcmUMvWWNgp25/rX/0DtYLGKKHx8fcBAzcX2QWivi/+DiUQPFWEjZOr2s+R+hLnjIYTWpjonQiljVYEHMkpjkdbKF3XK7hLIQ/KlZVVKpjW5CYju9+soVUUPIakwAYp6k2keiC0bn9JWRFcsSwK3w/mhnjxerTaTOmf6EgwvYPL/W126YVagWxybSM7U97DkyJhdaXEEidYBeaZ028dYn8Lsx8Gq4hLuEHUl2AA2LTh+WFia8SJU6jsJEJfqLUWD1tg+8TEKi2xQsOaY0CJ7ZDe6UY2U+/K+VkpmrzVeoLSiFpopQ1DOLyCErUoVLODPZ5UGPojQ8ABeh3Yt2vDSgMLugTgyJK0txHv4mflz0LGIisYLEwcCrCXBaTy09R4EEoy+DvGyhIWl1zQPIgKUgsLmoRaCEpE1O+pIb9iXnUogzu5Tw0nUP63qZbkbZtSoL2VzJHl1z9VHpV9x 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)(136003)(376002)(346002)(396003)(39860400002)(230922051799003)(82310400011)(1800799009)(451199024)(186009)(46966006)(36840700001)(86362001)(356005)(81166007)(5660300002)(41300700001)(8676002)(44832011)(8936002)(4326008)(40480700001)(7416002)(82740400003)(2906002)(7696005)(6666004)(478600001)(47076005)(83380400001)(1076003)(2616005)(426003)(336012)(36756003)(26005)(54906003)(316002)(6916009)(70206006)(70586007)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5797 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0abdeaf9-fd23-49d2-2eb6-08dbbf624e52 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Zf+1obxaYEtD3PtY1fc9tffwed0HasymHzAB8YFMjD1FGyAPZl9QYVpxQJgSse4JlKK76jBreOEkt3tFXGH47g4Gh2sCpXb3ZPs44ws8ICQ5grbfWwYwSzMQRD+g5Rms7FyF42p+ulN0h3MOALw9gvC9zpD664uyu+m/OG4FjS4QmIeCz84Ex9xedkzOEWFuKRf6YTk08DzurNUlcXMPr/clWkp87OXMj4LvWfIIgminkSwcLE3kam0djibRm82T+o2u/2KG5TU2IaNQcYw6Jw4RCSTWRM8tyB7v0ODivQrnnUly6lExo4pUXkYIYLSqP5ZGS2SbFEqTFI9Yj+vg7jDLVVX1Wpb7U6UYAR24vnc/iZlH6L242vJ28V4QECzFp7v9JUdmiFCiW7v2oISKNc+2ofQXLASp00z4x5ePUHX0Am+2Keet2nSJbdBmOuIKa4XBoYf1iRx6w4EjdlBwpknHD7bBEd7sc2/dCTjEcbpZXb/PGz29j9IyevnKo8Oj2orUO+JiDEQ3OPjVFHYakWnrc0TzJ5EiIHKJPHs7Bq59c6nNEdSNfTYLkI845hmQm/bbmr+wRgMO+rlywlwnvER2M7s/39VqYOoPhlapXf8cgEnLWO1Xdt791zdcQYGy7B3+MlWzXmeiC4Isw9C2hzIJuQDFCOL8MYMq4HqcoaNSZnfOMtJWs/x3zUzAxzgn7P7CKlwUTmIE+5aNkD4ObvPdBZvoEWixuspGtCeFb0kO8Bt1Bh6yd3/MO3xUadb 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)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(82310400011)(40470700004)(36840700001)(46966006)(2906002)(26005)(6666004)(336012)(82740400003)(7696005)(70586007)(1076003)(86362001)(36860700001)(70206006)(47076005)(478600001)(81166007)(316002)(83380400001)(5660300002)(40480700001)(54906003)(4326008)(8676002)(8936002)(107886003)(36756003)(2616005)(426003)(6862004)(40460700003)(41300700001)(44832011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:21.6982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a077710-277f-4700-f452-08dbbf62a61b 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: AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6292 X-Stat-Signature: bkut7p87yfit87zcpgibkdfgungkwki5 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 7B3B38001F X-Rspam-User: X-HE-Tag: 1695823472-370395 X-HE-Meta: U2FsdGVkX1+/Zixasl5EtLZzMkwazCsDZjX9DfRtp/+2NGKIiw7RnUnNq4NkOe1GeHLhgqupljp9LCt6goqXFkvklmtP0m9ilCMg2wyGlWV7nHUvQ4QDsoenN56dXzkh695Ft+h6jSpW0thgMeCtrJE+9a2fQdHSPw65aV5RjKrx/GyxQqXx36aOneI93H7fA8sofVMpD9pZotCAqg+nirvnY+HVGQhPecaNRH/AeJfnGqVaiKSi+iPkFtv0xWkAA0uj0Bho0KnXInDyBuJIUoLoIP9XBsmDt0hwO+NSXfrOVStXyF3QAaVIgh07FGZlKegNpWUheCpAlk3T+N+aNfXxhGU5P1/GvbegmFp1AQDNmmVvJPoa3od8DC3Xggqpw7v20XW1bZFdwB3InphLR8YJULs3DDkbgDgELBPevUWPY8EcBuvNbtXOhUdDQezTQMGXHoL46u/9CxVO0lxnmulfyXxBI/0WBOlRj4fRiGdDOBcBxtON2zO2QC4C2aUqizF7b94j41bkweqQJBCQ8CwIE9QRzpEkhqjlDisPSZb2cc2C9sR+nLF4rLzmWqPxfgkbxC7lH7K3ezitXxvFVKmebhIwWpD2rqOngYeoDD5Rny1xcTBW6yShSiHqQCMX51CQolsWbzohF2B9lPWbUssFKRgYAw7DWquGwlRAomO5Qv18ze4qjFXiLn84WsYaza/uYDmm6DjcFbx97RVXPx3Pf1BWeHXDgRYjvUFef6uj8HbJtw3ugTjQDsqzZ3dXZ4+XDKeow9wqi77tE8HdN6r/z1rfWn5MI3KcRwFN0WIPe8LkvYBPw0GW0b0BjLG7rdDyiG3GDtQM2JGMsXYHV/1SRaghvMgdGWqGdqpKo82t2LxMrX8VdssCJJBvo6BYYOp1hSlibFSX6upUZS0RdL9VdEAVtS3NgV0EWOOzYxFubn0/DgHbABNI8f9UXhRD9hVK2mVeBd/bfmH8NEf BNpT8iA6 05bGfe9X+WEdEhdzrbUfkSxd2S7wo6kUBIdP/yYcMMtudo6TjBzyOENauFOC0L8PdSWXwVy4GXMtautfTEuzK3NK2W+RNs0EduL5xKAQ7C6SnZaAf0jR+jlh8q4TOVfGC+CmDL4e1kQX08KP2fAEP+0+zL4jwHMLH8X0FltzXe1WbNCr5F86mlVrECLSH7gb1YCIu1WQBVkOhsyA0T32DYPrYHKvnrgl4SbSVYbEEIh6TE+F9a36F0vKbe51eMfKSl6SOhJdlEWiZR7ub8cmx+5zhBDu3FIA/A58nPBbK54TxyMd7QuefXFgmfsSfe5+Jzixisg0T65Qx4xn9rMg5XyTh6iEu3ewTS/oAXv/GelBGoSs0I8Mngn1XGqG98TaBNWbFvPUHbiFetO8gGXjdHxsBqU8IhlRqhETm7gVa4D0fN89lczRzZKiZ518IRxiCRP26KWo9OqjdUioSJVcQ/ot56C+3qB7RbSHnfbfFUUEAwfksz+/U2cJSh4Iz4ab9Qt1T7SZc/pl8OdiKWDtKwt28rjqtqrp3Fxr3kbp6KJjkMW2/n1UVmSGKtvMZSjECHHr2 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: Add PKEY support to signals, by saving and restoring POR_EL0 from the stackframe. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/uapi/asm/sigcontext.h | 7 ++++ arch/arm64/kernel/signal.c | 51 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/arch/arm64/include/uapi/asm/sigcontext.h b/arch/arm64/include/uapi/asm/sigcontext.h index f23c1dc3f002..cef85eeaf541 100644 --- a/arch/arm64/include/uapi/asm/sigcontext.h +++ b/arch/arm64/include/uapi/asm/sigcontext.h @@ -98,6 +98,13 @@ struct esr_context { __u64 esr; }; +#define POE_MAGIC 0x504f4530 + +struct poe_context { + struct _aarch64_ctx head; + __u64 por_el0; +}; + /* * extra_context: describes extra space in the signal frame for * additional structures that don't fit in sigcontext.__reserved[]. diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c index 0e8beb3349ea..3517271ae0dc 100644 --- a/arch/arm64/kernel/signal.c +++ b/arch/arm64/kernel/signal.c @@ -62,6 +62,7 @@ struct rt_sigframe_user_layout { unsigned long zt_offset; unsigned long extra_offset; unsigned long end_offset; + unsigned long poe_offset; }; #define BASE_SIGFRAME_SIZE round_up(sizeof(struct rt_sigframe), 16) @@ -182,6 +183,8 @@ struct user_ctxs { u32 za_size; struct zt_context __user *zt; u32 zt_size; + struct poe_context __user *poe; + u32 poe_size; }; static int preserve_fpsimd_context(struct fpsimd_context __user *ctx) @@ -227,6 +230,20 @@ static int restore_fpsimd_context(struct user_ctxs *user) return err ? -EFAULT : 0; } +static int restore_poe_context(struct user_ctxs *user) +{ + u64 por_el0; + int err = 0; + + if (user->poe_size != sizeof(*user->poe)) + return -EINVAL; + + __get_user_error(por_el0, &(user->poe->por_el0), err); + if (!err) + write_sysreg_s(por_el0, SYS_POR_EL0); + + return err; +} #ifdef CONFIG_ARM64_SVE @@ -590,6 +607,7 @@ static int parse_user_sigframe(struct user_ctxs *user, user->tpidr2 = NULL; user->za = NULL; user->zt = NULL; + user->poe = NULL; if (!IS_ALIGNED((unsigned long)base, 16)) goto invalid; @@ -640,6 +658,17 @@ static int parse_user_sigframe(struct user_ctxs *user, /* ignore */ break; + case POE_MAGIC: + if (!cpus_have_final_cap(ARM64_HAS_S1POE)) + goto invalid; + + if (user->poe) + goto invalid; + + user->poe = (struct poe_context __user *)head; + user->poe_size = size; + break; + case SVE_MAGIC: if (!system_supports_sve() && !system_supports_sme()) goto invalid; @@ -812,6 +841,9 @@ static int restore_sigframe(struct pt_regs *regs, if (err == 0 && system_supports_sme2() && user.zt) err = restore_zt_context(&user); + if (err == 0 && cpus_have_final_cap(ARM64_HAS_S1POE) && user.poe) + err = restore_poe_context(&user); + return err; } @@ -928,6 +960,13 @@ static int setup_sigframe_layout(struct rt_sigframe_user_layout *user, } } + if (cpus_have_const_cap(ARM64_HAS_S1POE)) { + err = sigframe_alloc(user, &user->poe_offset, + sizeof(struct poe_context)); + if (err) + return err; + } + return sigframe_alloc_end(user); } @@ -968,6 +1007,15 @@ static int setup_sigframe(struct rt_sigframe_user_layout *user, __put_user_error(current->thread.fault_code, &esr_ctx->esr, err); } + if (cpus_have_final_cap(ARM64_HAS_S1POE) && err == 0 && user->poe_offset) { + struct poe_context __user *poe_ctx = + apply_user_offset(user, user->poe_offset); + + __put_user_error(POE_MAGIC, &poe_ctx->head.magic, err); + __put_user_error(sizeof(*poe_ctx), &poe_ctx->head.size, err); + __put_user_error(read_sysreg_s(SYS_POR_EL0), &poe_ctx->por_el0, err); + } + /* Scalable Vector Extension state (including streaming), if present */ if ((system_supports_sve() || system_supports_sme()) && err == 0 && user->sve_offset) { @@ -1119,6 +1167,9 @@ static void setup_return(struct pt_regs *regs, struct k_sigaction *ka, sme_smstop(); } + if (cpus_have_final_cap(ARM64_HAS_S1POE)) + write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0); + if (ka->sa.sa_flags & SA_RESTORER) sigtramp = ka->sa.sa_restorer; else From patchwork Wed Sep 27 14:01:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400865 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 30215E80AAD for ; Wed, 27 Sep 2023 14:04:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C482C8D008B; Wed, 27 Sep 2023 10:04:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF8E18D008A; Wed, 27 Sep 2023 10:04:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4B3F8D008B; Wed, 27 Sep 2023 10:04:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 90F438D008A for ; Wed, 27 Sep 2023 10:04:31 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 66AB9160A58 for ; Wed, 27 Sep 2023 14:04:31 +0000 (UTC) X-FDA: 81282547542.04.C1D376F Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2049.outbound.protection.outlook.com [40.107.247.49]) by imf09.hostedemail.com (Postfix) with ESMTP id 903C314005B for ; Wed, 27 Sep 2023 14:04:20 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=9TPs09nx; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=9TPs09nx; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.247.49 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823460; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/VQGAj4qR6U+8jKxuVwzh/GHnDbH08pkNQ+bUlJJPsc=; b=UrtKKJpAxQPskQv2WsG3mTXJq/n65GeNRDAwuuoOii1bycLkV6a+e9e51PQwCWctve85D4 K45E6XTXFlRvkyxBQN+DDTJ8mxQUp91AKF/54xd1yGTOQOWr2Pn7Vo5kUSAPeFe1JKMICg h0Mr5WkH8rIf4jMGbSVCff6nIGKlwrY= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=9TPs09nx; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=9TPs09nx; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.247.49 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823460; a=rsa-sha256; cv=pass; b=HR9/RcRldnwZGaC6stSb9s9w0LuE3VBdkmXXbtyVusSafL8N8Tb/44QjtRt3iOH8x8p5c1 5QoXI587eVOpB3GYHROlOjGDyn/At++uAfXXW0qHg2LuKpEF6mdHNVTyR/RClJrSmLd+GT Gg0zmt/8v9N9EyfT44WnRiylr7Ef9Mw= 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=/VQGAj4qR6U+8jKxuVwzh/GHnDbH08pkNQ+bUlJJPsc=; b=9TPs09nxcTm4craLfXoIPoOcRy9TnmGcC8xPd9DmsxMZKeKCYMgInNCerhij8b9rJ4YMEm7H3Bx+GQqhORA2RlS4QAvfB8a8VQlmA51RrJL70uREkm8wbEj2uIqLUQGZK048UZcZoLq4xPMFVIU703ym2YSyNZ8bs+MRQUv4fOQ= Received: from AM6P193CA0129.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::34) by GV2PR08MB7932.eurprd08.prod.outlook.com (2603:10a6:150:7f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.23; Wed, 27 Sep 2023 14:04:15 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::6) by AM6P193CA0129.outlook.office365.com (2603:10a6:209:85::34) 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:04:15 +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 AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) 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:04:15 +0000 Received: ("Tessian outbound fdf44c93bd44:v211"); Wed, 27 Sep 2023 14:04:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 42ac1b4d537efab2 X-CR-MTA-TID: 64aa7808 Received: from 5eaaccc83e9e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B86F6B30-FE61-45D1-8200-D8AA3A5C2D2A.1; Wed, 27 Sep 2023 14:01:57 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5eaaccc83e9e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CKBgjOtP6+7X55OKYedk6tljzxBdZ8lqy1KG3lwNkp0+jiHHsTOH2tlfkE6gikz1dcKgmIuQXhihwtDVDyYny8jeTxmasz/Tza78CJhPjJuIoASretrGRmD2dIsjziCRqOeM1YxNpFKpzgkeqvpE6LpAEyyhHbUw1N+HDgFJFUl8xGEdiBx/Dvv20lJx0VZY61J1mfRJMwTN3mFJ7yB7JP6hC6uNzwRAl+tdzSSRRS3jIhEdCUXp8D3S3o4r1+15wYEg1MrEN56oGe0J2kDzEfZOQoLXAuWPcsvG4Cg377qsfYfaumXfqR476nf72uIAJ+B5OSDRWm0oh7nSKxsTBQ== 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=/VQGAj4qR6U+8jKxuVwzh/GHnDbH08pkNQ+bUlJJPsc=; b=ZDa9W3PwsVV/9VRtwl/VjBrwqsQkVMB8aNg0+WrXtxr44JAXd2YpMbg/mjJxu8Pual3oll9rfmqe1cZshz9jpUFLtoWfK1kMsdy4jpRL7NkaEGx+AytZeUW7K14a5RWphu7vDMs4+rU6+dfyP8fanh42jOY+gN25srKwv7qFuDaEKMsscPN5SaBDFhnkGYvHeWxPCyxuTdF/2FBPmr3MsHBwkbAhyXAMBpnE61estRdNuSavcpzn0q6NEU07PKtdz+cHquFF8wmhvVjBbJOMqlmj+6hGM0Cc3zMNcLvNjONzvtToMa3LcWtIhWVVBh/XZh+rwttMYWb3deXAvWwAng== 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=/VQGAj4qR6U+8jKxuVwzh/GHnDbH08pkNQ+bUlJJPsc=; b=9TPs09nxcTm4craLfXoIPoOcRy9TnmGcC8xPd9DmsxMZKeKCYMgInNCerhij8b9rJ4YMEm7H3Bx+GQqhORA2RlS4QAvfB8a8VQlmA51RrJL70uREkm8wbEj2uIqLUQGZK048UZcZoLq4xPMFVIU703ym2YSyNZ8bs+MRQUv4fOQ= Received: from DB7PR02CA0027.eurprd02.prod.outlook.com (2603:10a6:10:52::40) by AM0PR08MB5441.eurprd08.prod.outlook.com (2603:10a6:208:17d::23) 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:54 +0000 Received: from DBAEUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::f0) by DB7PR02CA0027.outlook.office365.com (2603:10a6:10:52::40) 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:01:53 +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 DBAEUR03FT015.mail.protection.outlook.com (100.127.142.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.22 via Frontend Transport; Wed, 27 Sep 2023 14:01:53 +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.27; Wed, 27 Sep 2023 14:01:42 +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.27; Wed, 27 Sep 2023 14:01:41 +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:41 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 16/20] arm64: enable PKEY support for CPUs with S1POE Date: Wed, 27 Sep 2023 15:01:19 +0100 Message-ID: <20230927140123.5283-17-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: DBAEUR03FT015:EE_|AM0PR08MB5441:EE_|AM7EUR03FT059:EE_|GV2PR08MB7932:EE_ X-MS-Office365-Filtering-Correlation-Id: 087c8c38-cbb0-4790-0cfd-08dbbf62a246 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: 9QotwCpk5z2/3NXGxqu7I5UPz1xcD4RFUXShxnoZySw2z6V9qP5OGfAgD/Zb2w+TawdOGFMSd2NtzyfmhwYuPyS0c3YhXfnK9p5aIIKQVB2g/Tp/2IfNFNpn3/I2s45gY7aBgVkqPmLsjNcmwnN2zG9k7bCTAafPM3h036IsoOOeH6KzT+16SdNANZMAMrDP+UT7CUYgTN4YM6oIlwLl4k+ifNAwswZpjuTzjZvnGw7gWxLgoogpuldYP1aLYDqhjBCTS4ZxvgcraJ87M3/6umcAVFA2wWO+OSG9FfK2kg2NNRht7jg1ODmAIeLTeDsVCL1m9U2ds7hpBkPlOOATpvQzYonxzGZhpr0BKsj+2rNbil85SDji64eRPBtoPjXOR6Y35kpkpzOmtfF/URsLtYa7LEJVg8ZIQF5yp++N3Hh3U6/Q701RKo7Sm3u0VS6pBoCZnfCim8u+O512D9EGLy6YD/ooyMboKHH3r5TIwGL4HVdiPhVo2YVvlv5wsNIrGuiP+RBOpyBWQxkSek4oG+3pkbkOOrNX2b2mcnmDSxMp6Y4DFYmOaEXFln2tIDMXLhwuvL/Stw2MU6On3DPeevfDvvA128hz0023hRoZStWNSg05RGLfb9UTVOd3u/33xYxADNbZS6R3bSeje/icv7XfpkRlO8I6a6a8xvFeDzfWZusVx9gY/az40b+ggHBXYQX4eVLyUhSFWRe6CjmrBQawpkl6abPZ7CJszxW1azyWjLnMijrB5Di4XroLmxI4KjBFZae8yOt+iCV9tBjVErbrWOWVLbVzMdXe9Ey2c7Q= 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)(136003)(396003)(346002)(39860400002)(376002)(230922051799003)(451199024)(82310400011)(1800799009)(186009)(40470700004)(36840700001)(46966006)(41300700001)(5660300002)(44832011)(26005)(426003)(336012)(2906002)(4744005)(316002)(54906003)(7416002)(6916009)(8936002)(8676002)(4326008)(7696005)(478600001)(6666004)(1076003)(2616005)(47076005)(83380400001)(70206006)(70586007)(36860700001)(81166007)(356005)(82740400003)(36756003)(86362001)(40460700003)(40480700001)(32563001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5441 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 528f1ca5-8a08-4ffd-c9c0-08dbbf624dec X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: owa+vlQMnUG1sCA47xXI1uuLQ++bO7RjjUYGer7eUg4uPoQUeNJb52M8wyf8/lwSGiEBlNZnWUlwL31YnxRwcN90v5OS9pt/xBHZYXNs4b4OhleohPvXt2QiqZQMcTncB+RtQZFEtDb2Q7Fz3IfnKE4EL8Q4l8h9L93aZujIPpVnR76swiuHTtBa2fla9llRZ87NDw+MKrtwHwfwMZ1QdATBiv4wtI3eRQHFB7TvOOFySWi/9fXZvnumU2Y9lLawIPD5Nuvc9EO5KAbl+9BqiTwa0aGdqVzlLjC858/Se0E9a+sCXHvW/nGvjHW4ewPcp11Vyl+/IIKf1J/1SCwfdwM0uCMnUWtUaOA4a6RwAxrZrpq4B9L8MhhCnd1EefWT7Zfp+gnn0C0EkDuH0zxzcc8aFItD+wYMTF7evdcrbiqBI6zLZ3H9PdzXYn9BX8z206KRUl/3Buo4LMTWSqODxRFey++Ryw/LzWMKd1iqUhbxysI32Le5CV1uMiEWx5jbmwLC+MMjACc0RSPj+1bioUarTqjn0AFIwRMKGc9NkjYYcR0IV8kUFuoZrOWpoiZVozI23uYl3GL5MFde8UvHaU0QC1U43qZNs+6XyKgz9fst5gT1w3HG6jlSI57+dNJruPE8sLVzYUqouVNUOAsyT0hm/9bYSXhnDfwvbdoPmaVp9kFCjRbD1pd6V8L10aHjwCjQQ+E/4z+FGrKpdXQO1Nkqylmzh8mwltz4gd0G6J4IaKjNzOQzClKvrXBlRXz9IJzivLrxr7yH57DZyQkMpQ== 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)(396003)(39860400002)(346002)(136003)(376002)(230922051799003)(451199024)(1800799009)(186009)(82310400011)(40470700004)(36840700001)(46966006)(478600001)(36756003)(107886003)(26005)(1076003)(7696005)(40460700003)(81166007)(82740400003)(36860700001)(336012)(86362001)(2616005)(47076005)(426003)(316002)(40480700001)(8676002)(83380400001)(8936002)(5660300002)(44832011)(70206006)(4326008)(70586007)(6862004)(54906003)(2906002)(4744005)(6666004)(41300700001)(32563001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:15.2632 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 087c8c38-cbb0-4790-0cfd-08dbbf62a246 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: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7932 X-Rspam-User: X-Stat-Signature: 83ncqcdmkpfaxxaqs7wt16ib3wh3qpcy X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 903C314005B X-HE-Tag: 1695823460-278282 X-HE-Meta: U2FsdGVkX1/lXHweSj6bMa0zsx6LcJBcLCkvCOupN4t8UpfnJfD24Ln4jULA9FbrUFNh+bPrPL34JpChSF5c+dEqLgT7XOUMAjdvr0QSMQnzw+IWxmEKepU4J9gka/7A8bsFu+kXrclmpqg1H+tYThsJGn81FalEVUzOhU4mawBGKqArgsxE882YkCH8RUA/uBfitEMjq2IU5VapB8gENZq+yY74bGGvNIw+4BMjroMgnLlLMfISXdnLKdqv/VsdNRPn5LGUgt4Fc+ha67DTGBk2sYE3dFk1j/uIAiIkvuAvRslXN49D7uhvxczlPcwrI6aTDGiSQKBXJrKF5hMS42Q0/bpFz7+KMbZwKZhsB9X9Z+trX6ONWQZuq8KTKI4CN87NaIsRccVsBDlIYXFdf807cgu5/tY3jkmTEpDC5OKnpJk0uHVDccp1RfyVLUpR+us0UDPaNh0A1KZ/b17y3wAzCkXEeZyf0czTaxmsik9pTXH2S/M2/PeayI1kdiOc/AfRJOoRIhxeg9MwzXLGgJY/L2p5bJlFqvHs16PltVFG6l8Jj6SvrVrLaz/+L5BqRETeXO/LQiscqvC24e1RTJlJptX03bPgTOEd8bLOLeY9C8ivVRLTv+BnijdGAI3kkLH736CRAwKfaKRVMRLSh/nkOgyULYU9Hil6z1R4vZn/OhgrJjclh/PqdHkib09rmkDIhS999wNRs0BNXCjM6bBJgkYxCUabomOtgr7QZPKKatOaHkz/jgbGxuhhbzEqWdOZQnk3pAZvPM1kUWiaQcqjFR1xTO3if8plPb9Q9jS1u9StapUbNKZxf4/Qj4cYAFbAiGTr//jOXa5K3Ql8jcZtS+p2JMjvKnt/daRPrKZrOSrhgRYrm0znwu5jDKcmR1OZovwb5WFW6RCWbZwZ/KIptc5FsXmS8sNuQG5QNATtbQLgGV/qTQu0l++F6NYRRycHi+f2WSuxsb5OW7y zpXk8nf+ f8kZFKIWsTwSo+LTWJs1s3jojkLmvK043uTP8sebjjvTlKGfJL+frOQOSGgQoU8pTxYAaG9YAeQmyKQs9EjgrdtpPx5ORz7Xp/cjL9q9gnTH6ru8JYgl9pBpYneBOKT6oCnAXBADPT0/bDYCrO8MMTE5Ek3WwZzyZqUVqfw+EB5PxYyryd0F8l3nwFbRbUHq4NgDRVFCeeb8uTKnbFYMi4KDm7TrNJ/OQXDoO+/+7KMsvqLc1aA35KxF5GLokjUtuaWY/xAfmvZ/li5NhQN07jMJ5E0qLtoQSoIFbCTEx6rSrHoL4lJOOePGR84ze5d6/JR+GnxomxJHfe2xmgTkeJo+X2I3m+r0aqHRlsX93Zetyhqsx/vQ1qDHEqYlSatyPEXcXsNBh13DnH3ZaJZweiRIGtYqQ3foKmI18XgjXxMi8F2da6IrsJ+FNRBlDak3qzU3updfCao2PHQmkRmuxuSHPrQ7+LGrvBpS/F6Qgifk0BfTuIaXs+QPHEH+dY+fa6kIdPvE4GwxnkbqL6WQvM2ync6TFcn4Wf8gZz4UkKN8FgRzjNVLcZEy+hosXLVT7E5XkAitovMjchSlLcIaPehiCKg== 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: Now that PKEYs support has been implemented, enable it for CPUs that support S1POE. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/pkeys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h index a80c654da93d..9946de35035d 100644 --- a/arch/arm64/include/asm/pkeys.h +++ b/arch/arm64/include/asm/pkeys.h @@ -17,7 +17,7 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, static inline bool arch_pkeys_enabled(void) { - return false; + return cpus_have_final_cap(ARM64_HAS_S1POE); } static inline int vma_pkey(struct vm_area_struct *vma) From patchwork Wed Sep 27 14:01:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400921 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 57FD8E80AAD for ; Wed, 27 Sep 2023 14:11:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E20F68D0087; Wed, 27 Sep 2023 10:11:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DAA2D8D007D; Wed, 27 Sep 2023 10:11:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C24A48D0087; Wed, 27 Sep 2023 10:11:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B1F4B8D007D for ; Wed, 27 Sep 2023 10:11:05 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8AF35160A20 for ; Wed, 27 Sep 2023 14:11:05 +0000 (UTC) X-FDA: 81282564090.18.8D1B443 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2055.outbound.protection.outlook.com [40.107.14.55]) by imf30.hostedemail.com (Postfix) with ESMTP id 658728000B for ; Wed, 27 Sep 2023 14:11:01 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YUbjelT7; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YUbjelT7; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.14.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823861; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kps3hoRbmyPaRWG7aZnx7NFq6J9Im7o7f7nMifIm3Cs=; b=kyLO84QpngxA0IqFhxQC1rQHqxfvjKatNmu3yknw0UpuhmN22o2U7kcPkt5h4y9V2Q8vBZ OrKPEwvixPPE2tRPkWV0FIcRrcKnPZZhmshQjXDnpRjoXPRlf9cXOqV980pX3fzlYiRYZx wPYM0StHPzRoIs09CYNI0v0zzB3ow4E= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YUbjelT7; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YUbjelT7; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf30.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.14.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823861; a=rsa-sha256; cv=pass; b=zytfCD9I/vTyhdXlipQ65NVfY2K6DynkMTBYvZSQHSlQTNxTMUrq86o9KVLtJfcaaYpKp7 LUmD0Ut/gGo+AmDfppzbQ+AFUAbAoauQzpwHtPR0OZZwWcuUQl4FYEzxseeQ5pdaZOzIxG Z/Njmocb35ZkynVBET60supcZt5D4u0= 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=kps3hoRbmyPaRWG7aZnx7NFq6J9Im7o7f7nMifIm3Cs=; b=YUbjelT7j98hGIcJig4Q6GhMyVwg78hyZiQD+cX/enyONsao3TgTmcTSW3pTqT+CbxS3v8ubYEV/D0t4JC2fuyJclFEa7uMLYvSWCwhjbMxfxSnBFEv1xRr6WQ2D73PH4KRJBLGnvPi0wn5jeeUsfv16bftP45pyoYSGbn2bL5A= Received: from AM6PR10CA0076.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::17) by PAWPR08MB9006.eurprd08.prod.outlook.com (2603:10a6:102:33f::22) 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:10:51 +0000 Received: from AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8c:cafe::39) by AM6PR10CA0076.outlook.office365.com (2603:10a6:209:8c::17) 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:10:51 +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 AM7EUR03FT014.mail.protection.outlook.com (100.127.140.163) 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:10:50 +0000 Received: ("Tessian outbound fb5c0777b309:v211"); Wed, 27 Sep 2023 14:10:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 98cd8b91356deab0 X-CR-MTA-TID: 64aa7808 Received: from 75ba1caeea87.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A090ADAC-E753-4495-B990-D4CAD763C3BD.1; Wed, 27 Sep 2023 14:01:46 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 75ba1caeea87.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XdZ/+AvMxP7sunSaYTQUxOrFA6+msvzjJEDWjQE+HUh/hySKctj8mznGtwLOTL1K47HepF3ehNJREJSQKGExythe7AzLXoCcydYZdV0RQtKkphViCvJfdF7ksdKz0iW70RUeJV+hwUGipUEp1CjmNZuMuzCQcr/5Hb7jrnT/tuh5ObrSxte5hhO1G/KQamZklixp37P9geS88URNg/u8nlvrniKrpA/syG0Io2l44ldHBm9BKPkJKARNXHy0WJViS0UWSKOmSRzoDx2LhIai8qhIdujAuNp8hvE1GuMFoi68Lo1i+XOOJEYJ6CPOb/oKLjdb15Rgl4aPOijY2j5/4Q== 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=kps3hoRbmyPaRWG7aZnx7NFq6J9Im7o7f7nMifIm3Cs=; b=fz9z77D1iWXYMQ3/gQA4F4o6t/WIUOd0VyvdhpQddysDxcWlUn8nJa/2ghDw4rvUyfoClDEE227AvZIWGo11j4p9EtpK1c1e021NZy4NVkR/ImJ/tDnZ5oY95mRA+ohulB+PB3J8okDZ9aZsMS4gx97QD1AkZhesbIwnI/dfHQA6jjIiAB34uSiWZYjhZJCMgbn55S9gjZe1ECZHC+SXK8ZtMlvGguYm429XVGzFx7U/Ma5nzLNV7VU48NFJBNb4/b6Fu4v7HfP1chVOsVndE4by8+bECgYk78mH0uKpRpR7ac5HCynH4lWDalehC684DMBQ71rq8tPrYndj+Qxy9g== 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=kps3hoRbmyPaRWG7aZnx7NFq6J9Im7o7f7nMifIm3Cs=; b=YUbjelT7j98hGIcJig4Q6GhMyVwg78hyZiQD+cX/enyONsao3TgTmcTSW3pTqT+CbxS3v8ubYEV/D0t4JC2fuyJclFEa7uMLYvSWCwhjbMxfxSnBFEv1xRr6WQ2D73PH4KRJBLGnvPi0wn5jeeUsfv16bftP45pyoYSGbn2bL5A= Received: from DUZPR01CA0173.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::27) by DB9PR08MB8337.eurprd08.prod.outlook.com (2603:10a6:10:3de::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Wed, 27 Sep 2023 14:01:42 +0000 Received: from DBAEUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::79) by DUZPR01CA0173.outlook.office365.com (2603:10a6:10:4b3::27) 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:01:42 +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 DBAEUR03FT047.mail.protection.outlook.com (100.127.143.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:42 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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.27; Wed, 27 Sep 2023 14:01:42 +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:41 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 17/20] arm64: enable POE and PIE to coexist Date: Wed, 27 Sep 2023 15:01:20 +0100 Message-ID: <20230927140123.5283-18-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: DBAEUR03FT047:EE_|DB9PR08MB8337:EE_|AM7EUR03FT014:EE_|PAWPR08MB9006:EE_ X-MS-Office365-Filtering-Correlation-Id: 9511d1ed-7a76-4b24-3582-08dbbf638e1c 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: jlLThbYk0gyOLge1Cwuk1IiNadjTOMIcvu9xuz+UxHXN/Deu8r2EbfYPMuXp/LGxRnhMu1l0d2iGWP2xtKFsOBe/3feflRCYHnaZUzJ32UHuqYY/vLpYP+ulP2sTcOFGheT4m9uHZCjUQESFx/W590vFeOSaLfqXIz+OEXM63Nkxu9zljRWNMzDZSfPAc4wodK6gQ3Jm3Eoq/zf6FnJ+TaeQfKWai1yqvUwePqUSk0gNECzXyhRprktvt546TJNL434Ptcpn9hO4y5dsjZx8rRmrVuOttyF1+83F3kDvgjwFXASGYQKvhgki+AbrvlL3/0QBxfZ6pmpPAQdl2VPGd7i/nXPmOLCj6f6ycFLB3J0pp/ptOp7CYOdGsT8Az69aSz0IZLipBYPgdstjzcjmduI/wZ2UWuuqRkdBkssL5pWtzE05mS51IoYKH/1Xv0C9eawVVSZU62ZZ56nGUQiyLmeqvKfnz24sReeEEJHXKxwaM2PXW6g1TZCvDOwX1FGIb3WBbDuP34NRixwC4QZvGYTeZW2mMmPW+8Zqs5D7WnwIsbaipu7tqLjL6bKAF2ftFo2blfoEifvrM8uJ/W7nRhozivAIyp4Pm8QFhElx+bCel/qNe/UdtIIZ45rXYTszkxa4byvxxLFfiK1U1if+R6VUXAz356Zu0ITqiy0sZPMSeTddWEu9qrlJ9IGqNRxRKypVxB+ZMSUTTsYv4JQIrqzl5wwmRXKN2DPOT8iPBg5p3aYJaA7f+zKifwlB4k9XypsSUhdtFW2qGYeH8kALHw== 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)(136003)(376002)(39860400002)(346002)(230922051799003)(82310400011)(1800799009)(451199024)(186009)(46966006)(40470700004)(36840700001)(5660300002)(44832011)(26005)(40480700001)(6916009)(316002)(41300700001)(1076003)(2906002)(70206006)(7416002)(8676002)(478600001)(4326008)(54906003)(8936002)(70586007)(36860700001)(7696005)(6666004)(40460700003)(36756003)(47076005)(426003)(336012)(81166007)(82740400003)(86362001)(2616005)(83380400001)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8337 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bc7bfd5f-c98c-42d4-022a-08dbbf624755 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aLCmU0rm8VBlA4H92sB8aQCpqHQA6tSH/FO4YI8iOCVla0eGRY3GWqCzAF4BFr9hGxDyKlfLPcW5Qiy7ofECYqWsZedRFSTXWi/ohBLyOerdXCVcdEeoZwPwycV6wHmNeIK0r1HpqnvTOswFVf2pFSw2JqBHug0MxFvi8U960K47lYCNqK2g7IyM3T6WFQSAupEhsFg5d4XXCpw0ThljQnJDPcIm5rLFc8ZwfW+SOrAExz7+ZOs97YpUWo2/18IWwbBXAIQ2MUxjH6aqU+JVwEU79ywr2zhXzw8SQHqMQPnMmk5sXToQq3fdnmGZ1pqS+xN65rzfj7iLsy7IjA0E2q4WZynHmdzdfx0xNugK+MN5UQTbix6aLzpJVGGfXvFbSGN7lXr6r3Q94UBqcyacq5kw7N5Ba/CHbczdXEXYLqKrAKpWF/NKAxWbK8nS86KblmkTZAfgGZfCmaK3F6QQDa9SK0mqGgeiYpbpmPjZeRrgt//snqzYZ2O5GVVIC9HqaM2oINndrfIe1gH6rmc4fnu2f6hf26SsUl/6nfMZomEFOw1CdVjYuEt2DCwk7958LCQLsmv8YXeYJgZWGZFJMG66Zv+pp8s62f5Cy5+HwPc7rsoNNY6Ms78TlmKt89z0sKrBk71LmPokF0IXfMET7bzq5sJFVGcD/aF5KeYUsT2U3icHkNNXKXWW/LS6u7Goqaf+8ooMdvkw2lK9RCJF1Plh0ZpMVE25uJtkkMffwlS3PIlsw2k16lz/v35hvmCq 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)(346002)(39860400002)(376002)(396003)(136003)(230922051799003)(82310400011)(451199024)(1800799009)(186009)(40470700004)(36840700001)(46966006)(40460700003)(336012)(1076003)(7696005)(426003)(6666004)(82740400003)(2616005)(47076005)(26005)(478600001)(36860700001)(81166007)(107886003)(86362001)(83380400001)(316002)(2906002)(41300700001)(8936002)(70586007)(36756003)(4326008)(70206006)(6862004)(5660300002)(40480700001)(8676002)(44832011)(54906003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:10:50.9469 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9511d1ed-7a76-4b24-3582-08dbbf638e1c 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: AM7EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9006 X-Rspamd-Queue-Id: 658728000B X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: nytbojmd84bmzut7brzgaunoqc7sgp58 X-HE-Tag: 1695823861-232310 X-HE-Meta: U2FsdGVkX19HwqIt8XgNMkCMMwIviNE/OQ8jVu37K4IchFEZ0lpr8sUm6zgKygwJp3bak3LhThrY0S1YNTRvqT8Ci3pQWi8nSJ8U5eQepVTzeHxaszcjrGHHDRVRqxrzjwqs3Sfxf1Iw+7ZvxrCjmdeHRI6VqK6iRELMLS/DpFMQ38w8DO2I99/n1suNWK8X4T/akUHXCkwKFSZcPyspBtYfwJeorfLgRz8xSNDix37OnxC8gzW6ovf/KNzRCn+7JpHbb8mZQ5w3tKAWOnTM3Zi52jNFVOjItNSqtpqKzX/7L3c1xwgeb4NaPWzg0Ne07fzfo+XGpw9wWU194/AAKPkeNb0JrL2TWc8pIE7+pZ6odGRENZCgry87QE6xsdJqNXSwaiCttsq6P2JnXfQKk4GcGtcnsWzzAK2ZI8h5mO3RIwKI0vJP3r/sFI/svGwZH8giuvFoHtL6erQve7o0vnXkmyviY6PTYBHiCSuexl9nIOEGGwSWB2nc2y71zu68kFAUH8pbdMAXyKVtphJPflAU0HznnxBbqjRAe597UmYG1+lsle5VUyG536MubgWhejJHnOKlgL/Z07NXUAgcHUfh0TK+EWP/keOTV38PmoGfIx+XrcdycvVicuGSQZstySmd2d1bmmJaFuvw24ZEQ5n11dWktjMTiGgEXtNXV+vSUGHCpBD91Jvu5x9WJakg3hlkvB1StvQto4Vu73toNI+SdYjpq8Ak8T4ph1HZmRgVbcSgDAq56JBClcvOuNLnd6vK7dPFdpJ7UlJHjPy5A3+zPKmr51fZSazijzVZPcVH0IrgPhPA4e1G4vcm8Z+jG6aPfmMpSS4hkNWu1GAeiroUwzpQaPBJWMj/vS3yTrbuarsa7QFtbTeUiXHpktrgvfHRyPkMK7s2hb4YxgJKfLnttnSLKVM24eglJjCVlz1D8gOO5h6AUfGJilfYTChHknySf1wdI+0XkBUdJBC IMuKgfH4 ecLku3ae4Hgq5wmLMZjhF2iJ9Ne5PhaHgjG424KZu/r7Z+xg+2lchw96/QAAJTttjbu1tEg4Eh5OKJfCUh0wfjD5NXDp6D++Zk9DAp8eD+UU7V/io3Lw9w8j6zycnT0ArFbI/7BAAfOQY9qAACDM2XXYijwx2KOK9gvFuw+v+t+A+qAXC8XOYX4yRw3mfsysvukIjH4CVAlPYrirnE+qQz+/lMK1NnoDtUiXlozEYQpMmuQpBoL941Nhf0qTYMX33b5a2dHBtmif4MDkPWVNO6DJyIJbk7gTG9kxFCakauXe1VfxiQlvtjSfd0ZyY9mA1m2BbE6L72B8WzpcgOZBocJxGaUi3ZBYqLbG8bCkWRiFlZ2YwD+gj5rpV+hyIZ9BCcsbsrkvDnbhM7Dyj9adFMz5KQjBw2tJePMgCiQNALbCFLibxZ5k78gT8bVY++tqqUmCVenYC8/ImDQuMDkrn4sMwHmnZP3x+Ghnd7OmtUIC+0wUd5sl2VAvu8GDokll3MJmRHwwvk6luFBdB8Syd+jNvTC7WgqoYykCp/Dh6VH74ef2AUF63VkcSr8x/HoKDT4rQ 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: Set the EL0/userspace indirection encodings to be the overlay enabled variants of the permissions. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/pgtable-prot.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index eed814b00a38..06fb944ef252 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -141,10 +141,10 @@ extern bool arm64_use_ng_mappings; #define PIE_E0 ( \ PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_X_O) | \ - PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_RX) | \ - PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RWX) | \ - PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R) | \ - PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW)) + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_RX_O) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RWX_O) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R_O) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW_O)) #define PIE_E1 ( \ PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_NONE_O) | \ From patchwork Wed Sep 27 14:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400898 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 E5B8EE80AAF for ; Wed, 27 Sep 2023 14:04:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 802A88D008F; Wed, 27 Sep 2023 10:04:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B2F78D0082; Wed, 27 Sep 2023 10:04:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 604CF8D008F; Wed, 27 Sep 2023 10:04:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4C3198D0082 for ; Wed, 27 Sep 2023 10:04:49 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1E56EA0A0B for ; Wed, 27 Sep 2023 14:04:49 +0000 (UTC) X-FDA: 81282548298.22.1A63F12 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2055.outbound.protection.outlook.com [40.107.241.55]) by imf27.hostedemail.com (Postfix) with ESMTP id BB0C740021 for ; Wed, 27 Sep 2023 14:04:37 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YBszuH0c; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YBszuH0c; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.241.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823477; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kFEjo2t9rOVduPNAJeqfskeri2ER5SQruQHq8BWJZ6w=; b=Ly8G41gNRsuD8x2TbAxnCAHttV6eFyLwf7PNq6a6jHlAxgOq5HkTsl5BcezPn0uyuH4d2q oqaM5DhORAd4G6QNDhXt/AIAFwslCfUrEv1k5vXwq6LMVPKVrTS/vECB1qXlWmMEfkvhwd yocbBCe6uH1mBHpxiUYkvkViqtygz50= ARC-Authentication-Results: i=2; imf27.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YBszuH0c; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=YBszuH0c; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf27.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.241.55 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823477; a=rsa-sha256; cv=pass; b=UjhmfkdGFqBtptbSCB3gDI7T6plZlA1WEtqoiVZ51/23sJo9ZKIUYhJWxsNPGEHNnoRKEy kJgRoytbZCgjlTt8QSCTM+ZsMoXRCCbvAYHSot0CVUSW4r2x8c0Vn/UJDKe/xIAY1nX4IJ NEgqLQgN+VE+8QReU40cZfe4/rqDkVI= 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=kFEjo2t9rOVduPNAJeqfskeri2ER5SQruQHq8BWJZ6w=; b=YBszuH0cAsq/i9GkKK54G7LGt1+ciPk18NcE440w5s1rYJpuFMbQQ2Dhx0rHR2HPilO8YaNatJjQBFtbOdIYDd0IKzASdGHZc/DoZ4Xz/9GGL/f61kvGNgShP81TOB1b6baAjiFB9eJhAxl++moX4LeaT7tIJUcNeTAB9mRkBr8= Received: from AS9PR06CA0464.eurprd06.prod.outlook.com (2603:10a6:20b:49a::22) by AS8PR08MB6549.eurprd08.prod.outlook.com (2603:10a6:20b:33d::6) 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:04:33 +0000 Received: from AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::7f) by AS9PR06CA0464.outlook.office365.com (2603:10a6:20b:49a::22) 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:04:33 +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 AM7EUR03FT017.mail.protection.outlook.com (100.127.140.184) 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:04:33 +0000 Received: ("Tessian outbound d219f9a4f5c9:v211"); Wed, 27 Sep 2023 14:04:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 115ef5d33959daa6 X-CR-MTA-TID: 64aa7808 Received: from b618c45c74c0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E6CA58FB-CBCF-4860-9E12-600891D4B576.1; Wed, 27 Sep 2023 14:01:59 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b618c45c74c0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JlJSBRrQd9zuF0qGFRfJXE4x5iSynws/+DTgoCGPghUf8zA7MlKixoJEJ07jGEREcJkbJSE7RHmk5SX7Jps8YWbsTMPGZY1mwmRcqkwUIWChzuKxeT1bBrC9VK68F4XxJkHaFaW7w/U38FpFLneLB4W0slmFLWP8JrV/LjumirReC4nXs8SgwH7nSvqEhtzKCtIT3elIwtJtpA8W3+EYznoWElI4axybEC88eQuaOMlkpDAyODdW7/7Q0YMpkg//+3TeWqAYuh6C8Cc59Uk/tzmUPIfwpwo4+Gbl7JJHE1MYHXFA9iPoP28w6C3GE4RXxL8kAgjYJchlbv6p36pXpg== 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=kFEjo2t9rOVduPNAJeqfskeri2ER5SQruQHq8BWJZ6w=; b=HuR9MoBSG4WO5/udbccZNmcDRuRPj1tLaYXCGmHfDzjmH4q7LkUYtJjHXBeYLOb2Bg+z3vb2KtG6Tgftbm7f49e5DIVRNr/UqGf/xAg8nJlraURiOJJAxuc69dDDfdiBkOecKxJi63afVqRRHNJsbrn8qOyZfbDqUwX6y7P5SNUOMcDsdpIMEjFOJzaOlweAC58EQj3q6LAswAzTibdGhTXtxfA96mtC4WfZzqrsWPKYptKNZW/Gm1r5ujwbujs5V0vgPPwPn9pLnTXJyS+uwQHytCb0onWiSePYEbJ4gg4n5Yb+QEsCNRtSYiXN0IEknWcBPbYxBHm+zH2kr4pe7A== 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=kFEjo2t9rOVduPNAJeqfskeri2ER5SQruQHq8BWJZ6w=; b=YBszuH0cAsq/i9GkKK54G7LGt1+ciPk18NcE440w5s1rYJpuFMbQQ2Dhx0rHR2HPilO8YaNatJjQBFtbOdIYDd0IKzASdGHZc/DoZ4Xz/9GGL/f61kvGNgShP81TOB1b6baAjiFB9eJhAxl++moX4LeaT7tIJUcNeTAB9mRkBr8= Received: from AS9P194CA0005.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::13) by AS8PR08MB8275.eurprd08.prod.outlook.com (2603:10a6:20b:56f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Wed, 27 Sep 2023 14:01:56 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::7d) by AS9P194CA0005.outlook.office365.com (2603:10a6:20b:46d::13) 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:01:56 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:56 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:43 +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.27; Wed, 27 Sep 2023 14:01:42 +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:42 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 18/20] kselftest/arm64: move get_header() Date: Wed, 27 Sep 2023 15:01:21 +0100 Message-ID: <20230927140123.5283-19-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: AM7EUR03FT013:EE_|AS8PR08MB8275:EE_|AM7EUR03FT017:EE_|AS8PR08MB6549:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ff15cdb-c7a1-4ecb-f471-08dbbf62ad5c 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: jFDFJ73sw6DGXXsVRdE2jbsvQ66GIiN8BVTv6KPgRx9n5Y4Ecgj9LeeXkb7MeFfka5D6mnTreBUIMhXKa48S2FxVXe5dY0ETh5dAay10vRMCqGVPtN42CBovbNCxOqlGL8rDv9jRPz/TFBMZTShLoxZzq7XZRY2PwztUh7uoIfn7d2hE7wLahlFt2fm3PW30ZDznxAO2+/vXtlHmCT9cpIww9gEBwYJ8uGAN/i9c3TQDjIiN0TPuI2RVLMrpGK8HjacTlNkuJhNdrGyDbLC3f9Vh2nNHYNJs6H5hw5zbC7D0DbEg+isl99hODMo3CgGqKjdi9oRsiR9AfOru9zLKqBHJsrSiGPRYob6iDJUdg2N2NH2+7nVj7Wf6uIapwkQdXxPj7P9Pwrk9qYD6rcOQsTgOSMESi0nVa2PhX4o3E2rSEBLYzPVy5lkT2Cga7nCh+xbbCQ2bOOfT+wsdz/HlsjLdL3mjPPEgv39m/DeVZkepT/JK+FJjwutP61NUOovuZhUBMYtM94sIP6/MiStoVz75RoG9cKDPI5DP6Ct1DmUq0+WpX2QC6KZxRRPlR+MX7n8SlfkWhXg8bI7eQwuHQLuAkZF365ldtJ46sb5Budc7kwxrrEyUBLgeyCHI8H9ct6fMq869vY+gYxtqBwBcKadVES3vm/kC2eHW0msTN8/kvHqeeoqbTaDuEFFtVnJ0fmBS4TCEa1O6dFAFSKjpUtiWBsstWOO4wZoz1e8J8g1sU/hQV7ZVZHYcW7ksHGkBAzNidN4H6OJ/eUYAAtbDZA== 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)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(82310400011)(451199024)(1800799009)(186009)(40470700004)(46966006)(36840700001)(6666004)(40460700003)(36860700001)(36756003)(7696005)(82740400003)(356005)(83380400001)(86362001)(81166007)(47076005)(2616005)(426003)(6916009)(316002)(26005)(1076003)(54906003)(70206006)(40480700001)(7416002)(41300700001)(2906002)(70586007)(8936002)(5660300002)(44832011)(8676002)(4326008)(336012)(478600001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8275 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e400a40d-5a52-4a00-a7c2-08dbbf624f53 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AKiukEpKtuuV5PlW3fdxLBRrqglIMNtxMiQkh2+pNfm/NAm6ZtBBdQfasEdXMlpnY8jmKBMaq437nmH9BQGvD4so9p4lQcqRhWySS2T+GFVSn3CaKo7FYGc8u58HnamoR6d040DzNbq9So8R8jVgNezsqbf5Q9/BYA90k1vmaTWJTDiDSurXiPXScLiwSjBwwd6csFXczwv6oWTF24qiIICkwKqUaFe+aKXTWtIINAfWV/SYfsrKGNSuJUSAYgDvzXyzf899FZsZmP4JDXcjaOuhRTJw2r7fuZEsmKQcs+uT39KZ5cNI61sh6qFGhf/9lKmgW6GEmwp1b/LKE+dZiXTvxSZKyaE1WQdGYZzfIqUwDzKy0/tznT6ZlScqdjEEwfqIZaT3IT4HgffFk9gXmxi8o5x4bDnrZH9wXIUCcLcWLiM6nzHYOZkdDyLVks6YI1xOSPnRjOwmq5mwjzAAgITIM1cnHCYtwIBe5xtZnqemGE1/Y5hZWFMBDhb9JvIAwv4jKQlJ+ZZ/Xw1BCGBGDpBkLTtd2QMyn08MMwVoz51Gg5qu9bXVx8mtSE4uFNnBi5/KsaJon7fLdDXBNuyxZJ0w5EGjLEjfNKnogEB58zTF2JKqFvAm5/SlY2NyflJ+jTLB8vS0lDKYtNQ0as4bXq5AQCZu2riGcJRGairEE6S0zPRILGjF6qSVpy0kdKhjGYHKYyz5zbc0kgkY4zuYv4K3XMz94Qtku6zncLmhrtLCaUjoHx0kxyWkhY2zBb9Y 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)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(82310400011)(451199024)(186009)(1800799009)(40470700004)(36840700001)(46966006)(40460700003)(336012)(70586007)(5660300002)(316002)(54906003)(83380400001)(44832011)(40480700001)(41300700001)(8676002)(8936002)(36756003)(2616005)(6862004)(70206006)(4326008)(86362001)(1076003)(6666004)(426003)(7696005)(107886003)(82740400003)(26005)(81166007)(2906002)(36860700001)(47076005)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:33.8682 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ff15cdb-c7a1-4ecb-f471-08dbbf62ad5c 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: AM7EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6549 X-Rspamd-Queue-Id: BB0C740021 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: pm5ob1w1ui8q56egr4bq3gk4dmrmngdi X-HE-Tag: 1695823477-956998 X-HE-Meta: U2FsdGVkX1/fJ5jyNhxwGhxJ85nfHUIp7jU4YhYtcvREx1+AdzPB/LiDL48CLp/NFqr3htkGOfna3HzmgnJfnZU7nZoMRzt+pz1oFp89+pZDdbhC/cXG8Bxahk0AGxstfsG1UrZ7fNA9xUuE5Q3BJZvDhi9/cyYsqQuQrnzzOZVFMXCHsoEqBdGxIDAm2lSI7MYoDag4PayMYgrnEjV+0IPIxDuLkWPBQOJZe/9SagzfWYMpY8qCaMtJrQpr/TAhSoIz4ivO+bssTiJVo85GKSeAxFroPaQjUJ45g3hhumGNW0dZNNyOldmtI92H3axfjC+p7hqaaKfszv2KK/th6Sjprxs6tRnadhNfqqlUh9oW3wycz2dThEOfWGcepbqXZwbZkkItI0mEIGZlDExSF6Mx2iFoM2yytRranuJGdlHakmjSTwUapUVYcwu3Mj5Uf7hUglLs3i6st2fOnOGdujlHH+vgTB6Oem9tQzMhYYSHZyD8sqLAV9/7A2sQPVgdcufV9+gQY8UXCtxiY57sRb1+w59TtkLD3JAsRzyWAMOLd3HPep6tFpnhcINI3uCArRlTwvY5hQYabRr7yF23amwUEL1DnWMrVLS8aQceW9sOZzlmMZuBd/2m3fIft7/FpguvYgdTlWzAKIRipdTG6cubamEhbE0yBjw2qkNcmeiFMlEUmGs9cfmfzi6l6NSRpUP3rf9aFAJRDHF9qjm2keuR6GaXw9PYibrK5oO23hVnhhNoDrbEDx7env8GB1pfh1KhCQDrXY5Oeaf195M/iqJGhF+ScWC2p4s0mOp53xSeJvJq4b92LqLIHJsOSbJhMnYZsAVekuJ34nyVxb5XYVxwxps8TexXA+OpPugLMxRWWSipcexq53kCPrL9NF6r5cVLy8OAFT/vC1AEmmtyF6EISS91aPEZw4B7mWYaX+S1J3MFYWzY+v5iNmjDLeLagD1E/4PxuNMdvEnPLVe TTYlWlbP NERpuGR0wDf7G9eppGP8JL7CvSYccOTTgqpO4FX2OdEl927IbDf8gYf+m4inKZDt0CeB5vTBzaMz+9ltE/p0/maPT6ayfcqM5OoE7yNYjd8+nFARNoXgqzUG9KIWefOk1Y9rJbPS8FOfikYvB+BwvWmt+6sgLs0q1CJ7IImBKQKP6r2VW87t3L9CLWgs54fPHxZIJYDvXmnrXkQ1b4p+viqMxfWYGkEWoRVc8ZLohqonJhNRXmuAukwdX7R0RHA+8JWBMX08lhfECrHt2vK/sZ4uEnj82T27K9EzEPO0t2+U7ST5wGH8/Gu+x25aXYA68R1IEYMnOoFD52RXCZZ8sfjcPymggoAW6LwCNo+Rv9Dw0cYs5Fq27jKd9FcI4YpwQBMBNHziJpWkSV3KFXR0Kob79Km29g/9DdN1bspbTYTqq0IYsvLSLTukPitCLnIMsY+WlAP1rSlEtB4jAk0QMt+6mEjV4wU3dqM7tksGJpOJXZ6rg8ODHgrBFFHj+z55PIcIAWZ0xgm+cPb4DTSuF5v8FIgUNEqs7WVgpXVPdB3MBl8T9+ExL09QjydKjNMaYhXH+a4rMyb/if6/cRIQv+NG2y4TG51gevYPyLiYIIJ2K8+TFHFRhujorwqmSfAly7V057ncKssNxN8dsvmb+nXrHa9EhSwGHCBsXuYDB5849F6MhZ1YoKKq1aAQSv3+BWKrCuwOUOpCCjpkeuFSON+phvg== 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: Put this function in the header so that it can be used by other tests, without needing to link to testcases.c. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Andrew Morton Cc: Shuah Khan Cc: Dave Hansen Cc: Aneesh Kumar K.V --- .../arm64/signal/testcases/testcases.c | 23 ------------------- .../arm64/signal/testcases/testcases.h | 23 ++++++++++++++++++- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/arm64/signal/testcases/testcases.c b/tools/testing/selftests/arm64/signal/testcases/testcases.c index 9f580b55b388..fe950b6bca6b 100644 --- a/tools/testing/selftests/arm64/signal/testcases/testcases.c +++ b/tools/testing/selftests/arm64/signal/testcases/testcases.c @@ -6,29 +6,6 @@ #include "testcases.h" -struct _aarch64_ctx *get_header(struct _aarch64_ctx *head, uint32_t magic, - size_t resv_sz, size_t *offset) -{ - size_t offs = 0; - struct _aarch64_ctx *found = NULL; - - if (!head || resv_sz < HDR_SZ) - return found; - - while (offs <= resv_sz - HDR_SZ && - head->magic != magic && head->magic) { - offs += head->size; - head = GET_RESV_NEXT_HEAD(head); - } - if (head->magic == magic) { - found = head; - if (offset) - *offset = offs; - } - - return found; -} - bool validate_extra_context(struct extra_context *extra, char **err, void **extra_data, size_t *extra_size) { diff --git a/tools/testing/selftests/arm64/signal/testcases/testcases.h b/tools/testing/selftests/arm64/signal/testcases/testcases.h index a08ab0d6207a..c9bd18e7c538 100644 --- a/tools/testing/selftests/arm64/signal/testcases/testcases.h +++ b/tools/testing/selftests/arm64/signal/testcases/testcases.h @@ -88,7 +88,28 @@ struct fake_sigframe { bool validate_reserved(ucontext_t *uc, size_t resv_sz, char **err); struct _aarch64_ctx *get_header(struct _aarch64_ctx *head, uint32_t magic, - size_t resv_sz, size_t *offset); + size_t resv_sz, size_t *offset) +{ + size_t offs = 0; + struct _aarch64_ctx *found = NULL; + + if (!head || resv_sz < HDR_SZ) + return found; + + while (offs <= resv_sz - HDR_SZ && + head->magic != magic && head->magic) { + offs += head->size; + head = GET_RESV_NEXT_HEAD(head); + } + if (head->magic == magic) { + found = head; + if (offset) + *offset = offs; + } + + return found; +} + static inline struct _aarch64_ctx *get_terminator(struct _aarch64_ctx *head, size_t resv_sz, From patchwork Wed Sep 27 14:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400900 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 D8BB2E80AAD for ; Wed, 27 Sep 2023 14:07:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 608968D007E; Wed, 27 Sep 2023 10:07:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B7D58D007D; Wed, 27 Sep 2023 10:07:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 459258D007E; Wed, 27 Sep 2023 10:07:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 375E68D007D for ; Wed, 27 Sep 2023 10:07:28 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 0C8DFA09E5 for ; Wed, 27 Sep 2023 14:07:28 +0000 (UTC) X-FDA: 81282554976.03.19F3C22 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2053.outbound.protection.outlook.com [40.107.22.53]) by imf23.hostedemail.com (Postfix) with ESMTP id EEE76140022 for ; Wed, 27 Sep 2023 14:07:23 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="IQR/k0k9"; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="IQR/k0k9"; spf=pass (imf23.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823644; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ke3PDuWpvvQbAnmsSjQMMQrblM23IAu41vFemH5NCao=; b=rglWrtGslsGqNjoiUCL0BiCJ0EFvzE07Q8NwLssIfXN9hveYUmpo2jyU2bdd8/+hzPLXEa TSEJIpHmaYOeVEQ+03a1m2ncOd6Ku5Wu0qMkDJCsI50NVU46uLn4oWvV5XKIWsc+4P9gqO qmL7o8/399vT0yWJ1YYj4/fqQPhB5d0= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823644; a=rsa-sha256; cv=pass; b=7AJroUCKaZQymsSH1KHT+9UVHfv2JMdhjtp22Bqpe3DOCRFYlJ3OgNwScGpYv5hrqqr4Re uyQYthWxrDyTwczYAyB/FyK3oXLHtUjt7jsEXXK1oMtIJ2059jkMVp/PtQML9dbsZdDAWJ vS2lqlvxNOfqIadygMP/UkESg0MBqlw= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="IQR/k0k9"; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b="IQR/k0k9"; spf=pass (imf23.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.22.53 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") 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=ke3PDuWpvvQbAnmsSjQMMQrblM23IAu41vFemH5NCao=; b=IQR/k0k9/DfKrJ/S4f8xeeX8A/FwNUeQ2O1MkVI8zHsEZO5Lo7Ih0Fv+LNatxsL3J7WqClCfdnHC9KvIfCuFAWmdCxYd9n3abgSdzhWp8dJ6hqqmrqTSdvvPeZUXaqoSuQBEbnPDkZrNZN5uaMzqcgFcpZEztwYVlhC4dY+4kd8= Received: from AM6P192CA0003.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::16) by DBBPR08MB5963.eurprd08.prod.outlook.com (2603:10a6:10:205::21) 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:07:19 +0000 Received: from AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:83:cafe::9f) by AM6P192CA0003.outlook.office365.com (2603:10a6:209:83::16) 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:07:18 +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 AM7EUR03FT020.mail.protection.outlook.com (100.127.140.196) 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:07:18 +0000 Received: ("Tessian outbound ab4fc72d2cd4:v211"); Wed, 27 Sep 2023 14:07:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: dd94921c2097e8bc X-CR-MTA-TID: 64aa7808 Received: from 5a96958b8e32.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9A4998BD-A277-48CB-879B-989D2A77549F.1; Wed, 27 Sep 2023 14:01:58 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5a96958b8e32.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X2CHycpAHVMZQAPmyNTllADynv1x7HnphB+dQn1qGy+h8kwRCN7G8fqM66aIPfW/k8c3kOSZzd8ktf6VC6gz4k0FGCrP4vyko/jHKGEcDJJKq68OFZXvvA6qQDawga5A979ahGbBZIa+0lbwfspwNDDjuXvS7CRFa0kzye45aqLggJ4KU032hxE41R4pmOJv/rVTv/AwsnKjzC77LvFMDc0/gszF65YQyFQtqXvbzix8DFvbrNPbks3Hnt6yzzutP+IVizGrOEBdkmKQfxo0K0r2vlH+EshwSjxCadpkEC8+W8HHVQk85if1jnwmShbiK75xNJDLrtLnNuhZ8sT9Qw== 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=ke3PDuWpvvQbAnmsSjQMMQrblM23IAu41vFemH5NCao=; b=fbnAPhQsy6WG5d2IhZyWStA09sxc4lAYblSj3meiU6ChLK8zGqRDmveWJ4+4y++4MsYH16KPV7WtWoqnNGyMKRiplpNJSmisZZ/HZCqIa25pnQRxlmS8nAaVSeu7dF2pZVsjqUZlltp08V0AQB8jmWtqvmhna8KWUYBhsNkK9BS8lXWMJEnNP0uJFzPxrW0GM+240BYUSMuCpx/kjxLbhCDow68L4MhuIz3CTVXwGI1Uxkbck92X6+tRhR0Ms1s2F8BOKCB4fKP9FwEv6tK9dNoDBg/7HA3r6dALvi1OcVNCVsS6ONzTjUamEH26OncoY2/pXd/tsoyeZhwsDRUYxw== 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=ke3PDuWpvvQbAnmsSjQMMQrblM23IAu41vFemH5NCao=; b=IQR/k0k9/DfKrJ/S4f8xeeX8A/FwNUeQ2O1MkVI8zHsEZO5Lo7Ih0Fv+LNatxsL3J7WqClCfdnHC9KvIfCuFAWmdCxYd9n3abgSdzhWp8dJ6hqqmrqTSdvvPeZUXaqoSuQBEbnPDkZrNZN5uaMzqcgFcpZEztwYVlhC4dY+4kd8= Received: from AS9P194CA0020.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::20) by AS8PR08MB6277.eurprd08.prod.outlook.com (2603:10a6:20b:23d::12) 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:56 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::fa) by AS9P194CA0020.outlook.office365.com (2603:10a6:20b:46d::20) 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:56 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:56 +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:43 +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:42 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 19/20] selftests: mm: move fpregs printing Date: Wed, 27 Sep 2023 15:01:22 +0100 Message-ID: <20230927140123.5283-20-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: AM7EUR03FT013:EE_|AS8PR08MB6277:EE_|AM7EUR03FT020:EE_|DBBPR08MB5963:EE_ X-MS-Office365-Filtering-Correlation-Id: e6c2fb02-bfbf-420f-031f-08dbbf630f5c 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: AeFqx/mCMbHbYbnIAOiKgMsBIU86pTdcduQ8LR9MKXpW3u+PhhFEo3c+uwMEzvjWEAKKBanA4fWz9b1je4eXrxZffLemV0uxT4loJv25U9ASEj11MVxkSH01ON+OiFuKLJjVf+Qe92N5GnOLM1MgGNbGaW6X2++E5Kys89HrLLn6smDYooJvWWYqMRpiaGfyQNb0P3Gdlg3Io0CeKgebv2niQf0RpUZj7A0IWe2DjmYFFXq7TZvXs/tUnKYQE6VYrNN4YxkeMmq3Q2QtOQL3f0To8MWU0kKxQHCv5HTemb1kJVsZllshu9KiWZBZDerTMZrr0frakbr5maG/KZSoHnUGsGVC1a2p4ZtpzFi5zI2ibGzsoOtjWcMOwIoe9OFVaJ/wE717XrudXrfgD2RaDXObvWpIkqSyh+MHPFBQuHxl/v3YKLymCVa3XeACdSG0Ty2F2EdvD6daQGmokHuEnaAGcSPAp12LeJfil30Mt3SOOfXwcj5c3MOAm5vBYkM6II0FiHyhJdqJEOjiyU6i9irv3PUDkygh3+GhuYJGqbyj9MZa7WqbVbbfh4dBC4/j7qwia71ZXGtolcsPkFq+PHA2ersS5J+mvXbg4ryqJbY1SZ/kBXFjMjbe8V37LITrh2mxjgGvtxBV5otrcdyBRzIw3l9ss9jAxGFWoulHcd4slyFP4wv8v2PjMxG9LQb7496TocZ/EBsDbpgPGz2EiT4OnONpwrUba4vLu+fXBZdpyDHKioEwZwUNinZ9SlUdHmmcHop4y1Gc6joT8k+7ig== 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)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(451199024)(82310400011)(1800799009)(186009)(40470700004)(36840700001)(46966006)(2906002)(316002)(7416002)(8936002)(44832011)(41300700001)(5660300002)(4326008)(6916009)(54906003)(8676002)(70206006)(70586007)(478600001)(6666004)(7696005)(2616005)(1076003)(26005)(426003)(336012)(40460700003)(83380400001)(47076005)(40480700001)(36860700001)(82740400003)(81166007)(356005)(86362001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6277 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9096ecc8-2ea2-457a-dd14-08dbbf624fab X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QCQncLsoEUxxktRvjSzrYfMJBRmpJoZxUAxcEo7GqnpvtU2eKlmqPtmUJgE6jpYHSpCkb0Jg57peupDnHk1qsXD8mrKkbbh45TXCM3B0gbYQpCNVvxU/Cf4/7nVweCQUaCKriDcfRWYAmTbsB/+czMEEqfn9qG0ot6qJGjKn0mPjGSMZbLBOtPhlX8oflizcfp+bs1zSeOePNFmV601/wFHTOpgUVvw2IIQdeeaIKqb93rd8RWuGLp/zZvEKmbkFpI8MdhpTZtUmbDYJ1rBYUh5gawx6adRMSk3JH0yLav7xRD5BBNK4tm+wiKCc+BKBZJO6h6UZO5G5NvSxoEyK42KwjEFr+KkiakzxePC6BpEK8/7zzpl8zRGKE87zrH9ypnW6FOKZ3J3J/VpbA7RGpr9RKCQgsAiCcvQ1rAglu2nhFEbpjEK8pwJowyFvtQuoixNqfIhyjPoAeYI3WY+5YESRrY2+zd+bpohm9Ntm75Oz8cl89iPnSrX9Hng6+B0TB0W05aGXT/NeZP8Ixpq+WhxVqZuFmQgsNCHoj0SQCHVXKmXgPn1OU/N1uUaT7Mb35NqksScKGJ/I3IhKNxBm9Don36BdGaggvNX+1oqBGlePLh/MLlQyPERy9Qm28/e5YGyh3cLqSkyv9wj1lt0sAUfyrGv1plObK+bWk1S7UYL37k+0cVRAmqcJrR1m/Mv7GyhCXDcKKraOSUqf/ZmTHdW13apnP7CcEfDdlvNRwEiTvgTt0aWZdmYvVzTjq/Lo 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)(376002)(346002)(136003)(396003)(39860400002)(230922051799003)(451199024)(1800799009)(82310400011)(186009)(46966006)(36840700001)(40470700004)(316002)(41300700001)(40480700001)(426003)(26005)(336012)(2906002)(44832011)(8676002)(5660300002)(478600001)(8936002)(70206006)(70586007)(6862004)(4326008)(54906003)(6666004)(7696005)(40460700003)(1076003)(107886003)(36860700001)(47076005)(2616005)(36756003)(83380400001)(81166007)(86362001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:07:18.2788 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6c2fb02-bfbf-420f-031f-08dbbf630f5c 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: AM7EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB5963 X-Rspamd-Queue-Id: EEE76140022 X-Rspam-User: X-Stat-Signature: 6o315kurws3bb5xrtnoksgt51ie6byc3 X-Rspamd-Server: rspam03 X-HE-Tag: 1695823643-97778 X-HE-Meta: U2FsdGVkX1+bjeNpwj9jiYh1x82VOK2kPQfe1rzCeJ1hUuhFcQeNtpVmU78rwPHiYHvxX/RbjG4ZYz1mB+8YG8CV4icoDZicqiLpscIXfCsRj0rPkRe73Q4vhGbDhsZ2vvg95zev7rIYz7gBtMyIb+a+HA8YJL0f4H3fM1HAwKacmDtajFEEnypxYzE0WLS/iWq+gQZjy/I8vFQA2DxYvn19PFYHTtuf5YY6gSbMEEo0MKUsXtyClJsD7FXpkYBTvaAKkKc609/VuWR5+BUuabdO49PE2Xm4uh4Sw9pVEo42XS6IHQQpWZ+7ENa0TF6cma4JuV9gRYIw2FdkzY3TOAbfw/bk1tYTi0ccVawF3xyK6DsfUiD7BxoQzCbTmLpvllJGs4w+z2tDAs4jwc/ZTg6IF92cdhJ0oeTMz9G02ULjQT7/ifaspGuas3Fj3F4h9MXqOqHDnTQeehQ5mKZZAgGpqD/pMv2MVsM6Wuk8W9sth1T9oOE+arq2lZhUn0nDDbe07+8fVFRHXQ3dhAli7Qz+XWeiTrDDwGf9L/cDVvmk7kog34DrnIVbWbVhnbrvFl7T67OCC7bPQJod4DCCXmSCaB6BputRalJEIELn9hfSxAVerJtZVpvdNSZrxyMywaDN4glM8uuwNuhSRHn1WSGi8Wk6I259OHCOeUaIfqO//4MrlD+uA3rdyTuWpIHbRKU/cKjUCYoyAEHpvOZYHuhbdErEWu2Ax8YLVJf9GbkzsuWKBp7omj0HyW4iHiQs2Vt8V65gISCvnSsiDPBy3a0ycrWm81eoTJF1vlY+La5x9DqdwzTaC6d4acW9EI+Kc4OdhJ5k+RNvBzIKiIdt0eh+TcopCQvWNi+5/LWCpCfEWAnn9NPxB1p+hmAmpJqHF2j3QGQTVP4qSKfcP5kyOaRBCu/BL2XYgicPGA/2X7ip8tR+EWBm2trbZgPjQyGJ/8J6JUGhvcXJy9gVLAM deUATkku 0TARJj8cKkELCsKg83UnJR7dpycvC5nirxwgxSru8G7OfH0XZITlEnUY4CVzRcqKx7BBn6Nm0irnoPhYpjCyiKW3duBNjOiIoj53234iYD4jKIdlxvBD+5Ss8Zc9/z2iPN7DDrmQn6sqpA8qukYXjiIFrxIu1FPvcGe5+8zmlEa1zpUbIyesgi9j8FA5hxk72rNV3Lk+1QzMGNA105aKb7dcRbOC2mTHPrz/A971sATUT9q+XNidlnXywQr7UAUDKoEet8tLqNL4KvWttFTWsc320Jie0SGfl3J05MVxACa+K/U928xJW/PPaLTUsLV5o3TUco3mnF0vfF3M9TfRCFXUpKVrHhRDTZaNpOCc+mxC1ZgtvGoYeqZnMCk2SN40NwXXcR6M8Dnd/xiVYL+a+ciYO19SSgJticAV4E0BmzBVHaKMBNkqrcQYx4wc4eZcg9eYntKHKRycxdmHbPKlV8ZkxvpYODVp/Bz2lHNSD4C6z6he8b/FEaj8eRf03y0+zQZ1R+o2J8kV0IiuDPNj1Nt97MQZ/N+OMwAKLK275ppWLTmpWGiyi4q1ZF8q+mPV2q6RsNRrfKgPiA5pyn1Ju3y9iQKDRRXBvZYMu7XnJlD6eEPLkFs/6l3bYnlfWY29EvE8Vss4zadcbfIP6v0lN0G+J1OHpnLT86a+mKFlLntajqiQ= 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: arm64's fpregs are not at a constant offset from sigcontext. Since this is not an important part of the test, don't print the fpregs pointer on arm64. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Andrew Morton Cc: Shuah Khan Cc: Dave Hansen Cc: Aneesh Kumar K.V Acked-by: Dave Hansen --- tools/testing/selftests/mm/pkey-powerpc.h | 1 + tools/testing/selftests/mm/pkey-x86.h | 2 ++ tools/testing/selftests/mm/protection_keys.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/tools/testing/selftests/mm/pkey-powerpc.h b/tools/testing/selftests/mm/pkey-powerpc.h index ae5df26104e5..6275d0f474b3 100644 --- a/tools/testing/selftests/mm/pkey-powerpc.h +++ b/tools/testing/selftests/mm/pkey-powerpc.h @@ -9,6 +9,7 @@ #endif #define REG_IP_IDX PT_NIP #define REG_TRAPNO PT_TRAP +#define MCONTEXT_FPREGS #define gregs gp_regs #define fpregs fp_regs #define si_pkey_offset 0x20 diff --git a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h index 814758e109c0..b9170a26bfcb 100644 --- a/tools/testing/selftests/mm/pkey-x86.h +++ b/tools/testing/selftests/mm/pkey-x86.h @@ -15,6 +15,8 @@ #endif +#define MCONTEXT_FPREGS + #ifndef PKEY_DISABLE_ACCESS # define PKEY_DISABLE_ACCESS 0x1 #endif diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 48dc151f8fca..b3dbd76ea27c 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -314,7 +314,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) ucontext_t *uctxt = vucontext; int trapno; unsigned long ip; +#ifdef MCONTEXT_FPREGS char *fpregs; +#endif #if defined(__i386__) || defined(__x86_64__) /* arch */ u32 *pkey_reg_ptr; int pkey_reg_offset; @@ -330,7 +332,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO]; ip = uctxt->uc_mcontext.gregs[REG_IP_IDX]; +#ifdef MCONTEXT_FPREGS fpregs = (char *) uctxt->uc_mcontext.fpregs; +#endif dprintf2("%s() trapno: %d ip: 0x%016lx info->si_code: %s/%d\n", __func__, trapno, ip, si_code_str(si->si_code), @@ -359,7 +363,9 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) #endif /* arch */ dprintf1("siginfo: %p\n", si); +#ifdef MCONTEXT_FPREGS dprintf1(" fpregs: %p\n", fpregs); +#endif if ((si->si_code == SEGV_MAPERR) || (si->si_code == SEGV_ACCERR) || From patchwork Wed Sep 27 14:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13400899 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 23C6BE80AAD for ; Wed, 27 Sep 2023 14:05:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B367A8D0089; Wed, 27 Sep 2023 10:05:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AE6338D0082; Wed, 27 Sep 2023 10:05:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9883A8D0089; Wed, 27 Sep 2023 10:05:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 88FC78D0082 for ; Wed, 27 Sep 2023 10:05:19 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 577001C9D8F for ; Wed, 27 Sep 2023 14:05:19 +0000 (UTC) X-FDA: 81282549558.02.7525FEB Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2056.outbound.protection.outlook.com [40.107.20.56]) by imf13.hostedemail.com (Postfix) with ESMTP id 9914820072 for ; Wed, 27 Sep 2023 14:04:31 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NF4nDok9; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NF4nDok9; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.56 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695823471; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z+3d3WtjAj0lDEjDiJ9PNllFhSy1ZGobjrU0fW3T0h4=; b=2KIX8bxKz8S4rwFJ4qcouHYEnQqU7+Ixba9eTakiq69vm2k9ULCjm6yU9nE4y1cFwp7fke PbLoYlxruIncVJQNpI1n8DtSDvFmm/UOhH3dDr0EYipFTv6fqbtCdRot5vSs77JEAyPZMY rqVGHwY0UKuZO5Yfnf6hvKwnsfDZc18= ARC-Authentication-Results: i=2; imf13.hostedemail.com; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NF4nDok9; dkim=pass header.d=armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=NF4nDok9; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf13.hostedemail.com: domain of Joey.Gouly@arm.com designates 40.107.20.56 as permitted sender) smtp.mailfrom=Joey.Gouly@arm.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695823471; a=rsa-sha256; cv=pass; b=llhRugRJEf5oq3yxcM/XCF4wzACk39w59D8X6eQBIRBlTCCrlYNAlaRxrHeAy8P31P6JBL jDsNxY3nokIDP9WjR0nNT2gdUdtz8RGSwp2RlNzF1LWDljNm0COots4okWsq4OIMnIOrf1 enqEJRe37XYBHyzw4pKQTzqY1i2rIEs= 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=z+3d3WtjAj0lDEjDiJ9PNllFhSy1ZGobjrU0fW3T0h4=; b=NF4nDok96mezm8R785usgKxZHS7MG/awe60vazpE6Q9E/PKbZcu3tKy2uBSeJt9EF9Xi0o2GVF2xAAuMrEktIo3ga6ol/LjaFYuJ6OorFTmVY42EhaTRXRA8m8H+X3nXoQ8CFdxInNNFmdfe2nl0hg3ibBBqa7u3BFtdnrvmA+E= Received: from AS9PR06CA0286.eurprd06.prod.outlook.com (2603:10a6:20b:45a::32) by AS2PR08MB9497.eurprd08.prod.outlook.com (2603:10a6:20b:60f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.25; Wed, 27 Sep 2023 14:04:25 +0000 Received: from AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45a:cafe::59) by AS9PR06CA0286.outlook.office365.com (2603:10a6:20b:45a::32) 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:04:25 +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 AM7EUR03FT034.mail.protection.outlook.com (100.127.140.87) 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:04:24 +0000 Received: ("Tessian outbound fdf44c93bd44:v211"); Wed, 27 Sep 2023 14:04:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 822792b906cea6e3 X-CR-MTA-TID: 64aa7808 Received: from f403f3766230.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 33AC8932-DDD8-4D7F-82A1-6681C690C1F6.1; Wed, 27 Sep 2023 14:01:59 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f403f3766230.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 14:01:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BEg8SAGOL1fSKBKlLfGkoy24Ylg0N1c8yeh+6EeGDgdP1hRIMEsSyW6gzXYflw/YCzeDTcAoqkNugW3FzrTrxtnxI+lOXhG5KWuVVRDxnPrYerYzOfPBQUPSCh4lgKBPT0nf/lumps7GuTdiuemmEx7Vuir35J6eNTlZSTZ+u6t2+uoyOYuqbJ+/bvFtnbfL8W11HLtuj1b3XHHjoTK6BY5wL+rjKhjuK9O0aL+PUhrJ5SPcPlHB3H4bky0w0MKMNiBNaVv8TTixgD5Q/MX8DxnEZHAanoObD1ErTFhMpunLSzZdX190vLBw+IroV3/tjn0SaxI8vsh0Whb95I7+0Q== 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=z+3d3WtjAj0lDEjDiJ9PNllFhSy1ZGobjrU0fW3T0h4=; b=HIBl56U+JwZ7glWeZ6ENESWAtKC/ORP/aY4byODAUKJmhyYsEiiZ5NnRogjs4KhoNxDxbCE/7QExVdDAKpCyDFsoOdyhTNQFz4oxf0vdGFqqOurGI+/m7oGesXqDxsGLK04wZmMTCUqcDL89sHdTGAcjzwPnAcI42DI0x5O5gmeRh6AOGhcIiabRLgJ8Emy1GLJOSbNj3VAwqSrS4BYKfAHzTmEdqpTtdSmfQPLYAA7YcTdWBGiSSZp8o8LHha5Q/zcbLiuaWX9C+A/RncviSNe/uuBv0rnVKtTccvIUxIz+75PnoIjw8Pz8XBWFdI5ZF3DMxHi7bebbRnoFN2Li2g== 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=z+3d3WtjAj0lDEjDiJ9PNllFhSy1ZGobjrU0fW3T0h4=; b=NF4nDok96mezm8R785usgKxZHS7MG/awe60vazpE6Q9E/PKbZcu3tKy2uBSeJt9EF9Xi0o2GVF2xAAuMrEktIo3ga6ol/LjaFYuJ6OorFTmVY42EhaTRXRA8m8H+X3nXoQ8CFdxInNNFmdfe2nl0hg3ibBBqa7u3BFtdnrvmA+E= Received: from AS9P194CA0028.EURP194.PROD.OUTLOOK.COM (2603:10a6:20b:46d::18) by PAVPR08MB9844.eurprd08.prod.outlook.com (2603:10a6:102:2f8::15) 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:01:57 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46d:cafe::72) by AS9P194CA0028.outlook.office365.com (2603:10a6:20b:46d::18) 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:01:57 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 14:01:57 +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:43 +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:43 +0000 From: Joey Gouly To: CC: , , , , , , , , , , , , , Subject: [PATCH v1 20/20] selftests: mm: make protection_keys test work on arm64 Date: Wed, 27 Sep 2023 15:01:23 +0100 Message-ID: <20230927140123.5283-21-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: AM7EUR03FT013:EE_|PAVPR08MB9844:EE_|AM7EUR03FT034:EE_|AS2PR08MB9497:EE_ X-MS-Office365-Filtering-Correlation-Id: 807d14c5-30c0-4054-fd83-08dbbf62a7f1 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: EyOb/jb0Hqa5tSs21w/DbkrIQCGyFnNctzUo39KD5+XShfSSt+ZjHlpspexjwT4Q9Nx1b9eDNoSrQRI6RNW5vRIzjxeFHVmyEcUSJrsQRqU+3zSGofvyO7KA+aMheZ+xnJw3DwS9stEOyG3rgww1FZgA335Tvv/lIBrVMMHCDovsXxTNK8zHEJzwwILY9/XcDdKUHxnHvTPdgLxKRvkP6sq0485qAgKNCoGP8wQumtkuglm+KHk1GEyOfRgsJvRRmlFdPGrQxTBkMiZw5+iCXEalN2Qir+2W07qeQXDCRDOxgctCFfaVABUE6UUOxP4WEABvZcwELdshKWDs6TnBg6NBy//YEbG3eBcSMtWK4edxwhtWZrX1eFjXfAFa0uqGEksuXkp/V6OrTu8dqMUfBzvcJ5VUF721uySLf3hHKpUdpF0Gal7NL0nH7PvebUs+Yij/VTSyS8ruBBPOiCPvzS6YhCqquB/qG7bMk9f5A/QMYmcxnurbbFaUJwKhLxhJ0ElI4EhiFGlJ6HKTdLY99GaQE17pzazKvKttDJSHL8PfClD3C0GzZHC2pJaqVWySGSCH7LBSvsk1ml6vuGLM3fKdigWGtNTo3DoCCPODy2PSuHMa9xjbXDe/8LoImQpJ7veR4TR+qoG0tiEFmPGJBQaWvuMm3q28DoeZd0bs/PkjSuZ0mEVksdffJMGgnkP1CgAeSjJMvoLoZJpifeyfNXMnBh+Q7q0at8Qzr4dKm/BJg58BPCUpPQ+3bOfLNqpiJkhnmlWBo5objh8Yl9V3+g== 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)(136003)(39860400002)(376002)(346002)(396003)(230922051799003)(1800799009)(451199024)(186009)(82310400011)(40470700004)(46966006)(36840700001)(40480700001)(83380400001)(70206006)(47076005)(40460700003)(426003)(336012)(1076003)(26005)(86362001)(2616005)(6916009)(44832011)(5660300002)(316002)(41300700001)(2906002)(478600001)(36756003)(54906003)(30864003)(82740400003)(70586007)(7416002)(4326008)(6666004)(8936002)(81166007)(8676002)(356005)(7696005)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9844 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4d771c20-b065-41e0-8932-08dbbf624ffa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yb4GPMjufPZL8IKqjjdecy04B1Bzk4TPqjwRq+zSyzax2fbbm3EQi++FyBWV/cX7+67r+u8xCwj5k6FmiL+6Qf/waFA4/ce/wmFS7NImDlaJSkmZtE4sVNZRlqKM6RXUFJFk6sQeCqbNTiUbvNrvnTE6E/4asqaETQkY49sXZxBWqO/o0Dm/1eovyQWHI9kk57NYJeW6qMWgISl+izn1QbbeKfEiAA5NFPxBdA+6QTacjBYSb+Bcs/x7bJT/4DZHxWcGQeqD6gYtRlg5KKf1eePJwtAPltTyxlqQFXO9RF43DB/IK1hjGdjsh+HVKq0+Ac9qDwl1zZWdmjtknm5ID/pgzF+DnXEYAQBI2NDwD8c2SrGc6rfhK5lH7csJAtnF+aOGRMcPagHrIamq4VZq0j+7ZBDZxxePJjTNyfCYodHMtUcKDvJEVFv1Q8u13lsbj9HWG8eThmF2wZ+cQ14F7EzU83aAg9Wt+ItM5GFqZwXwok9O7aFxUk+Ut0Rs3xNqqA7Y+UgAA2225WnuoIO3ff5wVojODFSK2E5Sk93MDztfTBimt8dLDxOPCPzTQup+IcNFZXf9UiPazyCJdb1B7Unyw/oRkL7/R3d55e/yegSfG35aCqXt57fa2wOwKE294dvn3HV5cXTwoGpm6eUiPy2rhAVPmcM1r0UAU5CCfFyadTQiYx3M4FNaImWebnfUqmD3pMkfoSRl2RAsERatzc6DU04zSEKEVHtnm3nVMR2nL4z0D8aE8GHX6r++wckN 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)(396003)(376002)(39860400002)(346002)(136003)(230922051799003)(186009)(1800799009)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(26005)(40460700003)(2616005)(7696005)(47076005)(83380400001)(478600001)(8676002)(426003)(30864003)(316002)(336012)(2906002)(70586007)(41300700001)(1076003)(70206006)(54906003)(107886003)(6862004)(4326008)(8936002)(5660300002)(36756003)(44832011)(81166007)(86362001)(40480700001)(6666004)(82740400003)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 14:04:24.7317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 807d14c5-30c0-4054-fd83-08dbbf62a7f1 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: AM7EUR03FT034.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9497 X-Rspamd-Queue-Id: 9914820072 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: qoknys7ou78cy6nfyi3pq7xx1zodb3he X-HE-Tag: 1695823471-897197 X-HE-Meta: U2FsdGVkX18bM7n8i2UbIMZ4B+qBtRvrxL85gwnoHVarNaV3XWDMCGu1xBuFnlsAPSncYhpCcSv1zKXw56Lqt/q2dOEsWZKYQyOSl6axeSKAlX7Lt+vo39WwLzAN82cPQB/2TkbALxLoN75sY+S9H6WGA6xDvXJC3Nc5FDC06aGSFWYwoxZGKVC6lRW2B0BtENtZE1xFsyOXtMEVlIXTmyj4IguFWoG8P3hOytmgem27Db/dVLXCFTEVJpsL2pvWbTK4uXxIl7cYP7Ug39m1YUPe9W13jlk1Fhn6KU/j4iHVRAja+7UZgcBgI4hZXjPtDwwtY9N9MVjpKbYHw12bnQhUNbEE0tSZKAmqUNAKnwGKS+XnWS3hEaeuUMn7VCMjuG6rmKqPg69/gZoD60f341egs0UeMeaziQmVt0AOxOsOGuzT6UiIYdvdAtoESCwGNtELr8oIv/e/OfxBNI6rrSnaBTIhxocJgeuzK84k4hfYLMh1Un4dlt+9q4rRyNPTDSj2qsXMYQlfD7NHupjLBm424cWCSRSVN9MI+Nyn5JteHf4tQlAmBChhjXr9aajPetWNkXquYg/Im0uNKeElhPV0wYXHjz+33L0E5NBm2zugLKPc9TdvxHYpG1oCjNoj7CTJBzrXhE2YIACvPRXjIf57BaqxzJCReWjHEif55oTAz/s7hT7vJCJtDL4CB9YOfmgj4vGovGxykZmba336nw5K1gBzIr6pDiRvhlyeLm/e9nc7ZlYTeAvAo+8vEIsSe/ORV+Uk6IpxsZmRCAiy1gf1QPMWIt5Q67ygfG6UFkwytqte/Sz4dY3I+TIRd0i0e9qlQR3otCtik9iU1HDvZPIvqo/PEpBeUd76mJPpy7zsEvuL3HiaA9PQ1ZrCJWRp4+rALkCH2fqo9uD+u6YLiVBDHUK4NbfE8nmmNZSFdDE3TzHXSJQr9dk25myAEhdnk5AET1oKDvs/THIlpYV QLP16RKk pjxC7BZusgplYlOqaxBrY5WovwiaUbhiX0PSnH3IN98/CcT3IwpOM/TLERSUkYXlisjv9DNgxW7HcvpTqDkY5rkSEWVRiM37GP0d6xW8VeqMQacetFzC/drVz4RVRke4G8fjEqRjB2bzYLybzNl4vlFbcKz1eHTQw8pf5CaE8NkAd0WJ6BH0/IIdANLUwHd6/qQ5vQ7yJ7QlrbC17OSKVueMLno11EDn5oQZ97ozmAT/FQXOO+WtRwewcJCLdU/AanjFvAF6m4LcSLMVau8+duYxYkelQQp1F7Tz6Q0s/jPsCbAY/aUWAX/LNqL7pvoi+QmMz+HNXpWgWFoS/8qGvbGhh87HGWPwKrHQwdh8ynuUj4/6PFCCFIAoWXHMvx4GvF5ggQhBHbrH+f0wRLYeiJ22QgEPRmpetCMlogHiSOd8+PxONNGUI5uHBYTv1YMY/cfi5Em5fbci0nybf5bHVU2Pu/alUfSZdtU0QpakMaUg/z4Ri137AAtyDKf49tvwrnqxgp3PNrQdgocUhvTu6LKbUYJyTSZaqROBLZvOY/GrxnDGZ0gqEMxv9FNBwJTU5C2fB/iLDG7yPDe8nYAA7rcBf37gstn0XXkfUdBd3WqXLtKdEOZVYMObJerAOXCLt6JwCAsz93oTqouhcvBnZqGwtggjxPYlPqx2TnqqTR+E2rnuPXMNrZu8svK/cYbadDDrWaL0L5ElIX5el9A6pMMGL0w== 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: The encoding of the pkey register differs on arm64, than on x86/ppc. On those platforms, a bit in the register is used to disable permissions, for arm64, a bit enabled in the register indicates that the permission is allowed. This drops two asserts of the form: assert(read_pkey_reg() <= orig_pkey_reg); Because on arm64 this doesn't hold, due to the encoding. The pkey must be reset to both access allow and write allow in the signal handler. pkey_access_allow() works currently for PowerPC as the PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE have overlapping bits set. Access to the uc_mcontext is abstracted, as arm64 has a different structure. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Andrew Morton Cc: Shuah Khan Cc: Dave Hansen Cc: Aneesh Kumar K.V Acked-by: Dave Hansen --- .../arm64/signal/testcases/testcases.h | 3 + tools/testing/selftests/mm/Makefile | 2 +- tools/testing/selftests/mm/pkey-arm64.h | 138 ++++++++++++++++++ tools/testing/selftests/mm/pkey-helpers.h | 8 + tools/testing/selftests/mm/pkey-powerpc.h | 2 + tools/testing/selftests/mm/pkey-x86.h | 2 + tools/testing/selftests/mm/protection_keys.c | 23 +-- 7 files changed, 167 insertions(+), 11 deletions(-) create mode 100644 tools/testing/selftests/mm/pkey-arm64.h diff --git a/tools/testing/selftests/arm64/signal/testcases/testcases.h b/tools/testing/selftests/arm64/signal/testcases/testcases.h index c9bd18e7c538..b6c591117d07 100644 --- a/tools/testing/selftests/arm64/signal/testcases/testcases.h +++ b/tools/testing/selftests/arm64/signal/testcases/testcases.h @@ -25,6 +25,9 @@ #define HDR_SZ \ sizeof(struct _aarch64_ctx) +#define GET_UC_RESV_HEAD(uc) \ + (struct _aarch64_ctx *)(&(uc->uc_mcontext.__reserved)) + #define GET_SF_RESV_HEAD(sf) \ (struct _aarch64_ctx *)(&(sf).uc.uc_mcontext.__reserved) diff --git a/tools/testing/selftests/mm/Makefile b/tools/testing/selftests/mm/Makefile index 6a9fc5693145..f50987233f55 100644 --- a/tools/testing/selftests/mm/Makefile +++ b/tools/testing/selftests/mm/Makefile @@ -95,7 +95,7 @@ TEST_GEN_FILES += $(BINARIES_64) endif else -ifneq (,$(findstring $(ARCH),ppc64)) +ifneq (,$(filter $(ARCH),arm64 ppc64)) TEST_GEN_FILES += protection_keys endif diff --git a/tools/testing/selftests/mm/pkey-arm64.h b/tools/testing/selftests/mm/pkey-arm64.h new file mode 100644 index 000000000000..3a5d8ba69bb7 --- /dev/null +++ b/tools/testing/selftests/mm/pkey-arm64.h @@ -0,0 +1,138 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2023 Arm Ltd. +*/ + +#ifndef _PKEYS_ARM64_H +#define _PKEYS_ARM64_H + +#include "vm_util.h" +/* for signal frame parsing */ +#include "../arm64/signal/testcases/testcases.h" + +#ifndef SYS_mprotect_key +# define SYS_mprotect_key 288 +#endif +#ifndef SYS_pkey_alloc +# define SYS_pkey_alloc 289 +# define SYS_pkey_free 290 +#endif +#define MCONTEXT_IP(mc) mc.pc +#define MCONTEXT_TRAPNO(mc) -1 + +#define PKEY_MASK 0xf + +#define POE_X 0x2 +#define POE_RX 0x3 +#define POE_RWX 0x7 + +#define NR_PKEYS 7 +#define NR_RESERVED_PKEYS 1 /* pkey-0 */ + +#define PKEY_ALLOW_ALL 0x77777777 + +#define PKEY_BITS_PER_PKEY 4 +#define PAGE_SIZE sysconf(_SC_PAGESIZE) +#undef HPAGE_SIZE +#define HPAGE_SIZE default_huge_page_size() + +/* 4-byte instructions * 16384 = 64K page */ +#define __page_o_noops() asm(".rept 16384 ; nop; .endr") + +static inline u64 __read_pkey_reg(void) +{ + u64 pkey_reg = 0; + + // POR_EL0 + asm volatile("mrs %0, S3_3_c10_c2_4" : "=r" (pkey_reg)); + + return pkey_reg; +} + +static inline void __write_pkey_reg(u64 pkey_reg) +{ + u64 por = pkey_reg; + + dprintf4("%s() changing %016llx to %016llx\n", + __func__, __read_pkey_reg(), pkey_reg); + + // POR_EL0 + asm volatile("msr S3_3_c10_c2_4, %0\nisb" :: "r" (por) :); + + dprintf4("%s() pkey register after changing %016llx to %016llx\n", + __func__, __read_pkey_reg(), pkey_reg); +} + +static inline int cpu_has_pkeys(void) +{ + /* No simple way to determine this */ + return 1; +} + +static inline u32 pkey_bit_position(int pkey) +{ + return pkey * PKEY_BITS_PER_PKEY; +} + +static inline int get_arch_reserved_keys(void) +{ + return NR_RESERVED_PKEYS; +} + +void expect_fault_on_read_execonly_key(void *p1, int pkey) +{ +} + +void *malloc_pkey_with_mprotect_subpage(long size, int prot, u16 pkey) +{ + return PTR_ERR_ENOTSUP; +} + +#define set_pkey_bits set_pkey_bits +static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) +{ + u32 shift = pkey_bit_position(pkey); + u64 new_val = POE_RWX; + + /* mask out bits from pkey in old value */ + reg &= ~((u64)PKEY_MASK << shift); + + if (flags & PKEY_DISABLE_ACCESS) + new_val = POE_X; + else if (flags & PKEY_DISABLE_WRITE) + new_val = POE_RX; + + /* OR in new bits for pkey */ + reg |= new_val << shift; + + return reg; +} + +#define get_pkey_bits get_pkey_bits +static inline u64 get_pkey_bits(u64 reg, int pkey) +{ + u32 shift = pkey_bit_position(pkey); + /* + * shift down the relevant bits to the lowest two, then + * mask off all the other higher bits + */ + u32 perm = (reg >> shift) & PKEY_MASK; + + if (perm == POE_X) + return PKEY_DISABLE_ACCESS; + if (perm == POE_RX) + return PKEY_DISABLE_WRITE; + return 0; +} + +static void aarch64_write_signal_pkey(ucontext_t *uctxt, u64 pkey) +{ + struct _aarch64_ctx *ctx = GET_UC_RESV_HEAD(uctxt); + struct poe_context *poe_ctx = + (struct poe_context *) get_header(ctx, POE_MAGIC, + sizeof(uctxt->uc_mcontext), NULL); + if (poe_ctx) + poe_ctx->por_el0 = pkey; +} + +#endif /* _PKEYS_ARM64_H */ diff --git a/tools/testing/selftests/mm/pkey-helpers.h b/tools/testing/selftests/mm/pkey-helpers.h index 92f3be3dd8e5..07d131f98043 100644 --- a/tools/testing/selftests/mm/pkey-helpers.h +++ b/tools/testing/selftests/mm/pkey-helpers.h @@ -91,12 +91,17 @@ void record_pkey_malloc(void *ptr, long size, int prot); #include "pkey-x86.h" #elif defined(__powerpc64__) /* arch */ #include "pkey-powerpc.h" +#elif defined(__aarch64__) /* arch */ +#include "pkey-arm64.h" #else /* arch */ #error Architecture not supported #endif /* arch */ +#ifndef PKEY_MASK #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE) +#endif +#ifndef set_pkey_bits static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) { u32 shift = pkey_bit_position(pkey); @@ -106,7 +111,9 @@ static inline u64 set_pkey_bits(u64 reg, int pkey, u64 flags) reg |= (flags & PKEY_MASK) << shift; return reg; } +#endif +#ifndef get_pkey_bits static inline u64 get_pkey_bits(u64 reg, int pkey) { u32 shift = pkey_bit_position(pkey); @@ -116,6 +123,7 @@ static inline u64 get_pkey_bits(u64 reg, int pkey) */ return ((reg >> shift) & PKEY_MASK); } +#endif extern u64 shadow_pkey_reg; diff --git a/tools/testing/selftests/mm/pkey-powerpc.h b/tools/testing/selftests/mm/pkey-powerpc.h index 6275d0f474b3..3d0c0bdae5bc 100644 --- a/tools/testing/selftests/mm/pkey-powerpc.h +++ b/tools/testing/selftests/mm/pkey-powerpc.h @@ -8,6 +8,8 @@ # define SYS_pkey_free 385 #endif #define REG_IP_IDX PT_NIP +#define MCONTEXT_IP(mc) mc.gp_regs[REG_IP_IDX] +#define MCONTEXT_TRAPNO(mc) mc.gp_regs[REG_TRAPNO] #define REG_TRAPNO PT_TRAP #define MCONTEXT_FPREGS #define gregs gp_regs diff --git a/tools/testing/selftests/mm/pkey-x86.h b/tools/testing/selftests/mm/pkey-x86.h index b9170a26bfcb..5f28e26a2511 100644 --- a/tools/testing/selftests/mm/pkey-x86.h +++ b/tools/testing/selftests/mm/pkey-x86.h @@ -15,6 +15,8 @@ #endif +#define MCONTEXT_IP(mc) mc.gregs[REG_IP_IDX] +#define MCONTEXT_TRAPNO(mc) mc.gregs[REG_TRAPNO] #define MCONTEXT_FPREGS #ifndef PKEY_DISABLE_ACCESS diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index b3dbd76ea27c..14883d551531 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -147,7 +147,7 @@ void abort_hooks(void) * will then fault, which makes sure that the fault code handles * execute-only memory properly. */ -#ifdef __powerpc64__ +#if defined(__powerpc64__) || defined(__aarch64__) /* This way, both 4K and 64K alignment are maintained */ __attribute__((__aligned__(65536))) #else @@ -212,7 +212,6 @@ void pkey_disable_set(int pkey, int flags) unsigned long syscall_flags = 0; int ret; int pkey_rights; - u64 orig_pkey_reg = read_pkey_reg(); dprintf1("START->%s(%d, 0x%x)\n", __func__, pkey, flags); @@ -242,8 +241,6 @@ void pkey_disable_set(int pkey, int flags) dprintf1("%s(%d) pkey_reg: 0x%016llx\n", __func__, pkey, read_pkey_reg()); - if (flags) - pkey_assert(read_pkey_reg() >= orig_pkey_reg); dprintf1("END<---%s(%d, 0x%x)\n", __func__, pkey, flags); } @@ -253,7 +250,6 @@ void pkey_disable_clear(int pkey, int flags) unsigned long syscall_flags = 0; int ret; int pkey_rights = hw_pkey_get(pkey, syscall_flags); - u64 orig_pkey_reg = read_pkey_reg(); pkey_assert(flags & (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)); @@ -273,8 +269,6 @@ void pkey_disable_clear(int pkey, int flags) dprintf1("%s(%d) pkey_reg: 0x%016llx\n", __func__, pkey, read_pkey_reg()); - if (flags) - assert(read_pkey_reg() <= orig_pkey_reg); } void pkey_write_allow(int pkey) @@ -330,8 +324,8 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) __func__, __LINE__, __read_pkey_reg(), shadow_pkey_reg); - trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO]; - ip = uctxt->uc_mcontext.gregs[REG_IP_IDX]; + trapno = MCONTEXT_TRAPNO(uctxt->uc_mcontext); + ip = MCONTEXT_IP(uctxt->uc_mcontext); #ifdef MCONTEXT_FPREGS fpregs = (char *) uctxt->uc_mcontext.fpregs; #endif @@ -395,6 +389,8 @@ void signal_handler(int signum, siginfo_t *si, void *vucontext) #elif defined(__powerpc64__) /* arch */ /* restore access and let the faulting instruction continue */ pkey_access_allow(siginfo_pkey); +#elif defined(__aarch64__) + aarch64_write_signal_pkey(uctxt, PKEY_ALLOW_ALL); #endif /* arch */ pkey_faults++; dprintf1("<<<<==================================================\n"); @@ -908,7 +904,9 @@ void expected_pkey_fault(int pkey) * test program continue. We now have to restore it. */ if (__read_pkey_reg() != 0) -#else /* arch */ +#elif defined(__aarch64__) + if (__read_pkey_reg() != PKEY_ALLOW_ALL) +#else if (__read_pkey_reg() != shadow_pkey_reg) #endif /* arch */ pkey_assert(0); @@ -1498,6 +1496,11 @@ void test_executing_on_unreadable_memory(int *ptr, u16 pkey) lots_o_noops_around_write(&scratch); do_not_expect_pkey_fault("executing on PROT_EXEC memory"); expect_fault_on_read_execonly_key(p1, pkey); + + // Reset back to PROT_EXEC | PROT_READ for architectures that support + // non-PKEY execute-only permissions. + ret = mprotect_pkey(p1, PAGE_SIZE, PROT_EXEC | PROT_READ, (u64)pkey); + pkey_assert(!ret); } void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey)