From patchwork Thu Apr 13 11:05: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: 13210145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FA08C77B6C for ; Thu, 13 Apr 2023 11:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EiWJvUO3zuK8pp7Elbs8AQgtboCKtRRjZzlEcRViwsA=; b=U1XmNsp3XbT6I9 yvLPcxpSMOCxT0IczXhoFDUh4ifb4W4WbOtqdDWgU7sC+8emF74utIs9aFlngKqUYytSpMb0Rrv1d jqB7D7MLpPuNdDkaR5nsZNCtdj/223rghqxsKPgUqWpI8zFMkyZ3QO4ZGEcN5HxapjHpmUCALRZH6 37qxtejHkMHqkpUuJQlTrqeVKVlAB8wvhn0hCjwz+9waiFE6duUURS8LGgn5uYjmLbDis+EpYsKXw Hisy3yMyL9jAHc3C0FkEh6RQSsgTNqB7OCRJlCU/lgbkl5L5FvHE+fwfYRhIml4zrd3HS9ceGB3om Ms+zyjcE9dP2ctZMwwQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum6-005yYN-05; Thu, 13 Apr 2023 11:05:58 +0000 Received: from mail-vi1eur04on0606.outbound.protection.outlook.com ([2a01:111:f400:fe0e::606] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulr-005yNh-0E for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=PjR923HtlSQK/rpFR0dxgGkauR740lYEuzsGIhC9MtN7fGb01YsR+LS85pZyOrp17QUTGDDm1T9j5YLCZ2zxzFcsWsrR6Lgo7Y+QI4OodqG47fZegZ2MjveAz157zEUTBvGKprJBhDWgjgbeTInuiGvsgmnpasJo6lwCj67eiqc= Received: from AS9PR05CA0236.eurprd05.prod.outlook.com (2603:10a6:20b:494::11) by AS8PR08MB8971.eurprd08.prod.outlook.com (2603:10a6:20b:5b2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:37 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:494:cafe::74) by AS9PR05CA0236.outlook.office365.com (2603:10a6:20b:494::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:37 +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.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:37 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e6b7c20ac53e91b4 X-CR-MTA-TID: 64aa7808 Received: from 1e35726010cf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 43379424-8A14-4D34-AE9A-5786973B8FB4.1; Thu, 13 Apr 2023 11:05:30 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1e35726010cf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lEF/yseoEUn+i+mUf8zYzciEd9ZCkFPRg8OgO7siYGZkTD1Ba///2pSwjCBLW8ijP59FuWbFRZTDyq9xeXdmCwEZonEjfigUjrnagc+IW3PmWp8Edf3A2Fpn6kp6YfQ88W7lljfnemevqN11q1sEMqkz4OMhACUuXFdA8mQ64+v+6c1CcUN3Pb01lut8EyF1Ls6C0hzaVSxEWVZP3uBUlDz43gQT6DEHWVrTNKiq/FGuYotp4mIYpIj3V13LdM87M81kq85JW0m18MBSfVy4jRUXvXqdJAa5+wGFccUIE2Fbw32OjXpXY3BwsHgf8ZkEysHd/sNF8J0jYyhL+38IWA== 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=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=kOqafftinu/BtSPGcaeRyPhkln5+MSlc+jjqbhFvDgy2OXBLroVglAWIVSmwrjB188JnP08YCV3IuDsXTyZYYCRlMRvttS1TejOvXOZkndzIbt3Dx3usn3mcluPTEX44YD7kegHxrdlYwyv5LPjCpJRA/Ojg+jt19eVSEPT4jjEGzKrikyy2hWCKXP050afzX23FZ0tAk6WgY024PSlCszOjxvSvm7mwjPGS3jUuKTQiXM/+ba3KUGrICSdg+fjTxw+8x16bug9i8fU8c8a8evVvGmr+ZKSyT4IPGjGsSYqNgyg7jcoss7X8Z+lQH/aI/SRxZheHeYntrnVLPBBPUQ== 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=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=PjR923HtlSQK/rpFR0dxgGkauR740lYEuzsGIhC9MtN7fGb01YsR+LS85pZyOrp17QUTGDDm1T9j5YLCZ2zxzFcsWsrR6Lgo7Y+QI4OodqG47fZegZ2MjveAz157zEUTBvGKprJBhDWgjgbeTInuiGvsgmnpasJo6lwCj67eiqc= Received: from AS9PR06CA0449.eurprd06.prod.outlook.com (2603:10a6:20b:49e::29) by DU0PR08MB8277.eurprd08.prod.outlook.com (2603:10a6:10:40f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::7f) by AS9PR06CA0449.outlook.office365.com (2603:10a6:20b:49e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +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 AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +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.17; Thu, 13 Apr 2023 11:05:21 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 18/19] arm64: Document boot requirements for PIE Date: Thu, 13 Apr 2023 12:05:12 +0100 Message-ID: <20230413110513.243326-19-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|DU0PR08MB8277:EE_|AM7EUR03FT059:EE_|AS8PR08MB8971:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ba17354-6704-4a4a-ebcc-08db3c0f0332 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: 561EV+R1vowAJDjEPcng/ziVpjd9a8unzBhVPpL9JH8FjjNuKrJHmuJwxFKRlVxVXfKTBXa936xVke8QlQUAMSZOPYanxntnyP+RN5NxYX55XQF+oI8TI6zQZhNo24C4YnIi34TPp1w8ueHPoYbbBWWe9ANghXa0aSmX8WdAm5DGWlQh04YrZ8bsCAxKD0idmgfjnFgCReIWSDfHyGQoygH9FfvQqfMcKxO0Mo7OPzcBxg2R4SjS1bq4Y43NiL1mdq9LHEXiIHMuX8OU0deJMuAcsVZ17BcUFzc+kmFLQCURcLo9/7DR/kGZt75R1oRSdBS9bUtdqBn60i2ENwevwP8bHfGK7r5XXo+gQOSFhEh3jszTf9eTWIU2LTC1ZFEi4w6vrVfIwr9L2js2nivvB/LbF4iuwb/j154hWc7fGgDzRBrojWMYMP7Tr2tjsQpBF3ia9B0SmFL8Ih9ZRDYwEErzGRLR8N8Xcapw3HCGRFuWK82mOGZ7y90d2aaozCXIil1Bdbptc9hnFTekVk8qIPrOvDjXoPo0vmfsYkOv9sgsjOaeXOhB4mxdi7qreSjgCTklFxo78i6WuCse8zJ33Y6mqbfI4R1deynzPvdjkPM4/0t7c09GBLPaz4CccU47bYw0SBdhZ8ugtdOHbQ6ViaqUokCpEPgcF3SPT/n+h9GQajF1BjpsZ5seh6qXz2DQrc78cSalPKCX603ZTMO3Re1Y8tPPkqGYqIxwpcTbbIk= 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:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(478600001)(54906003)(47076005)(2616005)(26005)(1076003)(7696005)(6666004)(81166007)(356005)(82740400003)(41300700001)(316002)(6916009)(4326008)(70206006)(186003)(336012)(426003)(83380400001)(70586007)(2906002)(5660300002)(44832011)(36756003)(82310400005)(40460700003)(86362001)(40480700001)(8676002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8277 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1702c199-5ac4-4aa2-b6f9-08db3c0efd98 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GtVIbbuaJLdP7zyIU54XyxccAcDzo0ctZq/Q3VzJk22DibwI/kgbcp2ROnQDSS617OC+/GXp0x49d6ZzpJTuXP2iG5yKxNjS0mYO1GnhbA8aCJP229HYcAcJqB9SitdLMx1XcjGLmRKIcdD5jfTzlWVD+3uVlrMa3dB7Mjot8LMc9JvBHlaAgNuldPK1VGK5JOpDbzpbOZOtDEkzmwfbqgx+gn+K2kJXAUGDiitlEgRYc6SzK80twjDqHkH2SbePhRNJDfBdEYMSq73z6UwfORLs03ClVUsT+ArwQxKjWevYlzNw7ABoOXTmXheEUIxNxzu2E7IDOpONpzAY/Td6gOfoR6E7z57Ouq+5hso5aVw6C8udJBuM6wO7Mckl/PDjOyp+iOkHUPbsqRwb5HrU4DdOhirRj548xoXrFEedVIt+PLvm86arUz/N5Zyy7WKtCO3+xe0EOkDiehxgBGkQ1i/g/U4UVSjfhH1XtpsJ/ZxionOttMsbjcOSQuzn51aqz0g5OJCOVgCUhv3d8g+nMVa/T3r2LMKd/0vvFqlTFCofS7wX89yBse2XnA098xCiqCixmFG/NdFmR0Wjb4Hpevxn/31ei4atIobkJxOjTuI4rjgSfMb/AmSgrSXkFdZwp+PkV6IRiRmA0aetjh/Y4kHdCyvhX7mjLDUwt6uEXyqwXR151QOW5r+efYGZbRUG6noZXzMBpQJ415CzuENK8g== 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:(13230028)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(36756003)(82310400005)(86362001)(316002)(41300700001)(7696005)(6916009)(8676002)(54906003)(70586007)(4326008)(70206006)(478600001)(8936002)(5660300002)(36860700001)(81166007)(40480700001)(44832011)(47076005)(82740400003)(2906002)(186003)(1076003)(26005)(426003)(83380400001)(336012)(6666004)(2616005)(107886003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:37.8277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ba17354-6704-4a4a-ebcc-08db3c0f0332 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: AS8PR08MB8971 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040543_138343_FFCF7FBE X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Features PIE and TCR2 introduce new registers, update the trap requirements for these features. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Reviewed-by: Catalin Marinas --- Documentation/arm64/booting.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/arm64/booting.rst b/Documentation/arm64/booting.rst index ffeccdd6bdac..babbf36f0ce2 100644 --- a/Documentation/arm64/booting.rst +++ b/Documentation/arm64/booting.rst @@ -379,6 +379,32 @@ Before jumping into the kernel, the following conditions must be met: - SMCR_EL2.EZT0 (bit 30) must be initialised to 0b1. + For CPUs with the Extended Translation Control Register feature (FEAT_TCR2): + + - If EL3 is present: + + - SCR_EL3.TCR2En (bit 43) must be initialised to 0b1. + + - If the kernel is entered at EL1 and EL2 is present: + + - HCRX_EL2.TCR2En (bit 14) must be initialised to 0b1. + + For CPUs with the Stage 1 Permission Indirection Extension feature (FEAT_S1PIE): + + - If EL3 is present: + + - SCR_EL3.PIEn (bit 45) must be initialised to 0b1. + + - If the kernel is entered at EL1 and EL2 is present: + + - HFGRTR_EL2.nPIR_EL1 (bit 58) must be initialised to 0b1. + + - HFGWTR_EL2.nPIR_EL1 (bit 58) must be initialised to 0b1. + + - HFGRTR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + + - HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + The requirements described above for CPU mode, caches, MMUs, architected timers, coherency and system registers apply to all CPUs. All CPUs must enter the kernel in the same exception level. Where the values documented