From patchwork Thu Mar 9 14:52:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167746 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 45531C64EC4 for ; Thu, 9 Mar 2023 15:32:39 +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=yzrEucW19yGmeoI+UCl1615uIckYidzwRi5DElYm6W4=; b=3a3kioxRmzcRwm DHBI2qpRfrG8X1ZeCnzzfxQm5WDueU1RkqjGxCDWyvshADqF9WlM0cM5tvoPWl8F6S+VjiFOd3fLG 7IpYr619NYELXdrNP+ysBG8aSyqUypIY5Iul5L07U1RXfhlaG1pda1jgq4w3US3dgivuKApfGrieQ wucaiudRVTXmd9ib/git9u38RARIaNmSNV76LZWJ8Q428X+8zG4+gwy5KGxg/9gyRkefP61zPT23l dIzZk66qC/+h8VG7lTrshPGSnG4xGC0QnxZlIltfVywmKPWd2LQowKwvNRrBydhDq+END1fNWSGr2 d9xGxztkCWEE/Drech+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIE8-00Auvf-EW; Thu, 09 Mar 2023 15:30:47 +0000 Received: from mail-vi1eur05on2060b.outbound.protection.outlook.com ([2a01:111:f400:7d00::60b] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHtX-00Aned-C4 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:09:29 +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=Ak4yKw7eCgOSmFiSiB4L/qbqy48qFtRw+GBctcP5UxY=; b=l2Yl9rkmh9vir5WOPXNXPdzOnD3D1kkaeD0hW9qX9OEl9NEVONroM9OXl79EhRIISrukQo2ieqicgbi8RK5Pi2FjCu5VWo1vMg5nEEidZks2jTUPlv9pprqhOzwnIJB8quhh1MtqwCbBHFlhYGfT0pe8kg9+Dj+asQoVrl+BfYg= Received: from DUZPR01CA0127.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::13) by AS8PR08MB9361.eurprd08.prod.outlook.com (2603:10a6:20b:5a8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.32; Thu, 9 Mar 2023 14:53:42 +0000 Received: from DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4bc:cafe::bf) by DUZPR01CA0127.outlook.office365.com (2603:10a6:10:4bc::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:42 +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 DBAEUR03FT046.mail.protection.outlook.com (100.127.142.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:42 +0000 Received: ("Tessian outbound 55ffa3012b8f:v135"); Thu, 09 Mar 2023 14:53:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 33defd049579cd79 X-CR-MTA-TID: 64aa7808 Received: from b8cde0734848.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0010F53B-C404-49E1-A3AE-C704D172FE94.1; Thu, 09 Mar 2023 14:52:53 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b8cde0734848.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W0zuaiN+K8pmQhmc3u0xXhOUr/vCnL2gaAgd+/qp6xGwFXbwTMOt8XsqQFfoTa8QTl4WUrlTmO0fAL0smRQRTfJOYmTaQb8mguxYYw0KTrAdC2jRNRTGqdi2LWJcYuaEnaUbasz3zGDvfZVgxj8N9aaLioy9FRZsNPK+CT5Xe7QV9SPZX4UpiJsPWG6E4fHY7XeiiXqXGsr0fV6Q/WY+x94iHt4FbrxUWbfGkT+soewLzToivJhwJ4rBM7lAzNp9bSrv/AtFgyoOelxWOUt2CgW458oYzAdhCnij8YtDnxBGhg9gguOdXfQ7ajkP86+HtvRpIWhiMuS1b+YqgLAooQ== 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=Ak4yKw7eCgOSmFiSiB4L/qbqy48qFtRw+GBctcP5UxY=; b=YhpoMp4Br3DDELKkIo2jbDBBQmqxQs1byppOftdyiUJOIJEnc8gC92yoRs7F2POsTli5PUxx71RG24dFo3tqqYwNLeadHG1qxE9zWAEriHnR8ADtIlL3VBfsHwuk+hJKYgta4FoNjZBcvJbhmmVCjqAxk2pkcDKkvnZ6xCntKTMBz5CbJ/7pLtoxqIlSCS9Yzim8haiWDAZU8C246TvdkbJr+EPVaIgInuxDCGd7z2ZFNTtqfHgqevb+K262VpoLZIfxUqPDVrNeTXwGUiLn8CJteOE5yvEGVQOJznDm2ty6mtHYyHXrMLgHhySy6rEpDUJAFxC0EfuwgtQwq3jzeA== 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=Ak4yKw7eCgOSmFiSiB4L/qbqy48qFtRw+GBctcP5UxY=; b=l2Yl9rkmh9vir5WOPXNXPdzOnD3D1kkaeD0hW9qX9OEl9NEVONroM9OXl79EhRIISrukQo2ieqicgbi8RK5Pi2FjCu5VWo1vMg5nEEidZks2jTUPlv9pprqhOzwnIJB8quhh1MtqwCbBHFlhYGfT0pe8kg9+Dj+asQoVrl+BfYg= Received: from FR0P281CA0012.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::17) by AS8PR08MB9624.eurprd08.prod.outlook.com (2603:10a6:20b:617::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:52:52 +0000 Received: from VI1EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:15:cafe::d7) by FR0P281CA0012.outlook.office365.com (2603:10a6:d10:15::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:52: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 VI1EUR03FT043.mail.protection.outlook.com (100.127.145.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:52 +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.17; Thu, 9 Mar 2023 14:52:51 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:51 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:50 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 01/18] arm64/sysreg: Add ID register ID_AA64MMFR3 Date: Thu, 9 Mar 2023 14:52:29 +0000 Message-ID: <20230309145246.22787-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT043:EE_|AS8PR08MB9624:EE_|DBAEUR03FT046:EE_|AS8PR08MB9361:EE_ X-MS-Office365-Filtering-Correlation-Id: f228461e-1449-4785-b491-08db20ae1342 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: T69VamTBjiyDAHJdeaizHZh8j6gatip8rQfQ97wGAH+lhJ0K/SGS4XXrBEEBzWkq0dZYNdGbEdoo3Z8rk16o1c/jJ7ibAgG5IiXO1eh+Uz9ihe5KXi4Z83v/fQzCWodqqmMPg3o9d/JKZDKyplt7CR7CDFefeesIU6udVdIgnugi1aIT7H6ev+ANAyRiGAWMhTLPL+2FGexcA5NQeSge5Bu3oNFzf21ufumot7Pd8+I0lOv2JzKY9J1qcEaOJXQKDgpjsU1NbqPLBW/6Jka5xH+4a8BdACpCddoBouPVM3Cc6i8GDHIJeC3w/TgDbjYSedfMJxcdfmi4KUbvXzzkuiAlEYznew0BDIges+ZjwxcLob9d+Z9AdmMU7iq22YCk5VskhW6TfMqizPDLfHPhNjI+C6MlNkBnKP7W2lJpjRTiY5AAheSCOVUGdZplQf0MEdJz8q0s6X3PYCBDzmhrYO8imVYQ5JmeMNXHTtDb45w9cyy4Ji0wD73jvaBUMjOxvL5rCtoUwB9B8Mns24PPL4L59MULKiw3K5J97XZClb3YwNx9DyCcHczK7NHKDGAt8iIh2HmDzAp6UMDgu+6ntSrs1FSPFrqB10NKo4GpZtZwfXiN9xPtt7/mv39eHmh6dt/s0PfFCZNXDYfaWePc9z+taVzSkRxavcTPfzqM7seGAO+CSzCuf5OabelZW3wrEwE44ZJ0OPqk3XYOkutwFA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199018)(46966006)(36840700001)(44832011)(2906002)(8936002)(5660300002)(41300700001)(70586007)(4326008)(70206006)(6916009)(8676002)(7696005)(316002)(6666004)(478600001)(54906003)(2616005)(26005)(1076003)(36756003)(336012)(40480700001)(426003)(47076005)(86362001)(82310400005)(186003)(81166007)(82740400003)(36860700001)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9624 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 24c56d13-aee5-4a7c-c504-08db20adf57a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ayil6JHz+/tiplze2W/ACn9lnoL+mbuhKVeFw2MrDE+9/dMsMyjqzbz8PqTBPD0bH6C85BvdGBx/tqUvGnUqtG4COLsOSGPdUzF1RyvN3Cxw7frKDyog/+HKnzHUuKs4IJmeYqaGKfRqozcgFmyhx+lhpvlAt9V/Xfl9VafRzJPWOG3HiHZAYv4kxWfVJ4NmPFbrhi+epRT9Oj7WTsqRspaHOw4buzxUK64rfKRpe8wAUkZV3++Ez7HZaWLuFTtZWkl4XOkeT8YwmUwlz7UgYpoFwkb9l32AAZDaXooaMPJ+cfRzCQgxJH7oD2GT1+tpVF94Sk6twSqHYYw9i5S8Tuox2Ox4YQaB23zUjmC4OsCkOTUwNALVuIW3+px9nSUFJLzAvzr8IA+uHzy7n9izJd464T16zyTw7DoaoPdhr02vKDEgWG5zYpqxWPF7rqb+KYrRHS2R8FqAPUj+m+iu4H9+LlHroSSayDnWDJu2f9hhB2Hv20GG+DiijzjYJ9MjC54QEmYASVb58Tz+ASsiJOyamj3+lqfARnpIgtqmcMffHeWPqviKW0FoJhr3suu5MhS6dZJIBHtYJRbnx4bOCKXiyN+RhD4xPZb+AGHiUSGT2fnjkTl5eCv1Hbc+5tFqxfhNFtDNBi8AVvI8adcSz/2LrWaGtANeZZ4i3f5lTlnjtOOQeplRg4pyYkp1OES0sIcXwCRuhSbc9Gu/H4cfkQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(396003)(376002)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(70206006)(6916009)(8676002)(70586007)(4326008)(316002)(54906003)(5660300002)(7696005)(44832011)(2906002)(6666004)(107886003)(1076003)(2616005)(41300700001)(26005)(186003)(47076005)(426003)(336012)(478600001)(8936002)(82310400005)(36756003)(86362001)(36860700001)(40480700001)(40460700003)(81166007)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:42.2437 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f228461e-1449-4785-b491-08db20ae1342 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: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9361 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070927_441177_AB49A0A3 X-CRM114-Status: UNSURE ( 8.12 ) 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 Add the new ID register ID_AA64MMFR3. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown --- arch/arm64/tools/sysreg | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index dd5a9c7e310f..a444579a8d2f 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1515,6 +1515,70 @@ UnsignedEnum 3:0 CnP EndEnum EndSysreg +Sysreg ID_AA64MMFR3_EL1 3 0 0 7 3 +Enum 63:60 Spec_FPACC + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 59:56 ADERR + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 55:52 SDERR + 0b0000 NI + 0b0001 IMP +EndEnum +Res0 51:48 +Enum 47:44 ANERR + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 43:40 SNERR + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 39:36 D128_2 + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 35:32 D128 + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 31:28 MEC + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 27:24 AIE + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 23:20 S2POE + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 19:16 S1POE + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 15:12 S2PIE + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 11:8 S1PIE + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 7:4 SCTLRX + 0b0000 NI + 0b0001 IMP +EndEnum +Enum 3:0 TCRX + 0b0000 NI + 0b0001 IMP +EndEnum +EndSysreg + Sysreg SCTLR_EL1 3 0 1 0 0 Field 63 TIDCP Field 62 SPINTMASK From patchwork Thu Mar 9 14:52:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167690 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 A4D60C61DA4 for ; Thu, 9 Mar 2023 14:58:29 +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=wtATXeJ/e0YMF3innjvV668pDMTRQMbi5PPVt84RBEk=; b=4KFfoVXnTeP0Vx REeXIUAkjSHG5DzBExRJBjDNJe0oiNCSosX71WlldGySyhFeEu9uc5K0b5k/cFgSMs67XalmhVZln oGlaMEQ67JYPr2UupjoL1nFoTiFjHqA583Lbb75NwplqHF7FNUyZz1sM0S+ulloHXMgkvhRYl7sp5 6FEJ5hDiy+1Cth7Vh4x6L162AFsQor/eaUFCL0s+ql/4xSglS4Qdrj9vgYZmJGQM90LHKPFVJIFWt qYGTlKIEBECAq4POp/l4PH8fZVE3/gdD/rQcVleuKtu7yfgf/mVPQ9d6oFMBfSV+/mDvpyZwuv/g1 FlUCsqvuLmyvMQOIZuFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHhP-00Aisc-Qa; Thu, 09 Mar 2023 14:56:56 +0000 Received: from mail-db8eur05on2062b.outbound.protection.outlook.com ([2a01:111:f400:7e1a::62b] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHdi-00AhEt-So for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:08 +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=KfkoLVeu1tBBN/kLhmiEQbW6FaVsaWCWyhnBnWa8Dmw=; b=4763MOTnfl1PbJnEEYXDD3rZDuhlHOvNj/SjKPIqDC+IhXpOYx2qqc41IGFgBbNuVnUdlsLPLOZnGAh89Q2u3GvMFKBpD7gLPJTT3HzXA3po5vgZgjvUsd7s6MqTB8GhR6De2cD58LdLzFTwDmZwMG3goUru3XOW0euqRK9oDJs= Received: from DB6PR0301CA0055.eurprd03.prod.outlook.com (2603:10a6:4:54::23) by PAXPR08MB6607.eurprd08.prod.outlook.com (2603:10a6:102:152::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:01 +0000 Received: from DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:54:cafe::9c) by DB6PR0301CA0055.outlook.office365.com (2603:10a6:4:54::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Thu, 9 Mar 2023 14:53:01 +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 DBAEUR03FT020.mail.protection.outlook.com (100.127.143.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:01 +0000 Received: ("Tessian outbound 2ba0ed2ebb9f:v135"); Thu, 09 Mar 2023 14:53:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6aa6feb3c28fd587 X-CR-MTA-TID: 64aa7808 Received: from 02dc11331673.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8FE99FF2-FF26-4E4E-B58B-36AD64211ABD.1; Thu, 09 Mar 2023 14:52:55 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 02dc11331673.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oFMfVclo8+BWyyP8VYeZAkxMaH2jLAhGqFFsRKUvvzcdmVcSp1KOHb+nu08gpAqC3eii8iBEFyxGZyhlkNkCFbcLeB0QrPHMvNtZ4/orYFLSDKnCuT2cogqmupEZg5pP/l63yRJyuHZVTui/zWhYmdl2cBKGVTjZxsn/kMzisTpwaQHavFPg5Q4bbZCQwa4d6w39DK0Ig7lUq6QaRiAmkUK9ijv/pZ2J4rbAaDWCMIWhIsr68wVZT08hf5sltzSHFeek6FH456nafP9fktzTFwyjtrZzrkzzCxMmJTV9UMJybutMk6vxL+ie4dTcLft4JvSwP41VrwHgoCJHAR4g6Q== 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=KfkoLVeu1tBBN/kLhmiEQbW6FaVsaWCWyhnBnWa8Dmw=; b=bT3zOYQbDWzKnmYTSGXZTDZF1Cz5QZMSYKAogbS+IjyWgWybVF0rYNONOda7oRYjNXwmRwF8gKMUxzq8RLhkNZJy8ZahIY0eiZBZlhPHSPSZSD05/en2ApTpo3+3xrUzDAppkuEb3b6GdHn2zuZOea9o4ZQcbz8N9a6Rn8HOEBh/GzvQ8OW+zdDMMhcqDMTYc9SEewdUadSwpn+9lFCLs3wOXbuFst+s60pYgWih4GXPogziFQLviRvZYhVQuJAFjlJmZ5lNasUkWVos4YIH/PLVCYhXPDlHtMnOccdIO+uEzWETONE4zpokX2pBR8sECzm1VNbuGyKLtJJHhWHnCw== 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=KfkoLVeu1tBBN/kLhmiEQbW6FaVsaWCWyhnBnWa8Dmw=; b=4763MOTnfl1PbJnEEYXDD3rZDuhlHOvNj/SjKPIqDC+IhXpOYx2qqc41IGFgBbNuVnUdlsLPLOZnGAh89Q2u3GvMFKBpD7gLPJTT3HzXA3po5vgZgjvUsd7s6MqTB8GhR6De2cD58LdLzFTwDmZwMG3goUru3XOW0euqRK9oDJs= Received: from AM6P191CA0060.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::37) by AM8PR08MB6595.eurprd08.prod.outlook.com (2603:10a6:20b:365::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 14:52:53 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::d8) by AM6P191CA0060.outlook.office365.com (2603:10a6:209:7f::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52: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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:53 +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.17; Thu, 9 Mar 2023 14:52:51 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:51 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 02/18] arm64/sysreg: add system registers TCR2_ELx Date: Thu, 9 Mar 2023 14:52:30 +0000 Message-ID: <20230309145246.22787-3-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|AM8PR08MB6595:EE_|DBAEUR03FT020:EE_|PAXPR08MB6607:EE_ X-MS-Office365-Filtering-Correlation-Id: aa6bfcf2-2667-4b2d-6f22-08db20adfb1a 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: RHbb6j741aqgkuoZT7Jti5BAN2cbtKdPAU7jshmY5tOGNPRfuq6xZ95c4Sn6p/HHhle3VW0r09CAYGID+i9ow/Hqn7B7m8BAocimtd21HFssyQWYEWcSDjbPOLcVozbvnTgCg9Umwqrq3Z4WXJLPoSEsM/8fRRIlYrswmWyOOEin2IMnCSCFbGgXZueKaf9SBcqVvHewwUaq2DaOOXlq+s3RUxaVO0wxmYO5qUeFn3/IISrymagVnvyFaV5oPiFyZ2/GpKwfNzmxRmbZkFnPHaAXM9gjPkvHT9TBy63QZlQKEvWcGQdNqqIUes6fIpn3BFY/9SzNia5nWSV+w14yGmCXkYIOZ0WEk5lJWl6MOX/oOmP8N4EgON0eKmjCvOKwtQEnqSQjM6NERtP9/H/B4XuK0XVQTv6CatV0R/x3J4E77XwwqrqdSemjuRBtUMkY5A8LiuAvmFlGDlzjkqzfwgUMWjUNDBvDEc6CPz+Xnpr3BOjECDutX81nCowbzueXQ6uJV88QmtqBgwGiX5LPp8fUUfHPaShzGWkvTtw06F+v+DKBt13ZVhQZQyT5zQX4L/LYrThHz6BehUk53h88Wq/+JWvgnlse9o/IrkHBV1io9po8in8Sk8trlJeVCgtZ/CPR1XfyIMJbiQYN3Tc+q0AmJdiRiIauG71cnWY4Kqrw4UCRGVLsG1c48j2AqE7oHOaBtrCg7vhEospUFNdZ3w== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199018)(36840700001)(46966006)(8676002)(4744005)(36756003)(8936002)(5660300002)(26005)(1076003)(36860700001)(6666004)(81166007)(336012)(47076005)(82310400005)(426003)(82740400003)(186003)(2616005)(40480700001)(54906003)(316002)(86362001)(70586007)(41300700001)(70206006)(6916009)(4326008)(356005)(7696005)(478600001)(2906002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6595 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c020841e-4869-4e11-01a4-08db20adf64d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UL9NWai3fG4nX5p10Nx+EVZ80YjsKI9M5F6DwTVp2vTFfqGNI5qkukVfHDcgqNlWQejqgZk8QodVL7Pn9xZpgZb06e87C/0Dw6sb4NaXJMExJtD6XWbejkGG0JBK1X4wE5J5muA/tZowwvHBlRHkMMbBDw9oI8HNYb6J9GdvblBwNOMojWxL5xTNy9BnZ+tv+4fqm6x7XbCMEJ6mz8XKDM2S1eAdUd/JlZOcvcsphuZMiI6i5pZSSBMEWRCXO7fMWx16t33vBNpvbDWr0I+nJGKPpK1d0gZUtQw5+S81xOUpuo6E6paOITDbxbvlE6O8jMV1lDV9IWDIomjPt34m/v5y3WJE4yIH0YXzOQeEeodwkrE54uaMJnHF2eNIIQ7ZyGJZAhdqOrupUEi8HdV3SnRMh7bWfuNlrcTknc5A61+lSXiDhDJqbk9l7zpV4da5ixhcLkI+mBR7bbUbcwLXiD2+4cOqRAyJOanhA6PF+hCq/jUADNW6tjPaIK68n3hrWotbIupdJ47Pct/K4ERPWE3aJjASOor1vhuV6GpAFEbnKri87B2sI7vcM1qqAnMenihlWgToTzEfK8J1oJdmNuFiI5ASt7zVnxM/rgvBszWX3I5hKNNC9I3wqNAhbyz7S2bRWuwJcC0D4lwyXC3rK+hw6i0bZkTneYqKnlMSLTJtX36u7Zx2ZOVx64k8XfPcSHMWTrcw4Owo7wl2lllL6A== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199018)(40470700004)(36840700001)(46966006)(8936002)(6666004)(5660300002)(36860700001)(107886003)(70206006)(40480700001)(8676002)(6916009)(4326008)(86362001)(40460700003)(70586007)(54906003)(36756003)(478600001)(426003)(316002)(7696005)(47076005)(82310400005)(41300700001)(82740400003)(186003)(2906002)(336012)(81166007)(1076003)(44832011)(26005)(2616005)(4744005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:01.7145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa6bfcf2-2667-4b2d-6f22-08db20adfb1a 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: DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6607 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065307_145099_65C3A826 X-CRM114-Status: UNSURE ( 7.71 ) 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 Add definitions of TCR2_EL1 and TCR2_EL12 registers. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown --- arch/arm64/tools/sysreg | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index a444579a8d2f..0c3a6790842a 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2050,6 +2050,30 @@ Sysreg TTBR1_EL1 3 0 2 0 1 Fields TTBRx_EL1 EndSysreg +SysregFields TCR2_ELx +Res0 63:16 +Field 15 DisCH1 +Field 14 DisCH0 +Res0 13:12 +Field 11 HAFT +Field 10 PTTWI +Res0 9:6 +Field 5 D128 +Field 4 AIE +Field 3 POE +Field 2 E0POE +Field 1 PIE +Field 0 PnCH +EndSysregFields + +Sysreg TCR2_EL1 3 0 2 0 3 +Fields TCR2_ELx +EndSysreg + +Sysreg TCR2_EL12 3 5 2 0 3 +Fields TCR2_ELx +EndSysreg + Sysreg LORSA_EL1 3 0 10 4 0 Res0 63:52 Field 51:16 SA From patchwork Thu Mar 9 14:52:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167747 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 EC2A1C64EC4 for ; Thu, 9 Mar 2023 15:33:51 +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=K7K6iaKzZqMJwrDydr8EzWRiILQgU1p/DjBiWsUcHjM=; b=WQbQusZ9MgK4wt KoUZJUTKoibypQu8vnR2FuHe+2/dn+0Z10718RSSf3gz7b+j52tCHCK05mfXnFlryH6hMtY9tOQWz QgAh02JnwyKbpgvoeM7+eqR+b8i9hhBoAN+fE4xJx5FLS8yNe21n7KC6/Fu2mxKg4mW2PVAIKeXQt x5j7jPt/yJJVaYtQ5ftDq8frhASiqffuA77M91AVRfSEPm50200CdkPWAEs752VbE+6uOCNYIGVI5 IrawuzVl+frk2GYkjFAGHLQj7sQIGwshpdgXh5QUC2juTu5EGp64r61WZjLfGHEcVbvQX7yVdNJp5 egUuE0E6gHHnTLzkKXrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIFB-00AvKw-Pa; Thu, 09 Mar 2023 15:31:53 +0000 Received: from mail-db8eur05on20620.outbound.protection.outlook.com ([2a01:111:f400:7e1a::620] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHtb-00Ang0-5g for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:09:32 +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=ZNy4uIALqoEZVWSvmo0nizRHr3XFp7TuiLO5sHIkh0c=; b=RzUJDILU0sqvUcTGI4hYTPrZGalPSDm0qR8RNZR3yfqoCFF/pYctVSuCqrnOpjJMb+GZIDarhIaBVf0fXTYSxl5IaPL1vCrPmHlJ4cApxmVdcsIiOYY9P0w2bAHAX1SHHGFL1kKqT+v9RmXcEnNTUELvw0zlkh8q4B00lAkM8M8= Received: from FR3P281CA0205.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a5::17) by DU2PR08MB9962.eurprd08.prod.outlook.com (2603:10a6:10:498::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:53:47 +0000 Received: from VI1EUR03FT038.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a5:cafe::e1) by FR3P281CA0205.outlook.office365.com (2603:10a6:d10:a5::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:53: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 VI1EUR03FT038.mail.protection.outlook.com (100.127.145.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:47 +0000 Received: ("Tessian outbound 55ffa3012b8f:v135"); Thu, 09 Mar 2023 14:53:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9764394d56ccbde3 X-CR-MTA-TID: 64aa7808 Received: from 2a9d25018e95.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 90D81379-89A8-4EE6-A4F5-5A3AD36728F2.1; Thu, 09 Mar 2023 14:52:56 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2a9d25018e95.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l8GXohziqOKmmGg/ISAILiF8gVsCpSbNONT8U4abTvYhSdbhNB7ywkp92A+3UtYcdHqsuxkI2FLmIuFjfhuZvVKZHMa+Bu6Xlig7ED9MWJkq2yAhoU02KaT2ogP7q0VLfMQCrxYmnmRPtjA1yjOvqxJJhHLTI0LdrAoBObwrko2I7RMZ08wfa8ntwOS9BCwvn70TIBAKFDXm2QrIVYltQ+w3NoL8rToo7py3BGUAS5C76vvX/JKda8AHf73iN+SlCM6Y69zyMxOC2qaub+5GTXoPAt20zodPbPJ6+mTicJM1zFZKr+Txw3/pO+B3oLY2TMUo3L5MN+F28TC0mzR43g== 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=ZNy4uIALqoEZVWSvmo0nizRHr3XFp7TuiLO5sHIkh0c=; b=jWKUB3uwlZaFvvI/nE4bGIsTPRDPx1yzcxuo9u/TidiAhMsjC41yT6pQ+FWLgvAq7Rm3T8ivsCIUfUGPfyJ44BWEx1HQJwNAJPNt3lXCxo1SowF1Wf0vskLELgTpQHXy+GSOOExkNUWuHSD9tWQskolRotFGqAvcmb1htH5RZIjZONrI986f6/Nh3hxQnO2rSuzrjIfAH4b8rE/zBSfexVdHKw22aUHFVAN0dXxltMFY1LvOvXXe3B55ADEe7v62VNMXJR7e0HjeBPamV+paInCzygT3tZ7qgg6Dop128kza3gcS47ZWF7fx07nriiJ1ETTQtENGPMpFrUFdNh4VZg== 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=ZNy4uIALqoEZVWSvmo0nizRHr3XFp7TuiLO5sHIkh0c=; b=RzUJDILU0sqvUcTGI4hYTPrZGalPSDm0qR8RNZR3yfqoCFF/pYctVSuCqrnOpjJMb+GZIDarhIaBVf0fXTYSxl5IaPL1vCrPmHlJ4cApxmVdcsIiOYY9P0w2bAHAX1SHHGFL1kKqT+v9RmXcEnNTUELvw0zlkh8q4B00lAkM8M8= Received: from AM6P191CA0044.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::21) by AS8PR08MB9908.eurprd08.prod.outlook.com (2603:10a6:20b:562::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::2b) by AM6P191CA0044.outlook.office365.com (2603:10a6:209:7f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:52: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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:54 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:52 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:51 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:51 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 03/18] arm64/sysreg: add TCR2En to HCRX_EL2 Date: Thu, 9 Mar 2023 14:52:31 +0000 Message-ID: <20230309145246.22787-4-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|AS8PR08MB9908:EE_|VI1EUR03FT038:EE_|DU2PR08MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: a4967abb-cd99-4657-8427-08db20ae1668 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: CrMlAfhJMlJTDHHmM6ajL3eXxru7moL+HOq/WvnEcsImVWeGCHCwxuzaCFMNom/deyX45Ab3khiT+/VS/zLqDrx/hmXCA5Resz/yzTUaW1jJEEOS4J4iks5fivebJGF5zLd0sTTCSgQa2wDzd6MheEnCfL/la+ZvOGGSfND6PbPoiuaAkX7axCy1CJ8Ila0i7Sgibm9o0d1v8p2rJ6OnhR/wC8VsIhxQ79MNOSOtYU1fIqVfmg8/3n8BwhrIVWVTnd91sPt+JDMYmxwQnKWMtkK85zUVr8jZ+TSa+Ibur9pbdWcRSUKiFIioGiZrrhh6PQHsnTJgYHyJtWcWNfAustA03g2Xo5LLL+jjKtFdoxCHZQkE5yGmiMu7sh87tHv/nEWbj4gcJES4QwaHIqqFf+yXYQDvQL6+3FftmaEQV0ksr9puVPpTVnrT2mfwE7luHVqVLWpEYvAATMeFFLh02vPe7ozkXnJMS738HD8TyXL3crUPC1n5mH6uZgN1/Dkd1iHVn9YqIclK/c6Kd70doFMHRMNtYk08z+YRGyUCqAU6uDh6Xj0IisJwo4smsa3UqyMQRHjXX4xEetVYC4IJln5eseFdtpK4Dw+v3bgd1r+KIG0upKsCVW6jJT2kH1MEvhhxuwJCq2X4i2UryLYtROm/mTHGetxWS2DWi/J/8Fx2d1f601DnMwrUghL47KyX48Zne73n+tkzOqQXw2fEeQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(39860400002)(396003)(136003)(451199018)(46966006)(36840700001)(8676002)(6916009)(4326008)(6666004)(40480700001)(82310400005)(36860700001)(4744005)(70206006)(70586007)(5660300002)(41300700001)(86362001)(336012)(8936002)(83380400001)(82740400003)(47076005)(186003)(356005)(2906002)(426003)(316002)(36756003)(478600001)(81166007)(1076003)(26005)(44832011)(54906003)(7696005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9908 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e10886de-a996-4b49-57d1-08db20adf709 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U6AJsKf0aNl6mclnHxuUXrcj7OmWFRiRckCCPxZiOSQTx1othglK9RkbqK7fQMpB450uqXxIR7HGl5798WBEImodb0wUZyuWgDna+p09qMeam80k6O/8gk/03WNQNfh92pTrNj8KiotlIYu1r7BKfYg2dnGhD2dyL2WI+p2sWrWyeOQvizPMxRXhMfqijnIqQ8ud8d7RpNnSD+KREBRrxe3ubh3IAqyDlGHwwtxQIKoR64sd5dc7y2w0ZeC/cbrmyu24sm1cPov5vwgKnlbzWU/n4zgTrdILpyLRDjNAE7dIolha1pIMcQUN9zkFfdG7hlL0SJwaeJtPXBK024bSeDQEZp58KNhe9JUkaKPHi0yaA2ElfdqXoKwFMkoFRkWPpGf9LHtdJJK+qDNVrW86lJxGwB9RPoAQtZt7LwwR9/FJAW4qwgv260S8bNkJE0L303khExqfwEf1Epn+kMYAeO/ghgnx+orbqLBhBs3L6M7tug5tvecweppEbaRr1j398gJT7Z7MpqhiEMX7CVyzaSQMR3AOaRFz7a0I5rIaqiQk+0E/BHqcEh19DQv8GoLM9SV2GznOo8Kq6gWcn3E1oiUp5OgKzA+1/sAOWuKuEZRptXfQ+kga3FH+HlhaArSx0pjqrKtBnNF5Bn0FPtHi2Y+WPr1z22P3+e33m2qbkF/fJ5xz0MrYpjrYlO9VD3xluWC/GUpc5ls/OT35zjt7Qw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199018)(36840700001)(46966006)(40470700004)(47076005)(336012)(426003)(186003)(316002)(54906003)(40460700003)(36756003)(40480700001)(86362001)(82740400003)(1076003)(36860700001)(81166007)(26005)(6666004)(82310400005)(83380400001)(107886003)(2616005)(5660300002)(8936002)(7696005)(478600001)(41300700001)(44832011)(6916009)(4326008)(4744005)(2906002)(70586007)(8676002)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:47.4466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4967abb-cd99-4657-8427-08db20ae1668 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: VI1EUR03FT038.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070931_236104_94CE60AB X-CRM114-Status: UNSURE ( 9.10 ) 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 This bit controls the trapping of TCR2_EL1 to EL2. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown --- arch/arm64/tools/sysreg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 0c3a6790842a..1d9805239a73 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1935,7 +1935,9 @@ Fields ZCR_ELx EndSysreg Sysreg HCRX_EL2 3 4 1 2 2 -Res0 63:12 +Res0 63:15 +Field 14 TCR2En +Res0 13:12 Field 11 MSCEn Field 10 MCE2 Field 9 CMOW From patchwork Thu Mar 9 14:52:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167721 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 537C6C61DA4 for ; Thu, 9 Mar 2023 15:13:14 +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=8QOprrbs/oCRT+sBpO5++1/WJ5AArHbNTetuDS6UcSU=; b=xjQBvzdrTFtwoS 4XW0YWal8+ZomzXx8lQL7Onrr79g4qQQ7IVX77WbCvtdMSS2aUSieP6wc+A/nYH6oExX+tpRTjG9d GFadWYYYnQmJ/IIEVzYp0OgKxCG9NGfX1nqgfpQd0DwxEtit0UeslL0WQRwdxxkmWxXaCDpp3qcoC WeGmcUmCM3Qe/+IGczbjM+g34nG9CRtisNJaxf33M/TBIn8HVi5ITIkn+r/lmpjLMjZnB5i2CaOWq eRRrKQg7THKbMR+GEmkmmZUML6GZvi04sNKqEKUD1rXUkLasalT/je05cv5Dcue6pfQOf8qudduhk Zhb6yR6TgBQKi6tPhnGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHvj-00AoLL-Ua; Thu, 09 Mar 2023 15:11:45 +0000 Received: from mail-dbaeur03on2062f.outbound.protection.outlook.com ([2a01:111:f400:fe1a::62f] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHeq-00AhlF-HX for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:54:18 +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=EbYpcD6Wu2t4M534tDNJPJFnqcprthxxcmGA5bYlSTI=; b=0jsXqezsv08eEwVnH6jV6+6u0Fadt/r/x31SlwVpSxq71BRxYIaW3Ngr2ThQqKsQAYNzcmGBnZXFw4tPIsWmmRuc1P7iVJH2AECCHL8WmR5rE/ac2sPR41JdYzfVmREgQGlclR2pizwnoPxhXD47BH/JfwRKONoA3TIDestQmYs= Received: from AM6PR08CA0008.eurprd08.prod.outlook.com (2603:10a6:20b:b2::20) by VE1PR08MB5630.eurprd08.prod.outlook.com (2603:10a6:800:1ae::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:58 +0000 Received: from VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::54) by AM6PR08CA0008.outlook.office365.com (2603:10a6:20b:b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:58 +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 VI1EUR03FT042.mail.protection.outlook.com (100.127.144.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:57 +0000 Received: ("Tessian outbound 2ba0ed2ebb9f:v135"); Thu, 09 Mar 2023 14:53:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 71d62aae7b5d2f9d X-CR-MTA-TID: 64aa7808 Received: from 1bc51e425411.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C32371A4-B3E2-45D9-B2F3-4F7718F214BE.1; Thu, 09 Mar 2023 14:52:59 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1bc51e425411.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GjfklsPG9VFJ4OxlIbFKCeGy12TQ/uZmGToAfK1fdmsiaD3RnzfkAwd021wAz2W0Iv+makl03SeZMBWIKTIG5SmfhpQP3mi0pPCbrhEKHa4VzxqulAYbTTme0jVEFGuwmwzNVI/fMF/syVlx44CX70z402GqfBKmiPbrRMQxWgzuOAMn4rkxHwSW+CRqFN3rera+xF/fk7X4BxrJTUB2tHloStA2Hx1MhQKSQk6o5HOpTHAnnyQypgalD84RYurFxnRxM+yZXfUAAK0feM2BsaFmJYYPKqm9NVlkCLwinNGqJHTJYPvcqvjGKqOOV71+Igs30CyOgokDe5eRbeTfKQ== 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=EbYpcD6Wu2t4M534tDNJPJFnqcprthxxcmGA5bYlSTI=; b=PBToC10JGDGKS5dN/Uetg1GM7G8MdcojUYQ66dPQgfVeF6wPfSiP2D0xLQV0+OFPl5n8yckoo7Mje9DLz28J/uqgZVwQdYv5/Aejhwdc+L8qaMn7DqAgjdexPQ+6QUJYDEJW1q+xIuL9Vx2dgxyDK5soL/xMYGiJmOPIRqyqwDPWA2IttNGydQDACFqJ4/zNkNdaMHwht4OZs+NV+ex0q5XAWSymdtnn7yONzC8KRmB+dn2Cxvz8Tj2C9d2BzITrA4n5zbF2GM1qmawozdofRQmwpRoZj24qKQnmrrRKLrlQaYAJCQ0O37MeqwCRdYUdWbWM/fL9L5Ni7Ua1d2bfVA== 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=EbYpcD6Wu2t4M534tDNJPJFnqcprthxxcmGA5bYlSTI=; b=0jsXqezsv08eEwVnH6jV6+6u0Fadt/r/x31SlwVpSxq71BRxYIaW3Ngr2ThQqKsQAYNzcmGBnZXFw4tPIsWmmRuc1P7iVJH2AECCHL8WmR5rE/ac2sPR41JdYzfVmREgQGlclR2pizwnoPxhXD47BH/JfwRKONoA3TIDestQmYs= Received: from AM6P191CA0055.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::32) by VI1PR08MB10297.eurprd08.prod.outlook.com (2603:10a6:800:1be::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::e7) by AM6P191CA0055.outlook.office365.com (2603:10a6:209:7f::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +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.17; Thu, 9 Mar 2023 14:52:52 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:52 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 04/18] arm64/sysreg: add HFGxTR_EL2 bits for Permission Indirection Extension Date: Thu, 9 Mar 2023 14:52:32 +0000 Message-ID: <20230309145246.22787-5-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|VI1PR08MB10297:EE_|VI1EUR03FT042:EE_|VE1PR08MB5630:EE_ X-MS-Office365-Filtering-Correlation-Id: 633ee1cd-944d-4afc-1093-08db20ae1ca1 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: PK2gWfC3ecXiR95CUZGi73oyGPYS5iHV1liVuyooTqDPk4tUpC6Yn+EojUS0XneMnRG5bq6HMhJxkKOVAHGp5Z+0GAavD492VZCOFdRJYQ4M68QxzKgC67g2zs5Zh33z0UiLEak7bKFZkmR7ehjjKcvvQ++I/34Ji1rWM+wgHAENPXj4sLVG9o1Sf3bsuCgf63Wadabi6EsfCDLS+o8g06FzdNvdBLvzdkI2esBJKNpPpKUAfy5BEGnvX1o/SpekOwXF28Sg+e0bY/iVpJOyhYhEaEsfESqtjmcPXOhkNc8zx/Lk1F5V+A3qHbFr21ks/a4FcEo45Y90wpFzCyGrPqLP8hFXV2TKuT0BZuSCENxrEhseuloCVTReIaEUdSfIuSEFRwD7/2NEXYlgmpunJfdv/W8MON/NdKWXuaVG++Cr4qnBIXountOAOO8Pv/nN5spcb1b7KKZftfW6q7RjTxIq51IlkHsdaUg/vlZVRPPL+B4QS36qWZGLPQEwceFnVQSw7xpAZp/+6WOQ2U0zqwb2gXyIRr2Fp4vAwdtTFbrVdlINGi7GqbGr/zMVzZNFx570EZH3QowGalxNZKHNryT84fQBeJRRV2GuvcT4xnFbv4RUWFp4rByjNgUYSBWaSAIPMybyPPrHi+pmfyDNgFb0MaEvKhr1yEeGOQCEDSDVcaYE8bshcWoKuAaIcW2HyFYZUX8Dr+vEaCUrG32PsA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199018)(36840700001)(46966006)(47076005)(336012)(426003)(82310400005)(2616005)(54906003)(316002)(36756003)(36860700001)(1076003)(7696005)(356005)(86362001)(478600001)(40480700001)(26005)(82740400003)(81166007)(6666004)(186003)(19627235002)(5660300002)(4326008)(41300700001)(6916009)(2906002)(70586007)(44832011)(8936002)(8676002)(70206006)(4744005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10297 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 34ae8632-6c2a-4b2a-b207-08db20adf787 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CNqVDZTh6VZ8FhdNdjj75vlRnqpmkZTsDiffA+xAsVK20uNmE7dUYy0pXxxK17rBayW/LdhYSAVIRBZbq4QkmJ3+fPafwibSKSx6gHwNMxZaqK7FHgTvXt7AhYoDb8PJ6qu5sQu0LP3GoLSWiIV4AJ7TwonTiKT5WOXoCar37pLUgz4aIJ8/EvdMSkmFW289kMZFVnnRcxEIOgpyqetJAJMAYfZSrPyYsSmzrJ+1/nY0F37hZb9iolk3fQIaXIGGpHJ8vjVabURa3O4YgbfiPqn8hyRHZOO0pceC5B+pCqWqVM9pnfNOO6lQ5LNkblvQGUgKDIOATDrHjt71Lcbdz+TRddFSUCDrVyo0qInjs+d4KF+Jy7F2naBCt4QXc69+h54z3xBsg9dyT8mgk2tAzZYH3gtAniw2qAS1WoKn6CLMdpKf9Bvj9ydLzzEwBmyGhjKSzNgYtXVj8lHkYxmfokr4sbb2z8vHfRb3Kmu9wUc885+vx8vzvRKwrWOMY2UhaVTHW0bMTCQGMGChGumQHzLbxzyWDeu8dBesNCEKpP3WXxxlFG0ZNiLXwrEO8jQJ9KK5mFsn40TE+h3jyfKStiwkVksU/KgrMuf3F420k6SiwmFTiSwHkwfywhd+p64IUK1gi4mtNwHpVvxDmPi79Le8rKy/kSEuv7X/k2gyu++FLcuLOpj5aUHwMAg+XgNW+5DzRGaVpy/QVT76ySSVXQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(346002)(136003)(396003)(376002)(451199018)(36840700001)(46966006)(40470700004)(2906002)(8676002)(44832011)(5660300002)(4744005)(36756003)(8936002)(26005)(4326008)(19627235002)(6916009)(70586007)(41300700001)(70206006)(86362001)(54906003)(40480700001)(316002)(7696005)(478600001)(40460700003)(6666004)(81166007)(107886003)(1076003)(82740400003)(2616005)(36860700001)(186003)(82310400005)(47076005)(336012)(426003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:57.8679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 633ee1cd-944d-4afc-1093-08db20ae1ca1 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: VI1EUR03FT042.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5630 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065416_643011_5FA519E4 X-CRM114-Status: UNSURE ( 8.66 ) 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 Add the trap bit definitions for nPIR_EL1 and nPIRE0_EL1. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown --- arch/arm64/include/asm/sysreg.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index 9e3ecba3c4e6..cb9e387e39e0 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -759,6 +759,10 @@ #define ICH_VTR_TDS_MASK (1 << ICH_VTR_TDS_SHIFT) /* HFG[WR]TR_EL2 bit definitions */ +#define HFGxTR_EL2_nPIR_EL0_SHIFT 58 +#define HFGxTR_EL2_nPIR_EL0_MASK BIT_MASK(HFGxTR_EL2_nPIR_EL0_SHIFT) +#define HFGxTR_EL2_nPIREO_EL0_SHIFT 57 +#define HFGxTR_EL2_nPIREO_EL0_MASK BIT_MASK(HFGxTR_EL2_nPIREO_EL0_SHIFT) #define HFGxTR_EL2_nTPIDR2_EL0_SHIFT 55 #define HFGxTR_EL2_nTPIDR2_EL0_MASK BIT_MASK(HFGxTR_EL2_nTPIDR2_EL0_SHIFT) #define HFGxTR_EL2_nSMPRI_EL1_SHIFT 54 From patchwork Thu Mar 9 14:52:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167745 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 22D11C64EC4 for ; Thu, 9 Mar 2023 15:31:11 +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=XJrGjqIDNiSYAiQ5Ky6cUEk/MTJa2Z3j+I3134HaCXE=; b=QvXhBxz5hLBZO7 Gn8ZChagDDPbUex5dnVRmJY0VYn2yg0JPbs0n3q4SELhANwDgTxXV//7591t+3mOM3xUrQqMNfAy7 aAbgYpKdYvQPLSDMDaIubiqTfgofl1fs5WWpMvQ9ezZfKwPSJ6scyDaxHtZDH5SYyO4WX7WwCndEh y25smXQHnd+V3TqAUM2igM5q2RsPXnMv66QRmFOr0IrfwyYMCuI8MtgJvgHUsZObzyPkmGdibPEXG /9+eVdXzK8oBFFefclLQ93WmGyNXmI9Ne81K3lGJBSkPohd2bcr3OLZ+VPyJT5+LL6aFQyKfdwuyy OYFQyMl3GpoNb+FH4X6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paID1-00AuWd-4K; Thu, 09 Mar 2023 15:29:38 +0000 Received: from mail-db5eur02on2062a.outbound.protection.outlook.com ([2a01:111:f400:fe12::62a] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHtG-00AnYK-DY for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:09:12 +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=ntlKU7FhJNq4mhk+rKMDZZFp6BmjjOc48N3xzDCVxLc=; b=dYojqiIj8rYeCL4FsVSEd0JES0f387kT/NNnPc+WK1ZyPVINxMU6BSnx/j9zsBxYIf92xaTBVJ2VSItK5hTm6bW1Z3r0qaOPlyjihCf3tqFTc0Ur8XOZgNsBdytxelhQIs6SKr8rKibdNimY+8eLQiBHR68iEQE8BBzsqh2Jo+Y= Received: from FR3P281CA0083.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::21) by AS8PR08MB8924.eurprd08.prod.outlook.com (2603:10a6:20b:5b2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:07 +0000 Received: from VI1EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1f:cafe::c2) by FR3P281CA0083.outlook.office365.com (2603:10a6:d10:1f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +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 VI1EUR03FT017.mail.protection.outlook.com (100.127.145.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +0000 Received: ("Tessian outbound 2ba0ed2ebb9f:v135"); Thu, 09 Mar 2023 14:53:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ab1e028b62f324d5 X-CR-MTA-TID: 64aa7808 Received: from 4f5341a79f81.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5FEBAA8A-B388-4D74-ADA0-364620FBDF8D.1; Thu, 09 Mar 2023 14:52:58 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4f5341a79f81.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=arg2HEb3nioPLR9fx3iyDDeYnwlGB/ReQZ5dmR6p4cromJLOsvq/CrDhfjHVrbepdgFuq0TuFiekNB9lHTPjNQQR04kbYcHKkg9iSas43pY+DX/gzlXAH1w4To1dXlrtqlC2o1M89Hgzqgpjtc29/MCiuM19KuandzfVSoPUmc+OPGT+gOPu3dFbANw3AyJ0BCp/fB+9YggXVG1L1NuovWuTc4wwBXxqtjllpHPSPWAxBTPXqpPhzlBgue9JdDrMCkpIKKaM9TXFx9Q+c4DGbcsHeJlq/kRSkDRJJdvZXH7x1dDJARNIYHFISOmZUvyhA+bavU5ecO+C2aTpH/mHhA== 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=ntlKU7FhJNq4mhk+rKMDZZFp6BmjjOc48N3xzDCVxLc=; b=OjWJCAclluzIuyFIGeORRtXOdCkseJ857NtHqee4iqH1zBke/Uk2kOYrJ7I+RmhPU3Qc0kpY0NLl5y6QT2eCVXQDG8iVLlteaqmdv4NIv+uyGDeRl/GENLWIsFqUy3oqpXTANZ0GuIuUy4uC46yvASCcyBXbhnJlJdvpnX/PUd+okcfThlI3FFd8Jv2cEPWxAZAs0sXFcg/pgVpDEsHeWs1gOeAnkdHRx/t+2LzI4zWTQif8ft/QVdeGLA8NhQ19PqH/8DpcbcFw9cv7CF5HWf8PJxjPYL45Aw0gnCR7cc4DtDEgf+riwBJxrpyS0gXeGcHWeOLG+x1/GRxB/mhtaw== 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=ntlKU7FhJNq4mhk+rKMDZZFp6BmjjOc48N3xzDCVxLc=; b=dYojqiIj8rYeCL4FsVSEd0JES0f387kT/NNnPc+WK1ZyPVINxMU6BSnx/j9zsBxYIf92xaTBVJ2VSItK5hTm6bW1Z3r0qaOPlyjihCf3tqFTc0Ur8XOZgNsBdytxelhQIs6SKr8rKibdNimY+8eLQiBHR68iEQE8BBzsqh2Jo+Y= Received: from AM6P191CA0040.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::17) by DU0PR08MB7415.eurprd08.prod.outlook.com (2603:10a6:10:353::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Thu, 9 Mar 2023 14:52:57 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::29) by AM6P191CA0040.outlook.office365.com (2603:10a6:209:7f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52: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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:56 +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.17; Thu, 9 Mar 2023 14:52:52 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:52 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 05/18] arm64/sysreg: add PIR*_ELx registers Date: Thu, 9 Mar 2023 14:52:33 +0000 Message-ID: <20230309145246.22787-6-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|DU0PR08MB7415:EE_|VI1EUR03FT017:EE_|AS8PR08MB8924:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c4c5838-ea73-49a3-7183-08db20adfe52 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: 2WqDi8r+tuoy2lt+HCsK2Dmzu4vok3WVdxHmhjUkiUWw0sNokilo+yN3OL8q27es1TchjvK0+dEFHbSzc2iP2piS3SktxSGn+8dAOnZnemcY6TNjKACLaDNGfQ0hhuMjn2D+pGV4s7EhaIahuYMk6NU1m9w3MgEEBcOv79wFyVfcu0+/1eEg5CWGheEDZ4xHJaNpT9PmwAZ7f3/zb21jzc7wdlJi04k5xTmWUDnbwnh9NMUhqNke6RTjOKw2HMS8LgZkj3Uae+iUPiR+9LChDx+VCFvbtbyk8pMWEz7mfdONa/UppUbYgCkotW+EnwvS5lSNgiSkPlPPrwdXlenSwyZfd44nviZ0uRDHYzel4DV7aZUJ3utmvIAoLhU4xWTi1jc/T3DdUbfPmv02e+wwaq/yavfUr809dG877KIPxU938HIZFfqHWylGcXIC7c9uSVV+Wkfjs71VokinbTcDNMk9WTCxaBbh4W0j2cndmmlxTNCZC/AHGy0PzAVx+DJiM9w0X4TQA2+A3kyuc8MqPQlvbw334pmrUGzFq5Q3WiuSrgTGxqOfm7OXQ5dmZAngzwZ21JT5yX2mRivSjyBsnKFWcN9ZYVgS8tWFJHxjRFXZ/pGNC2NpEUlMbMhQ5S3nkfeRDZYqxJgCxU07JF1z9V+V97TL/k6lLQ99kjqopH9Rhw38YwTK/ir1PIyMOcIHTTDeoPWVerwixcGX+Hgilw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(396003)(376002)(39860400002)(136003)(451199018)(46966006)(36840700001)(316002)(36756003)(54906003)(40480700001)(336012)(82310400005)(86362001)(70206006)(186003)(41300700001)(26005)(44832011)(70586007)(4326008)(5660300002)(36860700001)(2906002)(478600001)(7696005)(6666004)(426003)(1076003)(2616005)(47076005)(8676002)(8936002)(6916009)(82740400003)(81166007)(356005)(19627235002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7415 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f4e4a35f-45bc-4ad4-3124-08db20adf82c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N+Ti3EaqulMLOcqgoPqubcuICubz3tg5usBYQl8As9Ql3SOjdA4l8BsDqXBeEThZAwjRKpzXFtiwDN3kY99ewgHnYGs4Cw7zVU3O0gpHchCCmuejDgZ1/O19P3hPDWY4ZMuXXnRLINDZ5nqCSimANXyTXLo3O7dHPcnBktJA9nMcn8N8Le1ScF9cR5by15Wqqev7SXnsMsdawKi7ZE31KZYPhjMazZaC1+lG4tTYJAz/DIDaESCrjCnIGHCL/lMacu9pjaMJyVowyq0r1Jrw2JqirTqQ9WgOOX9bHvVqdOzfu0ZJobRb3yqEGQUoUXDp/ncYJE2bcbPaCry+O2CnWinr6fczzVkWxErbV6373EpL/mjlAUu0rCLRxvQKwmwVWwSXLMJNRnBo33CPFE+/Usvz6yTRdTO1CR/0sQz5eJidutCJAHDA5LjmW0XM0jssxS9/dqO7VfF7A0WCQGDEWGs3Ak0VlceUaglyh2MBbD4lZgObj+0/+UfxzWuhXSEsLm93VdI9jdRwJjvKqmqPMAUyZMEPwHQzz2KxZJjwBG98h9jpcWYx2j5UIh7MXqwHgON+2kSiPLw6XIfguyUlK/55Ry7HZNFeEGVhX0NqrBZnMqObfc9FEO8+48V/1yM/+rwzENIi0D4s7JiH+6MGQvInT4fW6uqtyLiUfC8WdIXovzQMDcyJ++jnBIsbi614a3rALtAufr0NXSfg4/k3YA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199018)(46966006)(40470700004)(36840700001)(82310400005)(47076005)(336012)(426003)(2906002)(36860700001)(186003)(1076003)(26005)(6666004)(82740400003)(107886003)(44832011)(36756003)(478600001)(8936002)(81166007)(5660300002)(2616005)(7696005)(316002)(8676002)(70206006)(70586007)(19627235002)(4326008)(6916009)(86362001)(40460700003)(54906003)(40480700001)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:07.0210 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c4c5838-ea73-49a3-7183-08db20adfe52 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: VI1EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8924 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070910_490568_72EC99B9 X-CRM114-Status: UNSURE ( 8.33 ) 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 Add definitions of PIR_EL1, PIR_EL12, PIRE0_EL1, PIRE0_EL12 registers. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown --- arch/arm64/include/asm/sysreg.h | 19 ++++++++++++++++++ arch/arm64/tools/sysreg | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index cb9e387e39e0..538b2368e3bc 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -768,6 +768,25 @@ #define HFGxTR_EL2_nSMPRI_EL1_SHIFT 54 #define HFGxTR_EL2_nSMPRI_EL1_MASK BIT_MASK(HFGxTR_EL2_nSMPRI_EL1_SHIFT) +/* + * Permission Indirection Extension (PIE) permission encodings. + * Encodings with the _O suffix, have overlays applied (Permission Overlay Extension). + */ +#define PIE_NONE_O 0x0 +#define PIE_R_O 0x1 +#define PIE_X_O 0x2 +#define PIE_RX_O 0x3 +#define PIE_RW_O 0x5 +#define PIE_RWnX_O 0x6 +#define PIE_RWX_O 0x7 +#define PIE_R 0x8 +#define PIE_GCS 0x9 +#define PIE_RX 0xa +#define PIE_RW 0xc +#define PIE_RWX 0xe + +#define PIRx_ELx_PERMIDX(perm, idx) ((perm) << ((idx) * 4)) + #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 1d9805239a73..446cc52d7317 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2076,6 +2076,41 @@ Sysreg TCR2_EL12 3 5 2 0 3 Fields TCR2_ELx EndSysreg +SysregFields PIRx_ELx +Field 63:60 Perm15 +Field 59:56 Perm14 +Field 55:52 Perm13 +Field 51:48 Perm12 +Field 47:44 Perm11 +Field 43:40 Perm10 +Field 39:36 Perm9 +Field 35:32 Perm8 +Field 31:28 Perm7 +Field 27:24 Perm6 +Field 23:20 Perm5 +Field 19:16 Perm4 +Field 15:12 Perm3 +Field 11:8 Perm2 +Field 7:4 Perm1 +Field 3:0 Perm0 +EndSysregFields + +Sysreg PIRE0_EL1 3 0 10 2 2 +Fields PIRx_ELx +EndSysreg + +Sysreg PIRE0_EL12 3 5 10 2 2 +Fields PIRx_ELx +EndSysreg + +Sysreg PIR_EL1 3 0 10 2 3 +Fields PIRx_ELx +EndSysreg + +Sysreg PIR_EL12 3 5 10 2 3 +Fields PIRx_ELx +EndSysreg + Sysreg LORSA_EL1 3 0 10 4 0 Res0 63:52 Field 51:16 SA From patchwork Thu Mar 9 14:52:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167738 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 DBD3EC64EC4 for ; Thu, 9 Mar 2023 15:27:40 +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=atSrli810k8ZVAhLq9fB4bYCTnzip9Bv00ifrLBl/b0=; b=YynDIFcQwwM5aL 1n0WsaryS+nDyCeBR0stQWnLRqDjEweAB2PNEJFB9bL2q77VQg3bLOgTICryO8lbyvAcges2YgRn6 uPAnIScRz0cT2WeEVBMTE0YF9qE7pxI1KxinPcOttRftobnBPWGT6B4MlLVwf8ZQksvBLSs7tKCMr VLL+kRYr8ahoQr86S6XQjSoDEJHi7/J9DEmgC+a88IZnkgEKDhsDxE0OzkDy7PpGY+QuSpGdH7NcI mez9A53aMImygNDB2Hn6t28BM0ZooNJ3RDCMCgDep5gjoMQ6L6+zEiFlSXPTSUoCH2EYmHD5IPp5U DZK1mF9B1MZ51gMvlC+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paI9y-00AtFO-Sh; Thu, 09 Mar 2023 15:26:27 +0000 Received: from mail-db3eur04on0611.outbound.protection.outlook.com ([2a01:111:f400:fe0c::611] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHre-00Amzl-Ki for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:07:32 +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=kNpToTUbBbS3ucAiP0QCU13jzw08BcOlaRjGCcjo1nQ=; b=a+wGh40rx/hMbQsNDlMEXesNTEyiIWfKfAKkeUlcy31YSQdqwryRebsJo79LgFDz00CmzhRyEnRuFsjJzD4eyRPdW7poKPvhzxiIiUqIqOgWdDhyEsH2ksqvSCsVDSa9C7ZS2nvM91MLXzPhkCmKKybDjgmh5LJSMolUQIpRFg0= Received: from DUZPR01CA0268.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b9::16) by DU0PR08MB9583.eurprd08.prod.outlook.com (2603:10a6:10:449::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:53:11 +0000 Received: from DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b9:cafe::2a) by DUZPR01CA0268.outlook.office365.com (2603:10a6:10:4b9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:11 +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 DBAEUR03FT049.mail.protection.outlook.com (100.127.142.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:11 +0000 Received: ("Tessian outbound fcd8b5fba459:v135"); Thu, 09 Mar 2023 14:53:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ef48a5cdc5e18956 X-CR-MTA-TID: 64aa7808 Received: from 337fd6e8f021.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FB671A1D-FE69-4368-9BB4-7F55286A59F1.1; Thu, 09 Mar 2023 14:53:03 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 337fd6e8f021.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SOsmhQxIYW2nGpfzSQqCrT0NKtdWiFP8nAIO2fvNdZ63lm4ELFooVfzN+BK8Y1YAkv7k+0L9GsBfPLJxeaCzTlhbQ95xz+x0oX4JXarrZz14Ir6IdQgNPFDEBkOuTQng16MOdJhfx+BRKcwIoKlaItR8fBsMDOS6x/V/58RLwWuUY+CEU5jXtwzOpuiKIS3J9R0v4X8YTadIDgdjD0+TgUCucPgQm6tBKt3Ne/rHQ4XHAs9QAmiD7o/xxkmKJmeipZDN5vMpHsaj7saDNH45cKz2Q8dXcaY0SmGY0pFO5rVN+n1eYykiWxrU8MMWva9K+q2dW3RpkAuBXm+hSS39SQ== 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=kNpToTUbBbS3ucAiP0QCU13jzw08BcOlaRjGCcjo1nQ=; b=JtOLZjKQ3IALbxV5vg2s0HZaE5ETis0jKvwRa2IXvijRSh9A49GODzcWxWXD/FMmvV9DeAG27ne4zSX2CJbyrtoWB76xqniuzBJ4eChZZob/ag0tskSMh5TXMuTh7vUIKoOGasJovfnfvndY6/wasi9tvvHyOhR1lLzdNkUAmWOL+1RAFOt/SOSQtfWQv/rOTXrxEhcyPTF7SM1QQDmsc4aYBkwtL2opJFTT3CymgFZ3hPeUahpt5Biai6uizwYX6JIdXrinXFy1ekhTQ3yBCEsJHUchKS8NDXhoqOgRMtwM6dFdpIvTC6FSTZX/oHEMxCV3q+nxTFS0FlkyStlh/Q== 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=kNpToTUbBbS3ucAiP0QCU13jzw08BcOlaRjGCcjo1nQ=; b=a+wGh40rx/hMbQsNDlMEXesNTEyiIWfKfAKkeUlcy31YSQdqwryRebsJo79LgFDz00CmzhRyEnRuFsjJzD4eyRPdW7poKPvhzxiIiUqIqOgWdDhyEsH2ksqvSCsVDSa9C7ZS2nvM91MLXzPhkCmKKybDjgmh5LJSMolUQIpRFg0= Received: from AM6P191CA0056.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::33) by DB5PR08MB10215.eurprd08.prod.outlook.com (2603:10a6:10:4a5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:52:58 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::a9) by AM6P191CA0056.outlook.office365.com (2603:10a6:209:7f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:58 +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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:58 +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.17; Thu, 9 Mar 2023 14:52:53 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:52 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 06/18] arm64: cpufeature: add system register ID_AA64MMFR3 Date: Thu, 9 Mar 2023 14:52:34 +0000 Message-ID: <20230309145246.22787-7-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|DB5PR08MB10215:EE_|DBAEUR03FT049:EE_|DU0PR08MB9583:EE_ X-MS-Office365-Filtering-Correlation-Id: ed48978d-f4df-4c5d-731b-08db20ae00d4 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: Iv89C9w+km8QE1l2gUhT+3a0Gcd42MAJPqhFyvaO9O1SJF1+RZzv5aS7cDEB8LGVpfZa17hRkCySMurEodqlWu/621KEB/7B44TUliI+6MVWMh9nLYomxLi7YoJZxLKr0PENCfRIEGbnEz8NG2vlyT9mAvUrgPqPiiZijD+CKjA4Dt1Ce4ibJrO+mNok8x6DkTaeiCYBE2zw8sK1XTq4k4E0LWFCTnImx9Rc4r1ltCoKG5IeaTAt9sn41MXoXkcIMpJ/MINZx/tFvBM1SwiBxMeol82sP+4IAVcqEy7+Z1f2ZMDOXufdIycROHI9WuFynUnf96FW5TyMUQ+UGKjKapvcSJp61rHEBxPeXqF/AeiELZdLD9boanMo/lCEzxHIKIYIRNSfCFwiDPyyOA99PkqAsw1jo/jRzVwuybq2AWdM8SpiurIYAKjRz8ZtMuNNE4MkTabzLUTPiD6t22PNpzJJMxpJL5Nd1AdP8MHxrKRVcl0+3neOlNPtGjOzrUVJeCsAFC95beumVQpX6pyKL5+suabEZka3h73dW99QKckB/ugThBcLixVMvbFaZEHFthJ5CT8wrJNg0eOPhsOc3ruIGNAxWZ4QpNxmGdu2rQxAXKkqBe41KjS5eZjmbb8i+ed7rCnDOdBbUlfZAhyo27zOtYVt7eGdG9Er8mhH7+VZSxubMnk3Ta4fPX8Itx428GeJgWAf5ZjEF8UFB1Zr/w== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199018)(46966006)(36840700001)(5660300002)(4326008)(36756003)(70206006)(40480700001)(44832011)(6916009)(6666004)(70586007)(41300700001)(8676002)(2906002)(81166007)(356005)(86362001)(36860700001)(8936002)(82740400003)(1076003)(54906003)(478600001)(26005)(316002)(7696005)(82310400005)(426003)(47076005)(83380400001)(186003)(2616005)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10215 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 03e5fb7e-478f-4279-0c78-08db20adf930 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OYugs7FqO107sfhI2O22Vrh58sGOSFkXl5CPtWVE8PiaYUuPnyi6yeiAw2UgSdD+suzZvjY7yBaQxyb5bz/YwwgYwMEv3w/8tWhx9EdlqW/7kVMSQgcweuA6N5cU0DSssFz4Qwg6TGcpXLNI4J0ZDWNJXsnoJ82B8tY731eMpKztrgP5wdNVQQzlytAArMx4qL9QUg0jAEuwx0X1+2Qr7DR0Ulmm2wYHkJmHK8Lh+eQ2/wQp5j2bWjyWCiJWxmBZkqp9W/IEvO7TnBubfi7kcRiSaH41Jp440K5O5VK7zSxps2eQHZGFOHPLO7gPFBD4b343Bwq15InFusgPZSWnqckaYdw5uBfdLC5alkAKKIz/htIJwJ9JR2XvX4/utU8b74AaL3sJLipcHJhTZeSUjXc80EP9DrS3EWJWA6LSEO0hbRC7VXIjM9KxvKMJwGqYFh8MNpOEZLCKSILisKK2DHm/GhiEYb0EiIWOylKq91Q3vuICBG33LFAFvg2dZwLY4h6tXhlWNv3KY3SUpk/5cKj95zpd2+eE52DecVCQ0WnpNWzAAmhQW3nXnsyr5mn22DmrogQxeBw3GEG3s7OzaxK9r8j4ijk1u9QoSh3quHl962eZNGQqJEEGuQhNdqvahsxnosSWe6eubnw+OyBtIwQK3quv6m6X5shvmGOpnJ2D3KA9i0nX/M9zkFhqlvFCwBgc5dtklYN/D3qohyV8kw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199018)(46966006)(40470700004)(36840700001)(5660300002)(4326008)(36756003)(70206006)(40480700001)(107886003)(44832011)(6916009)(6666004)(70586007)(41300700001)(8676002)(2906002)(81166007)(86362001)(36860700001)(8936002)(82740400003)(7696005)(1076003)(54906003)(26005)(316002)(478600001)(82310400005)(426003)(47076005)(83380400001)(40460700003)(186003)(2616005)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:11.3222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed48978d-f4df-4c5d-731b-08db20ae00d4 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: DBAEUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9583 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070730_724961_927D28AF X-CRM114-Status: GOOD ( 10.31 ) 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 Add new system register ID_AA64MMFR3 to the cpufeature infrastructure. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/cpu.h | 1 + arch/arm64/kernel/cpufeature.c | 11 +++++++++++ arch/arm64/kernel/cpuinfo.c | 1 + 3 files changed, 13 insertions(+) diff --git a/arch/arm64/include/asm/cpu.h b/arch/arm64/include/asm/cpu.h index fd7a92219eea..e749838b9c5d 100644 --- a/arch/arm64/include/asm/cpu.h +++ b/arch/arm64/include/asm/cpu.h @@ -56,6 +56,7 @@ struct cpuinfo_arm64 { u64 reg_id_aa64mmfr0; u64 reg_id_aa64mmfr1; u64 reg_id_aa64mmfr2; + u64 reg_id_aa64mmfr3; u64 reg_id_aa64pfr0; u64 reg_id_aa64pfr1; u64 reg_id_aa64zfr0; diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 2e3e55139777..9590335b2ce0 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -389,6 +389,12 @@ static const struct arm64_ftr_bits ftr_id_aa64mmfr2[] = { ARM64_FTR_END, }; +static const struct arm64_ftr_bits ftr_id_aa64mmfr3[] = { + 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, +}; + static const struct arm64_ftr_bits ftr_ctr[] = { ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RES1 */ ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_EL0_DIC_SHIFT, 1, 1), @@ -715,6 +721,7 @@ static const struct __ftr_reg_entry { ARM64_FTR_REG_OVERRIDE(SYS_ID_AA64MMFR1_EL1, ftr_id_aa64mmfr1, &id_aa64mmfr1_override), ARM64_FTR_REG(SYS_ID_AA64MMFR2_EL1, ftr_id_aa64mmfr2), + ARM64_FTR_REG(SYS_ID_AA64MMFR3_EL1, ftr_id_aa64mmfr3), /* Op1 = 0, CRn = 1, CRm = 2 */ ARM64_FTR_REG(SYS_ZCR_EL1, ftr_zcr), @@ -1010,6 +1017,7 @@ void __init init_cpu_features(struct cpuinfo_arm64 *info) init_cpu_ftr_reg(SYS_ID_AA64MMFR0_EL1, info->reg_id_aa64mmfr0); init_cpu_ftr_reg(SYS_ID_AA64MMFR1_EL1, info->reg_id_aa64mmfr1); init_cpu_ftr_reg(SYS_ID_AA64MMFR2_EL1, info->reg_id_aa64mmfr2); + init_cpu_ftr_reg(SYS_ID_AA64MMFR3_EL1, info->reg_id_aa64mmfr3); init_cpu_ftr_reg(SYS_ID_AA64PFR0_EL1, info->reg_id_aa64pfr0); init_cpu_ftr_reg(SYS_ID_AA64PFR1_EL1, info->reg_id_aa64pfr1); init_cpu_ftr_reg(SYS_ID_AA64ZFR0_EL1, info->reg_id_aa64zfr0); @@ -1255,6 +1263,8 @@ void update_cpu_features(int cpu, info->reg_id_aa64mmfr1, boot->reg_id_aa64mmfr1); taint |= check_update_ftr_reg(SYS_ID_AA64MMFR2_EL1, cpu, info->reg_id_aa64mmfr2, boot->reg_id_aa64mmfr2); + taint |= check_update_ftr_reg(SYS_ID_AA64MMFR3_EL1, cpu, + info->reg_id_aa64mmfr3, boot->reg_id_aa64mmfr3); taint |= check_update_ftr_reg(SYS_ID_AA64PFR0_EL1, cpu, info->reg_id_aa64pfr0, boot->reg_id_aa64pfr0); @@ -1384,6 +1394,7 @@ u64 __read_sysreg_by_encoding(u32 sys_id) read_sysreg_case(SYS_ID_AA64MMFR0_EL1); read_sysreg_case(SYS_ID_AA64MMFR1_EL1); read_sysreg_case(SYS_ID_AA64MMFR2_EL1); + read_sysreg_case(SYS_ID_AA64MMFR3_EL1); read_sysreg_case(SYS_ID_AA64ISAR0_EL1); read_sysreg_case(SYS_ID_AA64ISAR1_EL1); read_sysreg_case(SYS_ID_AA64ISAR2_EL1); diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c index eb4378c23b3c..9937614c3deb 100644 --- a/arch/arm64/kernel/cpuinfo.c +++ b/arch/arm64/kernel/cpuinfo.c @@ -446,6 +446,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info) info->reg_id_aa64mmfr0 = read_cpuid(ID_AA64MMFR0_EL1); info->reg_id_aa64mmfr1 = read_cpuid(ID_AA64MMFR1_EL1); info->reg_id_aa64mmfr2 = read_cpuid(ID_AA64MMFR2_EL1); + info->reg_id_aa64mmfr3 = read_cpuid(ID_AA64MMFR3_EL1); info->reg_id_aa64pfr0 = read_cpuid(ID_AA64PFR0_EL1); info->reg_id_aa64pfr1 = read_cpuid(ID_AA64PFR1_EL1); info->reg_id_aa64zfr0 = read_cpuid(ID_AA64ZFR0_EL1); From patchwork Thu Mar 9 14:52:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167692 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 09B44C64EC4 for ; Thu, 9 Mar 2023 14:59:13 +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=BfQGXyiV6RNZU+wNwaCYLpm5wjwSZ8gO0gzvIZ2XWns=; b=PDOvIDMCEafsHD cwvcX8kV0/N13jTIfiwiGd6cuWHUHFbOgJFaL0etAgUDhX7kG4pbBinyxNpc94TvWGu47MF/ICqfh UzpB/S3Z5zqRu0pHJTBIKvq2uxaNypzAkyvvHLfy/EDnu7Y7fgQHjFzvLijdGmvgSWdpUYm0oN4St 7NVdPUw2LBpqS5FrUFXQXnKatLg2U6twUXlnYDlMSSlHIFq91HJ4o4JUCzRwktQWoqOtq+qma8LED c/Mgspl67SEfGIt/ga5REjz/XIPr2xLseGEPUVZA2SYPD2d5q0E7Hmi9OXU83SaeQMjTvNy7cJsfe z+mIS2gP8KroaFNdbjNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHi6-00AjCL-8l; Thu, 09 Mar 2023 14:57:39 +0000 Received: from mail-he1eur04on0604.outbound.protection.outlook.com ([2a01:111:f400:fe0d::604] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHdq-00AhJP-Kq for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:16 +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=8WShnfZhrvJZyO0qMQZh56y54wfk3CVLsZ6jywpXbkM=; b=VZRBkYySURgoJl96bEMB7kzPdmOTSZaGZiS/N9M2a+v5G3RQyoF9bPt0Yl/kU79Xrkl7F6xrp7C2dxkNzCou4PlXNatpKgbdUS7mnQAteZX/PMzBFOAS/QEl7g7agDeXcYBAmjE46L6dnkpCFp+euVubyZTZcT4+K+3aulyPCqw= Received: from ZR0P278CA0153.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::20) by GV2PR08MB9280.eurprd08.prod.outlook.com (2603:10a6:150:e1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Thu, 9 Mar 2023 14:53:10 +0000 Received: from VI1EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:41:cafe::2c) by ZR0P278CA0153.outlook.office365.com (2603:10a6:910:41::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53: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 VI1EUR03FT021.mail.protection.outlook.com (100.127.144.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:09 +0000 Received: ("Tessian outbound f2a8d6d66d12:v135"); Thu, 09 Mar 2023 14:53:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1426a15e1fb68516 X-CR-MTA-TID: 64aa7808 Received: from 1c3926401153.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 36A01971-03BB-4F30-A0DF-B3F39841EA65.1; Thu, 09 Mar 2023 14:53:02 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1c3926401153.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nVt+Iig2/cv/sZOZia2gZ/B3spoCRH+ZsYsqeZ7S22Qb0HvPJ2DENvYzzToFTrFu7r2o7+npU4dw4t1tWz1ZGj7Bkqv91lbLVCs+FN3lR4l0KCK34oaOYJ4H7PPc5nAOv2hdVqs9HHnmXe8P3Hev85VJKA50F+tOBy4LQ39auWnLoYhLGjUAjHpCg7cK3LKrJJ8/jcHvSnzu9MfBHYe4cPIHQP4Jthz962DBL4qM2yh+GMhKQnN2AqFS1iqnDQuQccP/ShcPjRVJiWlPsYYyhA/CTNcU53TmnmPvWl2a0vnQyH9TsqMYDl4pc5tYSJkyJf2SYk5Jj/4qep5CZvXKxA== 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=8WShnfZhrvJZyO0qMQZh56y54wfk3CVLsZ6jywpXbkM=; b=X4dokSnorMhYtZYFTT4969qHT/aRIWxY1SogbBd5MSFQDQ4PeDiy4wysyzDf3QlTroQiarrvYa38J33Xl5ASDUC44zjtReooChs3Cau4P1cDRa/e13/T9F67I1Fki5zme+8xZvihIR1QaCqi4Yx8BgoV2blj3SFzl3/GhR8uVR4ot0PCrMMKC6/RdJwVmsYPncyUVelj7YiHOaOO7tTLMDfIV4ofzlJIKdBRCTRQ7WJhdHTSkDpBK6p2bxfjZuZVlFV3ShRJhhIs1GO9t4oPM9p+6NmoziLBTNB3j1bvYC5nQ+QxHA+JHmyPDSYET0gdXSqWsx1Dkve1I2b9MrrfWQ== 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=8WShnfZhrvJZyO0qMQZh56y54wfk3CVLsZ6jywpXbkM=; b=VZRBkYySURgoJl96bEMB7kzPdmOTSZaGZiS/N9M2a+v5G3RQyoF9bPt0Yl/kU79Xrkl7F6xrp7C2dxkNzCou4PlXNatpKgbdUS7mnQAteZX/PMzBFOAS/QEl7g7agDeXcYBAmjE46L6dnkpCFp+euVubyZTZcT4+K+3aulyPCqw= Received: from FR3P281CA0083.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1f::21) by AS8PR08MB9646.eurprd08.prod.outlook.com (2603:10a6:20b:619::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:53:01 +0000 Received: from VI1EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1f:cafe::48) by FR3P281CA0083.outlook.office365.com (2603:10a6:d10:1f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:00 +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 VI1EUR03FT044.mail.protection.outlook.com (100.127.144.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:59 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:53 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:53 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:53 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 07/18] arm64: cpufeature: add TCR2 cpucap Date: Thu, 9 Mar 2023 14:52:35 +0000 Message-ID: <20230309145246.22787-8-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT044:EE_|AS8PR08MB9646:EE_|VI1EUR03FT021:EE_|GV2PR08MB9280:EE_ X-MS-Office365-Filtering-Correlation-Id: c99de6cc-1941-4111-9a88-08db20adffd9 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: 16M3uRi7TlvmOcCX6fHFllohus5sUxw0YukoUmH4hBZ5fVNKGnc8LAD/tWifrwd1TZP7pXT6ah0bjc444XTMowAaHjOy/SankxeN4ikGPp9ojWxw0NG+5CDOdLEoZE/i1SLwwXvbEQaJWilF0qCgbvbXFIalLkB/v0Q81gYJ9td+dhgpU8ja+C6pE+YHRdKGee6K7zoPD8/WQo6X+Tpoxs7rGbZR1VUDmQ1Ni5FboKe8djpiJBV0H/gwlfhFTti0FWC6rAlB3QhfDk8cFvE2epk71YiqhdkoR4J9OJdbbecZivEuPisgRN1DfHYDfK2NGdC5aifjaYFw0lPR53pLheBmAfPwELM8MAytUq9OuiOcPDEjXAzlQBBGwvuk9+jP7K1XeSYhPptSGbYEJCaLYDxcPhdQQNljkKncTSx0zdz2M0vkf6UxIBRtu+58jp5uQ9DfzdPnGwR0A64PGurF+qGTM50qnFAKhRsE/Wa0LdGXDdtoyALziD336FUULreXfqVpbf9GewiSZHOGWrmj3fsszpFoJ0TXBZPAh0c+xp038T5cEq0G3cqJpRj6XITXGKd8Dw+87fWotck1LcJID3OJh7nK2ja/NXCboBWfWHXwZhWOVu0e/CA/e3HIcFOOlbOX0i9jEtjUJ3dPP/NG4ieQcU5B6A72IBqhvWgrS8o2yQ6h418Q0vO2BMolPk6XhJThujbRM8tRa8XFzb7N4A== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(376002)(346002)(39860400002)(396003)(451199018)(46966006)(36840700001)(36756003)(186003)(82740400003)(36860700001)(7696005)(1076003)(336012)(26005)(41300700001)(2616005)(47076005)(6666004)(426003)(40480700001)(70206006)(6916009)(4326008)(8676002)(70586007)(2906002)(8936002)(5660300002)(44832011)(356005)(81166007)(86362001)(316002)(478600001)(54906003)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9646 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3fa0cead-8deb-4f02-16dd-08db20adf9bf X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DZvHdKMGKfT93XDb1SZ0iGKAP2uebWI74xhnDwQEDFs/ol5Rbsv3YN39bupUOLEjYvEVhgSc/s54gQl9gUkYYH0dKNs4ben5WFkrQY/p6zDInKx22hiJdTwqz7kamTurdjnRsMW+oWOPCKuMNblf2wbGouUn0Jecht3p+lY0tFsPB5fd+HSxempj64tyql7sjmDgp9AV3DT4Wc8xF8CrHGqITJy9MJ40Bo28at51/uMSJate1Gq9/Ou3h6x1fYXJNIRmnQHGisJbGFIjEqNGqFaqU1fIfdnSaRH0bEC60nFQaVeyTbmNx8dBC9fZPVAMB7hbEqCys+4QEVeL+1V9ivXsvfRMohTCwbndcldDTYiJCHhFfr/+p/Mw6jWBCizhy8RkBWIpS9jNUj6jmCxoaURB5Z4MMklgkLm78Vamf+PM7kJxti81QXjQyGASARZwk/2kCGiHNWUDvDSg/KXdgEvqf1vrQIgp0RiRDZLILmS1ksqQPZelKXlWP0ArcXvTcuKpPdM9Kg1YME8oRyU8pR6OQ7nJgkE6He39tpxlfQfS+W4w+/ZjEb8AcQEfheOVDstu4iNQli/A4slpE6pSwHqGQqk3rDhNCa0HWe0EI6gl5Kxh4FUoa2X8J9K1eWcoa9v46DpCyqLanflOXtaagT4Yvc2eCiBs535PGSa0ByUofpsCTCfe1lJZYTlssrqF/lb6ztbsI5apZ3vKwsDXqQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199018)(40470700004)(46966006)(36840700001)(70206006)(4326008)(86362001)(41300700001)(36756003)(70586007)(8676002)(2906002)(8936002)(6916009)(40480700001)(81166007)(5660300002)(82740400003)(36860700001)(44832011)(7696005)(107886003)(316002)(54906003)(478600001)(6666004)(1076003)(47076005)(82310400005)(40460700003)(426003)(186003)(2616005)(336012)(26005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:09.5845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c99de6cc-1941-4111-9a88-08db20adffd9 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: VI1EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9280 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065314_735437_E97EB4D7 X-CRM114-Status: GOOD ( 10.29 ) 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 This capability indicates if the system supports the TCR2_ELx system register. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/kernel/cpufeature.c | 10 ++++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 9590335b2ce0..6944d8bbb17c 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2783,6 +2783,16 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, .cpu_enable = cpu_enable_dit, }, + { + .capability = ARM64_HAS_TCR2, + .type = ARM64_CPUCAP_SYSTEM_FEATURE, + .sys_reg = SYS_ID_AA64MMFR3_EL1, + .sign = FTR_UNSIGNED, + .field_pos = ID_AA64MMFR3_EL1_TCRX_SHIFT, + .field_width = 4, + .min_field_value = ID_AA64MMFR3_EL1_TCRX_IMP, + .matches = has_cpuid_feature, + }, {}, }; diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index 37b1340e9646..5859b9ee7444 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -41,6 +41,7 @@ HAS_RAS_EXTN HAS_RNG HAS_SB HAS_STAGE2_FWB +HAS_TCR2 HAS_TIDCP1 HAS_TLB_RANGE HAS_VIRT_HOST_EXTN From patchwork Thu Mar 9 14:52:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167694 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 4F1FFC64EC4 for ; Thu, 9 Mar 2023 15:00:57 +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=umEne35kVDR+7MtIWGMkdOySwMM1Yom6oBzlXo4FX+A=; b=iKIphE+ShvokBB 6b2eFUhnA93+nDzT/EOm72V/5WzwAHYoLDD+REi13gTcwwcwnmyHFab6I9IrCOlzWCUmdE23uMmy3 RkrUnW/2zxY2Sp6UaQuYFG02EZ0AZFLKfkDMdPRrEfezB2GaQzeaZJGtwoqlIBVk/9XwjMhVyapQc g05vZOo4w3ity+dUfopC1bqQpaAIIE/fRANhWA1laozxdilXsN+4prsvMz/nfagzQvOI8iJvUD70+ YadfCrPsy5CEBPxCOVtxCE/TWs5hTKhpjctfOFdIK/6tov2UnrSME9TSOjq3CoqfqLy84gz3ojxHR K257z+7+ZRs/LxtmFLiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHjx-00Ajy7-Kq; Thu, 09 Mar 2023 14:59:34 +0000 Received: from mail-db5eur01on061c.outbound.protection.outlook.com ([2a01:111:f400:fe02::61c] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHdw-00AhMP-48 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:23 +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=ypYZA7Q1WWbAkP5MlTxBkJMu0EYwB/lVaCp+BDvXg50=; b=ZgycqVkGuHQ3DkROMkwJ9N5145fem/buPb8WB2ima+zY7Ly4k7rjczqaNExgLhePXBw0UfGK7uRehVmUH/QqwNEphSjz891syMc2isoTj+LzHor4VzBqqjF3b4g3y4cxFZJx+XSOaWLguUzDdRyHBQXSJFv+WiFxDbRh2ZmR27Y= Received: from ZR0P278CA0095.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::10) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:16 +0000 Received: from VI1EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:23:cafe::b) by ZR0P278CA0095.outlook.office365.com (2603:10a6:910:23::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT064.mail.protection.outlook.com (100.127.144.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.32 via Frontend Transport; Thu, 9 Mar 2023 14:53:15 +0000 Received: ("Tessian outbound 55ffa3012b8f:v135"); Thu, 09 Mar 2023 14:53:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7ba999df1659c313 X-CR-MTA-TID: 64aa7808 Received: from f25ab73d50f3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0E592730-22BA-4090-B2B7-E9E0DA08064D.1; Thu, 09 Mar 2023 14:53:09 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f25ab73d50f3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ms6hK4ZPXZ0lfoogMeMiwtLYf5XPfs50oSTVwhi0eVKoZDwo7NyZE0dFz8eQ0+7I1BjaXO8p7ix89jNqHeO80p4dY7+Wap3jGjMEL+z+AnkDuRTy1voUL8Fsv4fvG/Fgi/yoHVR9jkm3cP0dU6a95KOeVWTJHoT1vKMEJLvSSNXuTymCuxFbrL6Ke6Rsbf0kn1Z8QWok5QxZz4ap2ptWGHBF3Lujt/UgK4DC6u5vthfr2wYx70Lfs7wRf2I+lI4LkTxlx+EWRjwdL4Dqos9gT4VdGRhcvUESqjxEl3Yjaika3vcKKkTlrQ5zGbr3gt5ZrA1OggUQulB9QQQ1akHf3A== 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=ypYZA7Q1WWbAkP5MlTxBkJMu0EYwB/lVaCp+BDvXg50=; b=dLA03nnEegsePn1aW/NDkwv5w2zYy/VxKgdT0YV/HwMxSwjvg4tRkAEtGSySmJeBM+Qly7w2KEIglVd5JdrIZrGD3wPfjB92uD+VIuTN6n4baqUNKenMrskY2LsmwbMR1y1GWC0efgCHMGu+1QUHFs9i++9934D8ZdExvWo9/tDrH4oYLa4F0DIXv8fKCKY9QG3nNr+JwXin/awZT3VLWjXmnwXt9Wduq0SCgQlYHAzrzcYTYPik1dHal20r2GfdLuBpg8C14ftS9L7CeVAPB/ZdxIZcNHSsZw5rgttALqIzrs1XelVGiL893HMDObQrk4Y2FGwbviTt8xPXP8IHvw== 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=ypYZA7Q1WWbAkP5MlTxBkJMu0EYwB/lVaCp+BDvXg50=; b=ZgycqVkGuHQ3DkROMkwJ9N5145fem/buPb8WB2ima+zY7Ly4k7rjczqaNExgLhePXBw0UfGK7uRehVmUH/QqwNEphSjz891syMc2isoTj+LzHor4VzBqqjF3b4g3y4cxFZJx+XSOaWLguUzDdRyHBQXSJFv+WiFxDbRh2ZmR27Y= Received: from AS9PR05CA0093.eurprd05.prod.outlook.com (2603:10a6:20b:498::18) by GV2PR08MB8320.eurprd08.prod.outlook.com (2603:10a6:150:b5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:53:07 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::5e) by AS9PR05CA0093.outlook.office365.com (2603:10a6:20b:498::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:06 +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.17; Thu, 9 Mar 2023 14:52:53 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:53 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 08/18] arm64: cpufeature: add Permission Indirection Extension cpucap Date: Thu, 9 Mar 2023 14:52:36 +0000 Message-ID: <20230309145246.22787-9-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|GV2PR08MB8320:EE_|VI1EUR03FT064:EE_|AS8PR08MB6533:EE_ X-MS-Office365-Filtering-Correlation-Id: 03ba7c7d-fd5c-4812-57dc-08db20ae0392 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: l+HGCq2HH5my0R7v/WGQUIaGzBAjrLBTig7Hp1p4eUHZ+uCO75z35PN+iMxr+e2cYj9Cfxti+dbXsiS9mcDvw8rCvUtHZI+b5D39zLMqFlQZd48RrJ1OWTrxbvhoymTKcPP6eVp62yZ3OT5Y8sLrT7HTnTiEeSWDJxJRWNQ9EzyKB1E0AXHlQOIlue6zoIlaajH4W6YzVO0/gQrG+m/m76C8NYbFgncMoFPbvLbq+Fxd90fVhJvt2BH6Lw1DfM5+Yg/E70NgXUm+TH9hiNYKWsPew41vMZ+e/PnQhrdswmAq906kowhn/sL94X54EHdCpVZ+SuOj1haCAIAWqqr7VdSb4cOn5wbY+hkOwB1jmAeDnh9zHyVbSfuY7FiW5zytANBfinejioZEj/2SffOdjXCIyESCGopS6hq+o8UKB/vroW2CGR41sNcEstiQHlQArhdcomMhhAx0ZEbya9C8KNbzEHsIVdyStDHhL70cJW0euo4z7M8CuJBjrRScVMOgqRBhb36fA5Wwy/0uNYtHtaCGXysEVWnnMiqrRIJKWJP42MJscFv38R10h2vq52C+D/oJTH5utmhgXscdLS4pN7d9ZjQEbTWTTMPYlwBXara4Y1+i7+G+VDGdMQl3lonZi34t1ok77TAV9ROzKJgB63fjkBbKZHcZtR37cc5Spo3GgPInIU3Y8TBbmoIurHzLaq+ASd/d7jYJr8269tNV3g== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(396003)(39860400002)(376002)(451199018)(46966006)(36840700001)(70206006)(8676002)(70586007)(47076005)(186003)(82310400005)(426003)(54906003)(40480700001)(86362001)(36860700001)(356005)(2616005)(26005)(82740400003)(36756003)(1076003)(336012)(81166007)(316002)(6916009)(7696005)(2906002)(8936002)(44832011)(478600001)(6666004)(5660300002)(4326008)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8320 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9b36f008-02d5-40b1-9e2b-08db20adfe36 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPQNYQ8x2sOwLmeC+9HIOCtGYMXVA7w6dkR0+BGi62sxrOafjw5CPHDCVZCWOIubS41UreXHQxjZMbYVt5jSJCT3EKYKGnYb2xZ0ZQvHU8zCuzEXgt18cOA26zT/IQzobvhi0VDOO3cmFe98r0PUUkgDixzzWKR7UuzrP9zvU1sL0ajsw7IzLmbtQ6o3LP0NJXUoy27K+/fF0U/R282VpWQtvl7K1evHI5GPhDMdU/aRWzBI0Ts8SeuNZ47HncDrqK6ANLN3hLMis5pLlrprZzXYwENBexSngso+X1jCk0f/W70yxFjoFkr5kY+MuS5cgEEy+UCQ5f8eFm5QpK+tEl7ybXLGtPyCb8HOOHKHErJXmwemPvKjDlgZaRrf4BSUZbAHZDwBch8PxTxxhlN8eD1sTa9Ikmapa7fOraQlwUn0+DGOFz6ehBsrCMXG91j3MRvQeLxUW6G7tkympC8kiLzMAtRHHaPOgRE+GhwM+eCDf579MrED+fME1C4GUOFQxQKeHh/i7/G0fdIL+cATAW06K0wGZf2MrI3PPux8Q355nf8JiwbQY9DVr9qT1L/oSd8ovNo6D/8MLchEPhlve3UTntzgpco93JEl66zkLsc/Zw8OtNTLXk03SwNpQeKlcZZq1hr3qSfY4QGcyfwYgV1D8g+4M90/wFygxgSqBQRb+K+uYs0/VGT/s5ZRGK086hJ+Dlx9I1znR9GtLSkuGQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(39860400002)(376002)(346002)(396003)(451199018)(40470700004)(46966006)(36840700001)(40480700001)(2616005)(41300700001)(186003)(8676002)(316002)(70586007)(70206006)(40460700003)(54906003)(26005)(1076003)(7696005)(82310400005)(81166007)(82740400003)(86362001)(47076005)(426003)(4326008)(336012)(6916009)(36756003)(5660300002)(2906002)(44832011)(6666004)(107886003)(478600001)(36860700001)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:15.8284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03ba7c7d-fd5c-4812-57dc-08db20ae0392 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: VI1EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065320_357273_57F41A68 X-CRM114-Status: UNSURE ( 9.80 ) 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 This indicates if the system supports PIE. This is a CPUCAP_BOOT_CPU_FEATURE as the boot CPU will enable PIE if it has it, so secondary CPUs must also have this feature. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/kernel/cpufeature.c | 11 +++++++++++ arch/arm64/tools/cpucaps | 1 + 2 files changed, 12 insertions(+) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 6944d8bbb17c..acbc21963128 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -2793,6 +2793,17 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .min_field_value = ID_AA64MMFR3_EL1_TCRX_IMP, .matches = has_cpuid_feature, }, + { + .desc = "Permission Indirection Extension (PIE)", + .capability = ARM64_HAS_PIE, + .type = ARM64_CPUCAP_BOOT_CPU_FEATURE, + .sys_reg = SYS_ID_AA64MMFR3_EL1, + .sign = FTR_UNSIGNED, + .field_pos = ID_AA64MMFR3_EL1_S1PIE_SHIFT, + .field_width = 4, + .min_field_value = ID_AA64MMFR3_EL1_S1PIE_IMP, + .matches = has_cpuid_feature, + }, {}, }; diff --git a/arch/arm64/tools/cpucaps b/arch/arm64/tools/cpucaps index 5859b9ee7444..c4c4c59882b8 100644 --- a/arch/arm64/tools/cpucaps +++ b/arch/arm64/tools/cpucaps @@ -37,6 +37,7 @@ HAS_NESTED_VIRT HAS_NO_FPSIMD HAS_NO_HW_PREFETCH HAS_PAN +HAS_PIE HAS_RAS_EXTN HAS_RNG HAS_SB From patchwork Thu Mar 9 14:52:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167720 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 59A49C64EC4 for ; Thu, 9 Mar 2023 15:12:00 +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=FN9YS+N/PQhoAL86nbGWixvHqwt3a35kGKkxt1DPw44=; b=l/QNbTiOojnjGy YTc7DqU5O8n3QwbIygXZfdqM46Bsxxi54nX6m8NzLGiaNIJBfQUfWDPMuZB+QLRlKLeTQkBILYrEw C3AKzM02hQfR+1DlScvcounX7yllqudCET6W2FKsaWF7rRZxoDLwuVvg4oCfQa+OvFvAeY58twpf6 fMOfjjp33sGvZjLv1aVmaM2Wt9yCesuKRPfCqVCy453VSekMM01/0GLb/xATJ3++J4E2sNpoXhKi6 gabMzy0EFjpJ7OJ0NzwQTUJ39TbwktzjugoxYuTsobag6tybd5aUHHPD+eeGwK3IPxOlPE7UVhnkC J6xHTFnXqzNonZtyvepA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHuT-00Anwf-0m; Thu, 09 Mar 2023 15:10:27 +0000 Received: from mail-db3eur04on060f.outbound.protection.outlook.com ([2a01:111:f400:fe0c::60f] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHec-00Ahg8-B9 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:54:03 +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=T76og9OrKSgNYBPGf8/+TOj5cE0WD5KLDAV7sLbdVPg=; b=6qPiNYzMQwr92tVKWAC5LgR7TbpRnv0ezBgixqE439l7ix0dR5DHkjYp7HZ+4Ogbgl9bNYxRgwfH9xdVU4+W3SQgFEPyP9f4+DZpmDrFO6WxTVf5gNDpLuYDcnzIYjiPTkmGuOS7BC+2hXObBbSSnd8v5I9rE/O7Q6FH6aq0GeA= Received: from DUZPR01CA0084.eurprd01.prod.exchangelabs.com (2603:10a6:10:46a::11) by DB9PR08MB7674.eurprd08.prod.outlook.com (2603:10a6:10:37d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:53:51 +0000 Received: from DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:46a:cafe::78) by DUZPR01CA0084.outlook.office365.com (2603:10a6:10:46a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53: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 DBAEUR03FT018.mail.protection.outlook.com (100.127.142.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Thu, 9 Mar 2023 14:53:51 +0000 Received: ("Tessian outbound c2bcb4c18c29:v135"); Thu, 09 Mar 2023 14:53:51 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9778585a9c34c1b7 X-CR-MTA-TID: 64aa7808 Received: from 7382ca085ce3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 994DFC0C-84DA-4539-A4A3-D8DB99DCD3E6.1; Thu, 09 Mar 2023 14:52:56 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7382ca085ce3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:52:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z9/9nYH+U2MbfEx6lskNf2bsMpqmie2uGg+jYeVn0nYa9+4P+bDxHGOFOnlgdLWEjA658OC48litYrd2aS02+6PuNZbf13zNYvb3Rkoo6IaP6uCHLHy6+HW0hKRylNcPO2mYIIUDO+i6H8JVpENTyKo5oCLILvuiAa8RnUXGecMjDvFJJwRgaXrPMWwrMJrFzt6SCZk77IzTnabYksYhgcIMeOrLM+1HCw3++2mtX5/1RriOtrbX9kd7oaaDmXasXMyL9G9UcJdQC0ek/tHXSLO3hN7G8J5zdDj2gB8l/sUkzBw/cucCJRWbg6vLD363eg3tHi//qHIFQK0TC/XEBg== 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=T76og9OrKSgNYBPGf8/+TOj5cE0WD5KLDAV7sLbdVPg=; b=gVxuCqe5U6hcD346OxXhrJZlkVr+0JNVhK6WQMYFhbIZPgNFi5kvXae7vU7pQhBvPK43BivORSQ4cqgGMIpipEUHRn4zjcobvMVIy6VwVnPeHsu2b85yPE1SniZmF0/AxK5UlOM11i7oJP7uTzj38gEfI1RvWtEBcGuf9ltO5NtJrRJQoJucItbJ7MXic/Q8uPvALbtuN/xke06MuYJTbv1RcCQH0CoiWXpAgXilQB3nQTxU5SYTfcq5My1N3ygw/apfn1S3vn/wPHQeYoed1yhxBxvmNRkqWFtfVIbv3cHu1+pku/+jRtO3v4j4i1O/qOyvBBMA7KnHJJC0GwIElw== 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=T76og9OrKSgNYBPGf8/+TOj5cE0WD5KLDAV7sLbdVPg=; b=6qPiNYzMQwr92tVKWAC5LgR7TbpRnv0ezBgixqE439l7ix0dR5DHkjYp7HZ+4Ogbgl9bNYxRgwfH9xdVU4+W3SQgFEPyP9f4+DZpmDrFO6WxTVf5gNDpLuYDcnzIYjiPTkmGuOS7BC+2hXObBbSSnd8v5I9rE/O7Q6FH6aq0GeA= Received: from AS8PR07CA0041.eurprd07.prod.outlook.com (2603:10a6:20b:459::31) by DU0PR08MB10368.eurprd08.prod.outlook.com (2603:10a6:10:408::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:52:55 +0000 Received: from VI1EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::31) by AS8PR07CA0041.outlook.office365.com (2603:10a6:20b:459::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +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 VI1EUR03FT013.mail.protection.outlook.com (100.127.145.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +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.17; Thu, 9 Mar 2023 14:52:54 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:54 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:53 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 09/18] KVM: arm64: Save/restore TCR2_EL1 Date: Thu, 9 Mar 2023 14:52:37 +0000 Message-ID: <20230309145246.22787-10-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT013:EE_|DU0PR08MB10368:EE_|DBAEUR03FT018:EE_|DB9PR08MB7674:EE_ X-MS-Office365-Filtering-Correlation-Id: 89bdb59b-d39e-40a5-ba73-08db20ae18c1 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: /K/Fv8FxLXl+/ycurdyW9bIhVWk7+RWRT6NhyZINMGGHLnj/XMQrMnX7tCvTLjVkpqYk1KeYz9HLiMkUzUA7+ZDJmQ14GjfaF3J6avT8lzP+fznw7Ra7UdXzRV9C0zY3eJUBlhdLweLexSHeSw3JlAnJEP56uEk5iCNyWRm8EBtzPKqks5KYwDe+eirdJGVIuzP1Gt8Uveo8W57IRBGEVuO3iVm2Yk6t/p31CYrcs8CQ3xmte0zxw6o0J3xZf+JNnvU//ZPMU195CeY4EaYjA7quLB2YNuTeyQ2q4AhmvVboV50cwN/SnQei5Pw0CpoZdK/TXxs6UeHzFtb3CwBVJe+WkHZD7hRpvcgXSHOtQQ6iItSYewvRBqOoxECcic28MjOZl4ZIJAy5EMR402hiqNoGO00CznxZO5KqCH4oquJ0F2a5TCq92BV05V66glthcDVy/N8Ns/WjDWERBIogMAmsEa3EB03hsZ8pMUgaxlzsOEqAey9PeUMpkNGTn3UvOwSbdwUMemR/P2qcrGbxATkbm+oLYBYMlYO3sN83B/6WBNBk6ZpbisxMrm1JZNp3DusJRn7Ehh8JhjWGB7MKe6nshZROjytOFwTGhBAQyf+rW8Y1DdDfEsFhbEWLieViELKCAzfThfwzFqjMiozXLVnW+NqP17uejzmPovwEL9pgmnekWO1VjqfJ1oUyrQbG2Liw3PEELTaUIWbiPco+mA== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(376002)(346002)(39860400002)(451199018)(46966006)(36840700001)(426003)(336012)(47076005)(54906003)(36756003)(316002)(40480700001)(186003)(86362001)(478600001)(81166007)(36860700001)(82740400003)(26005)(1076003)(6666004)(83380400001)(82310400005)(356005)(2616005)(8936002)(7696005)(5660300002)(41300700001)(44832011)(2906002)(6916009)(70206006)(8676002)(4326008)(70586007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB10368 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cd724adf-e495-4737-a295-08db20adf763 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LqcP8qsje9K6k2iQ6erQhxB6zgTV1AV0soCdHz3lmQk4HOazIMWhJy7ZmLYAIbohFw0s57nR/bXVN1lgK0bPCOOjyF0Wq1bddEL/7kkZZKiZbvZkl4yVvxaUzMQ8W2qLnTDVSyf3b90ZtO1aPnT8PwxvkPWt66pnTMggoamCML5v08xDCkGgH+CL4+/UqxXuso+A3HLrNYvKedGreqOPmeWvgLQkPVB785HbapNWZl/61SIdPjHJnlViYrx0wQWjL5Pgn2TFJ6qgcARCa5/iS9XPt1ISvLW2rv6sA15kS0d4QDG+OfRowGb4cOimL1kkQqakwaadnAQ809vz329So0aSlcXavwBspsU5AT4AsE4yb/e17AAJP79HtdIF6vCt7y87Eb4948WFmdFE78z9BwCgJfB46t1sf6L6gz7u4KR0RtxjAMa0rb3C0KLwVTZ6lHzTTQtTluhkETEL/cBK2xmcz5lMz58UDBM1IQU5ykAzCHGCBvw8/8AmaW+hOl3KkGJXH9d4jR/N2a6Fp7kxxpCRrCZhJnHRjY8v8bqacz/VbRdqPMvZXOkEzGpcMiXXKnd7PiW4HfKfxc6bwDB7APyLEE8I2+be1H0xw5Guy43wnU7Oa7EVGpSLPDyzwK9JjnHK7BpB5H6fkY2G67miwKIFMMO+X+qNgNLxHNF+/AXqEmhm0X1/in7MEitgJivQQJlNRinvvgIU5jzmFooVYQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(376002)(396003)(346002)(451199018)(46966006)(36840700001)(40470700004)(83380400001)(2616005)(82310400005)(336012)(81166007)(426003)(47076005)(44832011)(36860700001)(4326008)(8676002)(70586007)(6916009)(5660300002)(2906002)(26005)(186003)(70206006)(82740400003)(7696005)(41300700001)(36756003)(478600001)(8936002)(6666004)(107886003)(1076003)(40460700003)(54906003)(316002)(40480700001)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:51.4648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89bdb59b-d39e-40a5-ba73-08db20ae18c1 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: DBAEUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7674 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065402_441647_FA5FA962 X-CRM114-Status: UNSURE ( 9.73 ) 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 Define the new system register TCR2_EL1 and context switch it. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index a1892a8f6032..799857ba281d 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -266,6 +266,7 @@ enum vcpu_sysreg { TTBR0_EL1, /* Translation Table Base Register 0 */ TTBR1_EL1, /* Translation Table Base Register 1 */ TCR_EL1, /* Translation Control Register */ + TCR2_EL1, /* Extended Translation Control Register */ ESR_EL1, /* Exception Syndrome Register */ AFSR0_EL1, /* Auxiliary Fault Status Register 0 */ AFSR1_EL1, /* Auxiliary Fault Status Register 1 */ diff --git a/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h b/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h index 699ea1f8d409..16199a107a47 100644 --- a/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h +++ b/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h @@ -44,6 +44,8 @@ static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt) ctxt_sys_reg(ctxt, TTBR0_EL1) = read_sysreg_el1(SYS_TTBR0); ctxt_sys_reg(ctxt, TTBR1_EL1) = read_sysreg_el1(SYS_TTBR1); ctxt_sys_reg(ctxt, TCR_EL1) = read_sysreg_el1(SYS_TCR); + if (cpus_have_final_cap(ARM64_HAS_TCR2)) + ctxt_sys_reg(ctxt, TCR2_EL1) = read_sysreg_el1(SYS_TCR2); ctxt_sys_reg(ctxt, ESR_EL1) = read_sysreg_el1(SYS_ESR); ctxt_sys_reg(ctxt, AFSR0_EL1) = read_sysreg_el1(SYS_AFSR0); ctxt_sys_reg(ctxt, AFSR1_EL1) = read_sysreg_el1(SYS_AFSR1); @@ -114,6 +116,8 @@ static inline void __sysreg_restore_el1_state(struct kvm_cpu_context *ctxt) write_sysreg_el1(ctxt_sys_reg(ctxt, CPACR_EL1), SYS_CPACR); write_sysreg_el1(ctxt_sys_reg(ctxt, TTBR0_EL1), SYS_TTBR0); write_sysreg_el1(ctxt_sys_reg(ctxt, TTBR1_EL1), SYS_TTBR1); + if (cpus_have_final_cap(ARM64_HAS_TCR2)) + write_sysreg_el1(ctxt_sys_reg(ctxt, TCR2_EL1), SYS_TCR2); write_sysreg_el1(ctxt_sys_reg(ctxt, ESR_EL1), SYS_ESR); write_sysreg_el1(ctxt_sys_reg(ctxt, AFSR0_EL1), SYS_AFSR0); write_sysreg_el1(ctxt_sys_reg(ctxt, AFSR1_EL1), SYS_AFSR1); From patchwork Thu Mar 9 14:52:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167718 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 E5489C64EC4 for ; Thu, 9 Mar 2023 15:09:45 +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=CcY/Mb6/w/YaJyXe1obVz8FvJx/YMVoCqO9w3c192D8=; b=G4Xk7U4e3NZjiM udVwN5XKwo3BVWpoYuS1ofU/N3Jg3gIXHsqVPxVURH6OXFzwzZNrVEvljXKvDK+nUwP4ylQOwKMIA Sa7HORrL3qvFnK5v8jYJ4dL0hfJmT4VVlzMcPIKAafGxecglKalQ3lwEGz0r0PkagiSnnxXvtLqpH WOt6p8e1W3Nhs2aMMrOsG8Q4citg717pmOVQNW2QthorOE+sL9fq8itfcSLIYjweIR1Vidj6oI2Rh TUulB3znjcEkPL4XCuNU/SrAV265t0N4qU+yvrDdr817D4QuECWxmcMkLTGpxQdogmERkY9DUtdzK eYLe3YXhQBlm3Rqg7YXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHs5-00An8s-M8; Thu, 09 Mar 2023 15:08:00 +0000 Received: from mail-db8eur05on20611.outbound.protection.outlook.com ([2a01:111:f400:7e1a::611] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHe6-00AhRx-It for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:32 +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=cFyTLg7NwIWKyuU684BcPkiOaLUhfYn0q0iaHgJJ5ts=; b=whzBqTXL8t24V5/Kux4uCcCWL33ODz36qsi8oAuiL9tH1v9JnBDogxlOuGU6rVXG4ZunO/VSQkCb9nQI2meWyUZpOaAap4WeSmQ92dsHb5oBrbDnEg9yAbA20YIdHV9tK9EjTHH2W1gvxHGS1Y5XQORYLo0kgLoYO7chfOmO9h4= Received: from AS9PR05CA0288.eurprd05.prod.outlook.com (2603:10a6:20b:492::12) by DBAPR08MB5751.eurprd08.prod.outlook.com (2603:10a6:10:1a0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:53:16 +0000 Received: from VI1EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:492:cafe::71) by AS9PR05CA0288.outlook.office365.com (2603:10a6:20b:492::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 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 VI1EUR03FT033.mail.protection.outlook.com (100.127.144.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 Received: ("Tessian outbound 2ba0ed2ebb9f:v135"); Thu, 09 Mar 2023 14:53:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bde357cc8a4b2606 X-CR-MTA-TID: 64aa7808 Received: from 32411f831418.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F1F9408-7F7E-4AFA-B689-2FDCB2B20D73.1; Thu, 09 Mar 2023 14:53:09 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 32411f831418.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XgafS3HtoXBWNQjpYLY8zU+P3e2lq8x+68MNVaGokriS4VuLsCLAx4mLgs7/j3EZkxDWLcTHRplYdz0oSLHxAod98Bpi1Fu//L+4ggd4nzCet2iP8hkkGdU2Yr2fPSIwEEFOHjqGySrwyiww7/gpUl3N1cswkdGxK36AVVekekX85MQzx8TlgtGXN9XrFpp3O8FYkGuPH1OUS1dtfqr6r3uvIdAfegxWf8UEdaX+n2/cH/pHc4aOBD1x6/8fDt65djsiETa6AR9ztirk0ZqwLnfTyEVdNgM1sKT3vH0cXtFXtIQ6DMWf9cGM7OFYz1qo+OzOPelC9lFnLeunG6AExA== 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=cFyTLg7NwIWKyuU684BcPkiOaLUhfYn0q0iaHgJJ5ts=; b=GKOWcsPnNheBXpzFlOulYhZVt+h/HOVIs8S5n9qhIzqx8KTHV/YJ5puXnTHTQxlRST2lFSB+8EKOurumH2v73gZXMETxJl3KerbeKMbVn58TzCiHLzQnSVm/N1BwL7QZsOonIqSMHr7h+HekIpnNUrzFsy8c0hmQy5p6OYNVMIK0J9Ksjw0MPWbUeBSV8zT5T3vWX8fUB0c4iZ6UYiDuz38b5P8uJBtMgHRSfJel5JJbIfmtVWAstXY9AXx0X7zHU5B/f9jNTep0F8atqpl0T6qjBFBKKHketAfrLM7nL+cWYndHbWXnqW5r3J8Lr+6L68+MN4I6hxdzE1s74pI2vQ== 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=cFyTLg7NwIWKyuU684BcPkiOaLUhfYn0q0iaHgJJ5ts=; b=whzBqTXL8t24V5/Kux4uCcCWL33ODz36qsi8oAuiL9tH1v9JnBDogxlOuGU6rVXG4ZunO/VSQkCb9nQI2meWyUZpOaAap4WeSmQ92dsHb5oBrbDnEg9yAbA20YIdHV9tK9EjTHH2W1gvxHGS1Y5XQORYLo0kgLoYO7chfOmO9h4= Received: from AS9PR05CA0105.eurprd05.prod.outlook.com (2603:10a6:20b:498::20) by AS1PR08MB7612.eurprd08.prod.outlook.com (2603:10a6:20b:477::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 14:53:07 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::7b) by AS9PR05CA0105.outlook.office365.com (2603:10a6:20b:498::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +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.17; Thu, 9 Mar 2023 14:52:54 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:54 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 10/18] KVM: arm64: Save/restore PIE registers Date: Thu, 9 Mar 2023 14:52:38 +0000 Message-ID: <20230309145246.22787-11-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|AS1PR08MB7612:EE_|VI1EUR03FT033:EE_|DBAPR08MB5751:EE_ X-MS-Office365-Filtering-Correlation-Id: c17cba70-e60f-45dd-f6f6-08db20ae03cf 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: 0pxZFrD0Lzukg5ffSlRRHr9Zy6pUXWthE0MDNp89V3yVzckzd/JCUmANRfWC1K3vsdlRwoeCkyIQLaUcgrXM+cVccvYhPOYkIQCT7c5yMx7U/etg0i6JZeSdDorTwShKq9rs3nqmqgO43oV/s+O8TRPiTZB8tCDMQh/xIKmovaBGNgWmL/VAcsCMJ66RABGK3srwKimrGskgH3YsucffdLOtYJWSzSnfwh/zO52CYvluIm9Fn3MkUN/hzWCy1AkEXONyM15Lfa/xGkxHFIYjmTdRtfeSerCuIpzoqPKqdCL4Z1AJudxaD6BInM87TWwh5j0rb8HxPkaG5dBF3z6tB76TFJUnhdTJg8g4HqQhXAoHSvoqtpg8a4wulwo3dRevFOwz35MKfGn49pUPpVw3JSERpsbxYDoGZsr899N2iMNLY/EE6SBCOzXTP/L412rmALbJLzajNpO+Lm3UajcQa71z8X1jtMsDtUt2+c3MDnrbarbcOy3NqIEG83wdqOAkTUzFK2UcmBH+HRhLeonuZGcSqV4VP3KQT3AFQ30hwSrsV9XrHvuz2cnR1qfO7EQz9Te3pVB44gI5ry8r1mSyN07jAfmlY0mrc90soDlhCYUGa1egT/PTxkwIhr66QogMgk62TW3NTuykGD1Nk3WcrhKQYv8Pe9EjvKhW7lu93+Pfaiineoq5Df+eSTt4OL03Z23cNLapE63+IhacpR17gg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(396003)(136003)(346002)(39860400002)(451199018)(36840700001)(46966006)(8936002)(36756003)(5660300002)(1076003)(26005)(36860700001)(40480700001)(82740400003)(81166007)(6666004)(82310400005)(426003)(83380400001)(47076005)(336012)(186003)(2616005)(54906003)(4326008)(86362001)(316002)(41300700001)(6916009)(70206006)(8676002)(70586007)(356005)(7696005)(478600001)(2906002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7612 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6c959f94-87fc-4364-5ce7-08db20adfe98 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eat6ZgM8F85kQypCC2XWathUwK3YXnnfrWiSyqcz1clPNvZaH78THql10otrXyYahWc5YaNAmzPLA2wCHhRTMITMWUuSWGkAp2corwYYeKzARlLHTsmaXWOib8PrgZnq4yW9nEmVNSk8Pdmg7pd1muWkmEfurfI/dDkS9Vx7otSpwcX5W2vQecH6xSUPXuriCBhazUwRcGc/uWruH0+ANDBuZxnbGZwWSCyh4h56gB6PpiqnYqVSOHh7HYUyr98250Cn/D+HQS9YWi5sEjRi9aRQWFDVWCo6/tsdpTe8lMoAtjeec94XzYFr3pftjNIOgpvPf+5WnDfNQO612vRpZu04OAeZ3cbyGs6nozVwn5NI8S4t8jz7qfktiCCeEAZpLf/4AZQaMX8egr3WKHihduqnzTEMrcIQ9XWHS4kKu79NVSgSoWxRNcj4Ae1+h/KAGQQu7tW8y6Qt4grcnyrZ9UR5jsaaZsLZC6+B+35+kJnph9kk2pFYAr4yz3z4aKxO16hut72cWKTOBUn/tlC1wnKnimAmWL5ltfdCaTGzEhrGEYFaTpVXNO4ZXcuF1I/hQDVgMBstGsixkQro/tglV8d98pn4ToLSyJRU2Y9YpfJEik4r7sZfoDTtCHpBUOcw7Gr/WLT+keMQFnuatNEXmYTwW77/PXLwEgo9IareT5jemve4CIQcCElA5MzrdvCFhgOsrXvfrDTm3EURwkeKWA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199018)(36840700001)(46966006)(40470700004)(36756003)(40460700003)(316002)(54906003)(478600001)(8936002)(5660300002)(7696005)(44832011)(4326008)(6916009)(70206006)(8676002)(70586007)(2906002)(41300700001)(82740400003)(36860700001)(81166007)(40480700001)(86362001)(186003)(2616005)(6666004)(1076003)(26005)(107886003)(83380400001)(82310400005)(426003)(336012)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:16.2478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c17cba70-e60f-45dd-f6f6-08db20ae03cf 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: VI1EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5751 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065330_701267_8C784865 X-CRM114-Status: GOOD ( 10.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Define the new system registers that PIE introduces and context switch them. The PIE feature is still hidden from the ID register, and not exposed to a VM. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/kvm_host.h | 4 ++++ arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 799857ba281d..4b8229942bc5 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -364,6 +364,10 @@ enum vcpu_sysreg { CNTHCTL_EL2, /* Counter-timer Hypervisor Control register */ SP_EL2, /* EL2 Stack Pointer */ + /* Permission Indirection Extension registers */ + PIR_EL1, /* Permission Indirection Register 1 (EL1) */ + PIRE0_EL1, /* Permission Indirection Register 0 (EL1) */ + NR_SYS_REGS /* Nothing after this line! */ }; diff --git a/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h b/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h index 16199a107a47..99566bca19a9 100644 --- a/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h +++ b/arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h @@ -55,6 +55,10 @@ static inline void __sysreg_save_el1_state(struct kvm_cpu_context *ctxt) ctxt_sys_reg(ctxt, CONTEXTIDR_EL1) = read_sysreg_el1(SYS_CONTEXTIDR); ctxt_sys_reg(ctxt, AMAIR_EL1) = read_sysreg_el1(SYS_AMAIR); ctxt_sys_reg(ctxt, CNTKCTL_EL1) = read_sysreg_el1(SYS_CNTKCTL); + if (cpus_have_final_cap(ARM64_HAS_PIE)) { + ctxt_sys_reg(ctxt, PIR_EL1) = read_sysreg_el1(SYS_PIR); + ctxt_sys_reg(ctxt, PIRE0_EL1) = read_sysreg_el1(SYS_PIRE0); + } ctxt_sys_reg(ctxt, PAR_EL1) = read_sysreg_par(); ctxt_sys_reg(ctxt, TPIDR_EL1) = read_sysreg(tpidr_el1); @@ -127,6 +131,10 @@ static inline void __sysreg_restore_el1_state(struct kvm_cpu_context *ctxt) write_sysreg_el1(ctxt_sys_reg(ctxt, CONTEXTIDR_EL1), SYS_CONTEXTIDR); write_sysreg_el1(ctxt_sys_reg(ctxt, AMAIR_EL1), SYS_AMAIR); write_sysreg_el1(ctxt_sys_reg(ctxt, CNTKCTL_EL1), SYS_CNTKCTL); + if (cpus_have_final_cap(ARM64_HAS_PIE)) { + write_sysreg_el1(ctxt_sys_reg(ctxt, PIR_EL1), SYS_PIR); + write_sysreg_el1(ctxt_sys_reg(ctxt, PIRE0_EL1), SYS_PIRE0); + } write_sysreg(ctxt_sys_reg(ctxt, PAR_EL1), par_el1); write_sysreg(ctxt_sys_reg(ctxt, TPIDR_EL1), tpidr_el1); From patchwork Thu Mar 9 14:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167693 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 655F1C64EC4 for ; Thu, 9 Mar 2023 15:00:16 +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=lnl/TXIeyHSL5iTvAZbDztHI3b2R+7j8AJwTUbm/doo=; b=2VI9+fF1HDYy58 t4P0cgkeI8FnXz7v11W93AWU5ymZBrrsl37JZegMLrndDfq26GnThyPx2PsrZwvAlSXJXSgaE2ysG 4nwIGPZuBFarw44ouL4hRAeSdFvilabBv96UB5ezqGbC9J1Pk0oMqDF2vVl2kQg+tRUiETNKVl8Y+ +yUCnp6o0YiHxkCYz/eBAUvJZOy507xq4koeJyNqQEhOak94AqU3ZTZ3ViQze8ZWBXld/jBjyo6j1 i7+N4xxcatC1v609oxpUnFCMVQKsU+U/9NFmSI1WPh0dcgY/h+E4ejmzJv8f/wRGMpnU6UphEiqNT vMA5xAuoi8zEcqqjtXSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHj3-00AjbC-WF; Thu, 09 Mar 2023 14:58:40 +0000 Received: from mail-vi1eur05on2060e.outbound.protection.outlook.com ([2a01:111:f400:7d00::60e] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHdp-00AhID-JE for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:16 +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=mXPZvc2n2lC7V+pardqZsdHaTSXNlOWmeWvuc7MZtEc=; b=LSi4OcUETElKlWyQmhvRaDIE3bZo/swr48uITUplD+0xVZAYSjblYcQOgnnKzoz0bJxdLlHLIDeThNipFB8dlWXNwWCbkObQl9FHZqTlZ7qv/AI9eny7IpEaZV1c5nNLoIrv+VxQ7aB3qzODhsEwQDaWzB36LmYTwMWogESjgLk= Received: from AM7PR04CA0002.eurprd04.prod.outlook.com (2603:10a6:20b:110::12) by AM8PR08MB5572.eurprd08.prod.outlook.com (2603:10a6:20b:1db::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16; Thu, 9 Mar 2023 14:53:07 +0000 Received: from VI1EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::30) by AM7PR04CA0002.outlook.office365.com (2603:10a6:20b:110::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +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 VI1EUR03FT031.mail.protection.outlook.com (100.127.144.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +0000 Received: ("Tessian outbound cfb430c87a1e:v135"); Thu, 09 Mar 2023 14:53:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 81515142b35c118f X-CR-MTA-TID: 64aa7808 Received: from c768d5f3841c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 620DE7FD-54DC-4FC1-8D7B-CE504F06CBAC.1; Thu, 09 Mar 2023 14:53:00 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c768d5f3841c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GA/M9qC9DmDfBs9dUJ2tF4x5CHTuNV8fXG7FckuK1qyqwcU3PH7O/aNCIj4JPhGh2yOwXgCVCPY8Q/XdTpsDrs+j9D4BU1N6Hhe+YfCc8pzFyqTuCPjbV7Y9STFO8l023f2dVAvGrnlkWG1TyqC5ubJBCZk3NnyyjFIIfsY+pg2c3cQm5HCCAWIwqXvT1vFuMmhroF+2QOAsxlPAjCVB1nvh9LosJlHTieTtbPdAnNY1z5zg7ayb5wfVLyN13YGlAYbAeLe4elEHX9UhnMxePm6OG336xuURyh38j9TRFuc0HqNNRagaA5BOCEZk04NIU0VnY29IEJeexyus4f8rEw== 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=mXPZvc2n2lC7V+pardqZsdHaTSXNlOWmeWvuc7MZtEc=; b=f0AEiarGBU9Hogoq9gfS1oeslbo9i1thwctuYcIJiZSV5OKciGE8IzYbmni6Oph1fhNobnq5KTqEeRgERVcw2PaTq70yZCFqqwHR86ZffaERbRfEH3BXBySmG94+YT8BOo3Tg3U8r+8IM6O8NHt9kjIzioNdkGkd2kOwl9W2pqsEOSm4Yzyz3chBulv2oJ1MPzzLhInYBDuMlSnbF2SDmexGzYW7joYJdmh1f8KdIr7+RXwoGezCYCoHkIyIFm36wvm47N9p8F/nGlmBKTEdlahq0Ma+BGUnZri0o5hU2zCHWwW4Ztj3bpDwsokqTJRG7Xvq7AqWytEmdo1nwFRqWw== 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=mXPZvc2n2lC7V+pardqZsdHaTSXNlOWmeWvuc7MZtEc=; b=LSi4OcUETElKlWyQmhvRaDIE3bZo/swr48uITUplD+0xVZAYSjblYcQOgnnKzoz0bJxdLlHLIDeThNipFB8dlWXNwWCbkObQl9FHZqTlZ7qv/AI9eny7IpEaZV1c5nNLoIrv+VxQ7aB3qzODhsEwQDaWzB36LmYTwMWogESjgLk= Received: from AS8PR07CA0043.eurprd07.prod.outlook.com (2603:10a6:20b:459::12) by GVXPR08MB7846.eurprd08.prod.outlook.com (2603:10a6:150::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 14:52:56 +0000 Received: from VI1EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::c9) by AS8PR07CA0043.outlook.office365.com (2603:10a6:20b:459::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52: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 VI1EUR03FT013.mail.protection.outlook.com (100.127.145.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52: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.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:54 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 11/18] KVM: arm64: expose ID_AA64MMFR3_EL1 to guests Date: Thu, 9 Mar 2023 14:52:39 +0000 Message-ID: <20230309145246.22787-12-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT013:EE_|GVXPR08MB7846:EE_|VI1EUR03FT031:EE_|AM8PR08MB5572:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ad26a9b-f657-4af9-89e9-08db20adfe78 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: QB0nu8Gdav60r7YgIDKuSd48pRhcjhllpo2JqCvA6iMZZ8xuuHpDhrRLE8cXduyI6yH9cGfg6X/uWIuyA7/CZ85EqzJQ8JXLFsFljSwgsd7QO48bWsC5gcwxCdmj9sQm3FZenFUekpOvB9SKMsmmjBapXFhI35SkM3jJHrtNaQ+62zKPOr+EtMQcyZRb4Mk8bnPxWG7NtfMrtC6uT/1Fc3+RuDKXfMsb+MRptzY66fyQ5M2f0voa06mXlE0G0r4q8g9GFjmrqKMX1F2ACh+xxm3XrzaYHTqETCXW3jy0jlMo7MbcvaZS+wgqHyZCyg65iM0iI9OhaTsuKlwak8DBlgS7ZWMXeHm6MHiTFbt4mNiWWotlp8y8Q0e2VcDvPouCk3cNfwmnRgOenwExR4SVOMe6xYEYRgm9HOugQKIbjnsY3hNPRicHmWee+/tNAhvwridjCWuGlsvBB5g0BrFAxSPlXJhfyXP9WOcHMR3Fg2Gs7Hxqi2L5E7m2NgrSGg0lSbzG1RfRdhRZS72240b+d5GUh9b7A5Nx4S1pnSf7Ivs2KhDwh2G+oBdGgs+WVKmjqLKdK4weNeqyDW4Tn1ow9X4TsJw+ETmwHoGoszkjeWnp2y0b3570/ZRKRxa5rX4jl1+tByqlc6o3L6897SpmaXSOu8TdlcN+EIv6xRi2eOy+s9mGvWqZ+gvX9+y4afebOeNPnq1GD/rnXp4KLPEO6A== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199018)(36840700001)(46966006)(8676002)(36756003)(8936002)(5660300002)(26005)(1076003)(36860700001)(6666004)(81166007)(336012)(47076005)(83380400001)(82310400005)(426003)(82740400003)(186003)(2616005)(40480700001)(54906003)(316002)(86362001)(70586007)(41300700001)(70206006)(6916009)(4326008)(356005)(7696005)(478600001)(2906002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7846 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a7a3ce73-2546-45fc-5d1a-08db20adf803 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U+cv8N0pXjXZSr4badiUukZ7DnnfED2YNLWaRbm36FyzNeDXcniN3CkWzv5nbkzfFelXOZ/kLMZ5RDWkUzpUnK2s2kV/HVzn8uBvlU/+WRWNNNh++V0Sb6Z3dZuDh9ncPI2nQLdG5IDvBRxdGBhA6lvLBUPw7l0/N+YTQYDAEptMmdUSVk0tc11qlt9aIZrI/nSIOmMKkosNfLfaFAYsR9QhQ9E08dsRcKcVIO5Qq3iHOD9FxZl2W+Vmk6U/GDv1FcmFPVbAQV+dQn09wpejD/egMjHGagaUHzrbIme6K8pw5/DqaycFLrDXHvTI5toqRCApGll0ADK9d8wWFjhqFeSnKOkfY3l4iTPLzsVbD/YB4ZfQWv35LOXvSAba+eY+u+UtJ227GsOVqB5RI/NVbugctZKrTNtPQcFbPghRc4AtesrCCjEDJP2ORi42alc7R/GjWi9GdlOpTzBa6QwZ8vfIihjYnbQFlPhZC0DlswmDQPrDbC2+QPXArsCDKK9SUIKnY/Mi12NvMN2iyGTUaQXhnJVwcYpuHVdcEnzm2EHF4bs7mf9C0lLKm4A+ZGUKcUmY4WWGgdHFdrHLatE+hWg7ixkOOYXBheWRzeggaRQ+l3SF77h7k3qxT+FvNzCJhCIr+OrAxcXcnvzEAil3x5OJZNZ2Q1EoQN4pGqB8yDGLll8KTAMww8+lg/GCrKnQni1Z56Znzi4ZcDk0rddebg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199018)(46966006)(36840700001)(40470700004)(7696005)(40480700001)(2616005)(41300700001)(186003)(40460700003)(316002)(82310400005)(8676002)(70586007)(54906003)(70206006)(26005)(1076003)(81166007)(6916009)(47076005)(82740400003)(426003)(83380400001)(86362001)(4326008)(336012)(5660300002)(36756003)(36860700001)(478600001)(107886003)(2906002)(6666004)(44832011)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:07.2707 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7ad26a9b-f657-4af9-89e9-08db20adfe78 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: VI1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5572 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065313_752314_2F14D8E7 X-CRM114-Status: GOOD ( 10.91 ) 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 Now that KVM context switches the appropriate registers, expose ID_AA64MMFR3_EL1 to guests to allow them to use the new features. Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: James Morse Cc: Suzuki K Poulose Cc: Zenghui Yu Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/kvm/sys_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 53749d3a0996..db68841f3441 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1851,7 +1851,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { ID_SANITISED(ID_AA64MMFR0_EL1), ID_SANITISED(ID_AA64MMFR1_EL1), ID_SANITISED(ID_AA64MMFR2_EL1), - ID_UNALLOCATED(7,3), + ID_SANITISED(ID_AA64MMFR3_EL1), ID_UNALLOCATED(7,4), ID_UNALLOCATED(7,5), ID_UNALLOCATED(7,6), From patchwork Thu Mar 9 14:52:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167713 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 129FEC61DA4 for ; Thu, 9 Mar 2023 15:04:29 +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=+iju9SK9c4ha4Kz9qfSJCSKCbCAW92esXLg3Z66SUdA=; b=tIbcIP2W8i+LQz 17mQZsDOQ7I5L98H7Eg4fmB4KQunzWLU5W/wI5Og9GDJcHBX16RZyPegfi1a4GaZoRk7XDe37ErCv qasSbd0LTLZaBnlwWgmaDTGKNqGlqpEdatYmuetNacYBebbzpzcfGPmVlHd77d/ciKsIf47sGrLhN NnfLYDvJoivx9/UUiX0Ps8MZ7mweJPDi0qm+6ACkrp/n5nXfPbe7L6jQ7GDRRE+i1SICTUuuflghT mcWzsGrnqHUuOCF4HQBwhKZtWpNn+e7KATo6BNjU/mrfq8DysXANR6Dwp/pREKB1YzbsPhmjm48P6 mb7oYZweGbHgkjs70pwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHmu-00Al0U-Dd; Thu, 09 Mar 2023 15:02:37 +0000 Received: from mail-he1eur04on0600.outbound.protection.outlook.com ([2a01:111:f400:fe0d::600] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHe3-00AhPS-PO for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:29 +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=tg0fr6SSje//X0IJDYSxFIIUW2Hle2E5gmPV7/IUNyI=; b=MjqyVay3kgJNRsEok+lrcP+AIcJ73rwpDe0IiuOG2zPNUQ/bvgxdHaG8azNYjBhMlzt6h7m4/uNKWo1drPT5LXp2WUfcc457kO7IOlDniNeF4bVVqpXlmlLwmjfdxZHTsS2Jc3iujyFhSgZQSmoO0bZfZGM5wQRdsdWErO978mA= Received: from AM6P193CA0140.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::45) by DB5PR08MB10311.eurprd08.prod.outlook.com (2603:10a6:10:4a5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 14:53:18 +0000 Received: from VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::79) by AM6P193CA0140.outlook.office365.com (2603:10a6:209:85::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:17 +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 VI1EUR03FT023.mail.protection.outlook.com (100.127.144.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:17 +0000 Received: ("Tessian outbound fcd8b5fba459:v135"); Thu, 09 Mar 2023 14:53:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c493025f635c02b9 X-CR-MTA-TID: 64aa7808 Received: from 856b19ade159.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4D7BE532-DEAA-41D3-A753-DF0D0A796C30.1; Thu, 09 Mar 2023 14:53:10 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 856b19ade159.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KbBblTRDwWCa1oDOsfMbmyY+j969JbVLtuc/LYPncWwAj3FsGmJo0wGJdpa4/UamLbkSN+xOF6LP0VopNFx+BW6bJfCDVcgY/4o5AaLFQZhxcN0TqSV3Xb+Y7dZKVylHSZxSJY9U/TniwsMOOtDoswdjbvk7nA3gQnwSN7hJE6l/m/q4/aMSJHaIVXaqFah9Y1+WKIBU3sQRU+asRf6GUEqtFamIDL/U9QeZV3CMkMQ4iTOsZNClgQwW1BD4d3/8YWQ++Sp2N9Kx05HYRxaTLS84tnMMVc49EnElA4NxNS8O2byucmRrhruBxMPCEUDoLVuZul9MKaJEZtmXwbdcTA== 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=tg0fr6SSje//X0IJDYSxFIIUW2Hle2E5gmPV7/IUNyI=; b=EF5/wf4JKZxs870jXAC6Qjx92LqzqcbrV7EVRYxqLH+178aAxqBytPxs+tYV+43Kmz4+c+45/4kxnkzLlwAYRBiKkBCsTNtrmQSdxx1xJhsPQlbzBDuXlWns7vKalXc12F0VX//qJboVWPVXQIpmddgwo9rlx0h1l7dapB9Bh677vcO+paJkGUZWvXvCuAbdv4xdIt1KebmXUUiBUlrAx3o4OmUCIShV8b0AqQAOguo65rzwP6SyIrraMxYfiYg+sYgagr7Fj8rrBFqSTDa1KWd6xH5CFKxG2HaAQiqo/ybjvZQjx8lLrI2ULKwijN8suXHYru2wmLWMYEQF9VxQCw== 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=tg0fr6SSje//X0IJDYSxFIIUW2Hle2E5gmPV7/IUNyI=; b=MjqyVay3kgJNRsEok+lrcP+AIcJ73rwpDe0IiuOG2zPNUQ/bvgxdHaG8azNYjBhMlzt6h7m4/uNKWo1drPT5LXp2WUfcc457kO7IOlDniNeF4bVVqpXlmlLwmjfdxZHTsS2Jc3iujyFhSgZQSmoO0bZfZGM5wQRdsdWErO978mA= Received: from AS9PR05CA0103.eurprd05.prod.outlook.com (2603:10a6:20b:498::34) by AS8PR08MB6470.eurprd08.prod.outlook.com (2603:10a6:20b:33a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:53:08 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::a8) by AS9PR05CA0103.outlook.office365.com (2603:10a6:20b:498::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +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.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 12/18] arm64: add PTE_UXN/PTE_WRITE to SWAPPER_*_FLAGS Date: Thu, 9 Mar 2023 14:52:40 +0000 Message-ID: <20230309145246.22787-13-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|AS8PR08MB6470:EE_|VI1EUR03FT023:EE_|DB5PR08MB10311:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ebbc0e8-baad-49a9-1667-08db20ae04b7 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: KHLpIekj/HU9EnN++XQ3H0jUHzPB5TOfwMeomPCTGXsneTBSFgYHlrTQFdGss4zH9IT7+wy5ADJkKXtqr76Pyp/6406S27UQEkA0lExeCldNArMvijw2cb+afG1e2b43sR2LW4AR+uZtptvtkFbJ3VcNIl80xy2qCK1UG8KISJjEca0cnpC6Jl5dx//nNFgc2VgRYyyoBeeeIAuZwzxIyCGL+UWfiVyNIQ9k0V6veuUUTfZtebL1jLDTMx6dPI6bScxIhsbGUO3Qde7G0AOT4De5fS4LEab+kNjaEkGfEFGQUsOMlpHP+ZVLR9fKLSgj0LBcYDjJx13LjuSvkN+yk0f1/DGiEoaICWlFSn9BINoCvmhtXsHYmgQSYjvuGb3RfHSu2QtX7jZ1sDUdWavpFNhG8UsUweb4mrdY3boq4MF5UCPBPK/uncwRxQAcEB3WcAOHpFnFBuN3iUtMcLZd3XrjNe08JMSwL8meRuyQ4bs73Lr9eSDe+4HGiWmwqwYarQe+uGYZJjdxpO41xW62TKn+bhwbruLUCZ9bcBC4+8FLvjeBqb27EwRvXZmR7MvCCynk/RlF7Jgl30yuTcel6SFrpJIYyknMYKv6sVymqIKK2gpzHlvJ3rErMyQm6Vvitk7WRXiQ1wWTmyBHmemXYlrp8BBgZFRLOy+0RpSs8UkEa5syMU8NLv7uhXX83tHh/eAaVsN0jChRc2sgLK7arQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(39860400002)(376002)(346002)(136003)(451199018)(46966006)(36840700001)(8936002)(36756003)(5660300002)(26005)(1076003)(4326008)(36860700001)(82740400003)(6666004)(81166007)(426003)(83380400001)(47076005)(82310400005)(336012)(186003)(2616005)(54906003)(40480700001)(86362001)(316002)(41300700001)(6916009)(8676002)(70586007)(356005)(7696005)(478600001)(70206006)(2906002)(44832011)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6470 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2d3882ff-dbce-4a9c-7fe6-08db20adfedd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hkkIvditZWc2qce8KTiXzj5nrrJt1ch733kCesoFio09pzLpUnmdcIWrzCda0AcWRPecjZTf4HhYqPh9Cu73Efynx51DmG72DgReS2IH3xBY0uiBCIAsR5AD3dgmMXqEBXllo889X+ucCO61VIhd/zyZuJO9pUJ/NW3pHs3szTy/HrcK3jHLxSdK0hGFM80dnzwGPuzyFZMT115wXwKXx/zgtCVAtYCGJrHNmMt/1D2vRE/NnK/OyrSg1vVSClDnuKQvziXlKYVSOmxerT+3XF+iGyd1ydfWv/kVpig4+Z1a+VC2Ahh8qOSHbmR2ZP7AnY/a2PcyM9vf60x8W8YbYyc92HHzxGJXNpBAkmsMbJVjGtim6Y3MF42UYtcu3XfRGFg9bK+miUf/0S+YU0Yhhf602N7kYo1wMiPLPOvC2rll89VkCfP098U4a8HIopK30cx6LqZlIO50xZ091m8nThBn9fUYAmk9YJZWyIrn1OUmnU+W1+O+3Z5jER2+i5SFWUPQehnvV0Ulxw7n9PDmKt64QxcoV19EkbVOqECG7CLF64tkVOJ6kiUCXNNn9VPm97hUyzrZfLomVPvayMbUi1Na4ND2Uyl/+sYtjc+5GbJkU5DKlk8Xq7nUHTH+cQruq+7DidxP7tL8gQ77t2dL16WKTy/mUqHVcGbgeBO/mzo6ebEKnCya2/OScpEorRfm95CNxcggT2qWYFkUFGczbg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199018)(36840700001)(46966006)(40470700004)(336012)(426003)(47076005)(54906003)(36756003)(40460700003)(86362001)(81166007)(82740400003)(36860700001)(26005)(1076003)(82310400005)(83380400001)(40480700001)(186003)(6666004)(2616005)(7696005)(107886003)(5660300002)(316002)(478600001)(4326008)(41300700001)(6916009)(70206006)(2906002)(8936002)(70586007)(8676002)(44832011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:17.7625 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ebbc0e8-baad-49a9-1667-08db20ae04b7 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: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10311 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065327_888198_C8FB8D05 X-CRM114-Status: GOOD ( 12.23 ) 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 With PIE enabled, the swapper PTEs would have a Permission Indirection Index (PIIndex) of 0. A PIIndex of 0 is not currently used by any other PTEs. To avoid using index 0 specifically for the swapper PTEs, mark them as PTE_UXN and PTE_WRITE, so that they map to a PAGE_KERNEL_EXEC equivalent. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland --- arch/arm64/include/asm/kernel-pgtable.h | 4 ++-- arch/arm64/kernel/head.S | 8 ++++---- arch/arm64/mm/proc.S | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/kernel-pgtable.h b/arch/arm64/include/asm/kernel-pgtable.h index fcd14197756f..daf1909116f6 100644 --- a/arch/arm64/include/asm/kernel-pgtable.h +++ b/arch/arm64/include/asm/kernel-pgtable.h @@ -104,8 +104,8 @@ /* * Initial memory map attributes. */ -#define SWAPPER_PTE_FLAGS (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED) -#define SWAPPER_PMD_FLAGS (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S) +#define SWAPPER_PTE_FLAGS (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED | PTE_UXN | PTE_WRITE) +#define SWAPPER_PMD_FLAGS (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S | PTE_UXN | PTE_WRITE) #ifdef CONFIG_ARM64_4K_PAGES #define SWAPPER_RW_MMUFLAGS (PMD_ATTRINDX(MT_NORMAL) | SWAPPER_PMD_FLAGS) diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index b98970907226..989e2132af14 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -382,7 +382,7 @@ SYM_FUNC_START_LOCAL(create_idmap) adrp x0, init_idmap_pg_dir adrp x3, _text adrp x6, _end + MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE - mov x7, SWAPPER_RX_MMUFLAGS + mov_q x7, SWAPPER_RX_MMUFLAGS map_memory x0, x1, x3, x6, x7, x3, IDMAP_PGD_ORDER, x10, x11, x12, x13, x14, EXTRA_SHIFT @@ -391,7 +391,7 @@ SYM_FUNC_START_LOCAL(create_idmap) adrp x2, init_pg_dir adrp x3, init_pg_end bic x4, x2, #SWAPPER_BLOCK_SIZE - 1 - mov x5, SWAPPER_RW_MMUFLAGS + mov_q x5, SWAPPER_RW_MMUFLAGS mov x6, #SWAPPER_BLOCK_SHIFT bl remap_region @@ -402,7 +402,7 @@ SYM_FUNC_START_LOCAL(create_idmap) bfi x22, x21, #0, #SWAPPER_BLOCK_SHIFT // remapped FDT address add x3, x2, #MAX_FDT_SIZE + SWAPPER_BLOCK_SIZE bic x4, x21, #SWAPPER_BLOCK_SIZE - 1 - mov x5, SWAPPER_RW_MMUFLAGS + mov_q x5, SWAPPER_RW_MMUFLAGS mov x6, #SWAPPER_BLOCK_SHIFT bl remap_region @@ -430,7 +430,7 @@ SYM_FUNC_START_LOCAL(create_kernel_mapping) adrp x3, _text // runtime __pa(_text) sub x6, x6, x3 // _end - _text add x6, x6, x5 // runtime __va(_end) - mov x7, SWAPPER_RW_MMUFLAGS + mov_q x7, SWAPPER_RW_MMUFLAGS map_memory x0, x1, x5, x6, x7, x3, (VA_BITS - PGDIR_SHIFT), x10, x11, x12, x13, x14 diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 91410f488090..644e8daa25df 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -290,7 +290,7 @@ SYM_TYPED_FUNC_START(idmap_kpti_install_ng_mappings) isb mov temp_pte, x5 - mov pte_flags, #KPTI_NG_PTE_FLAGS + mov_q pte_flags, KPTI_NG_PTE_FLAGS /* Everybody is enjoying the idmap, so we can rewrite swapper. */ /* PGD */ From patchwork Thu Mar 9 14:52:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167739 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 8B617C64EC4 for ; Thu, 9 Mar 2023 15:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pzIjHHdytBh77s8GAyMXotyh33lyzqN8KpEYWSrisW4=; b=LVTNzO2uGCR8ih nA7YE6IgdoZzisQ7q2tQoWyH4pzQbCqtIP2YRzTUK44/IVsDuVFNAS7vHgdNEZiPDD49w9K2KitCf mj++uDmpqZNQJRQC8c1Zt8TngzzMAFAWoEY3IMwSSEv93umoWrkCPW79U3k24eGEXNINxcpersZy3 Yti/EoQe1CKw8mqWNf0zv/KZpYe5u3J6/7hyMR9qFJ8ZE5Del5oOAAcu3GJYTRu+g6yNsB+cKge/V jWDO+Ijq0wb8GuOCzuB3qi5JmaQnNNRhwO0ATEAhuYQPxuvcJVpQa8diUjEU9mWP2NfMNoyNhvViL 0odh5tvLR6qIW8Mp4uvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paIAG-00AtPa-7x; Thu, 09 Mar 2023 15:26:45 +0000 Received: from mail-vi1eur04on0629.outbound.protection.outlook.com ([2a01:111:f400:fe0e::629] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHsX-00AnK3-6o for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 15:08:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=AdxNirSgKjzCOmWmOS7qysRM7g1snk/0R6G0jBYpmL4JRUs60Zvm5E5k2yC+9y+KO6luxH7fEuNwQyNEshzy6t169qgrM1GNWBHOYkkkY3yBg/9vFhx2uD/xpM5Q17BKAMPQmHEpPS93wWwqNUM2T7UgRvz+X1XVumH8KOae0/M= Received: from FR3P281CA0190.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a4::8) by AM9PR08MB5956.eurprd08.prod.outlook.com (2603:10a6:20b:2d4::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:16 +0000 Received: from VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a4:cafe::c7) by FR3P281CA0190.outlook.office365.com (2603:10a6:d10:a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT006.mail.protection.outlook.com (100.127.144.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:16 +0000 Received: ("Tessian outbound b29c0599cbc9:v135"); Thu, 09 Mar 2023 14:53:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 65133d3445b245ce X-CR-MTA-TID: 64aa7808 Received: from 27806b85681a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A7E44991-9090-4D70-B740-930B036B01FB.1; Thu, 09 Mar 2023 14:53:10 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 27806b85681a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QRvyyL2qkTS1vEumibx9wh6cGTc9L+HT+5NwtqewMa42GNNDZD4+kuOwf1b1Q5t9chcBPHf7RXQc245zKtYhbp0dvvw805R3D5ru0qMXPmu+PQxoDzuomL9Jj3uPOdO53UCln9jycJHRFrB9WDyrIpOtxbCtKHgFnzM01h3Jn5llxfepFXxtcukoWkInQwJTVPB6ihBrUoFs9zEaFhWc5AWFv4yHWG5ZgS3Vj/IwQFTMtTI2mbmVMB3aCZT3kSYhUMnn35ujFRg15vH4rxC5FVHkpV/CdgzV5jkouTcsOX7JQsYbx7cKhSUrJxDMP8Fp+LOVellfKq4xF463z6MfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=nxFfxq6hXTUdOYip89yGzoajxleQWZTcG0brDqtp2EgsVFCFJ6Of9mWb+/UROjhrJk7Iqq0tXK9pPlizcJiI2DuJfuucaC1iYIjsOYWM/uucD+/4xyc6ZkiQmG7zSP5yxD60iJnfGfalrmdXVo8YfWBIxY84rF/hXpN1iPg4hILgtIX/t7RyUm1qndUrQuxDWk+SR8nfekaMkmuU+eKz3H1Vsgf9tgc/VvrYu96DwV2NBs+PM01lO7Fz1gAW9WHPmfsBt/z0ZGJ9ZWJO3+itbUsGpyTmUZdZSSmA4esogCyBzNi+PiSfBsE0QCbid8k5644w1xaOPz3sRoc5ZibABA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WmjhleR1FfimV128whcEb1nmIXFY+jny4nxV+cecsL4=; b=AdxNirSgKjzCOmWmOS7qysRM7g1snk/0R6G0jBYpmL4JRUs60Zvm5E5k2yC+9y+KO6luxH7fEuNwQyNEshzy6t169qgrM1GNWBHOYkkkY3yBg/9vFhx2uD/xpM5Q17BKAMPQmHEpPS93wWwqNUM2T7UgRvz+X1XVumH8KOae0/M= Received: from AS9PR05CA0117.eurprd05.prod.outlook.com (2603:10a6:20b:498::33) by DU2PR08MB10280.eurprd08.prod.outlook.com (2603:10a6:10:491::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Thu, 9 Mar 2023 14:53:08 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::67) by AS9PR05CA0117.outlook.office365.com (2603:10a6:20b:498::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:55 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 13/18] arm64: add PTE_WRITE to PROT_SECT_NORMAL Date: Thu, 9 Mar 2023 14:52:41 +0000 Message-ID: <20230309145246.22787-14-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|DU2PR08MB10280:EE_|VI1EUR03FT006:EE_|AM9PR08MB5956:EE_ X-MS-Office365-Filtering-Correlation-Id: e7b2ceff-7ee4-4097-2fd7-08db20ae03d7 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: XqvQRfcXnQ5DvxuuL8lEvUJ22M/EGgPxMJ8+TDHM4n1NAQDoDZbvdux5GwTmnTV6fT1524vkOPzc3BVQ7uvqxBZkMorS9i0L+KMmMYQ2Vna207NCOZphsumVb1ROwaus2RWoEh2+CNbkDoDlAmUuRBUpPoCfaQSYrOWU8j2BSRXXrJrExFlc7oCsu7xkc/nOAeivcLSY79nfG68ln7G3b/v0UFQN/HadkurLVxQlylyyGZrHzkXlaL2bn1msqrKkwX4MHwB1foNI9HnRZ1yGs7Z9zuPJCcshlcmgirBdv1gIqGW49hgYwqlc2Pqj5Zpje6wLuDwveFUxFpM0O69WU1ngEP1NxO8lFqpkxbmMSv13/z3l3CMyigouqe0O9hIS+4zwYKdeh9hoyOiouJKtk3Y2pJBDmyQndNZFrn04BAIL2ZIvvkFcJHyq1oacqzMlPUKguMYm4ssExv6qcMmXqNu1TBv0ara3pm/8KWGyryXoDw9k0oWqws9Cug1EEvJHkb9qZhy+f/YLzVrzZdOVTCoSPEa03YF91Z3JPp7agZAcO8aULryEBFTVHs0tG2uD1Bx77r2OUq5EYM1lXrzYMCGm//JH3yqQ51V1rMWczID6MDbkgrYB6oaRB1UmtCwikiPnahjZmB0kvT6x/xaZMeTXO1XIysNJ0eWAOr6nAl2Tl+FSznLO0+RKClbKQP3L0s0dfH/hweV3tKUIkowK0g== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199018)(46966006)(36840700001)(83380400001)(36860700001)(47076005)(426003)(82310400005)(36756003)(478600001)(82740400003)(86362001)(5660300002)(2906002)(356005)(81166007)(40480700001)(8676002)(26005)(336012)(186003)(70206006)(1076003)(8936002)(6666004)(2616005)(4326008)(6916009)(70586007)(44832011)(7696005)(54906003)(316002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10280 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e0fce4af-8afe-4dae-b757-08db20adff16 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zVY7tXhO0EVF8CrrYd65Diu70/jxQgCKYSD3uRuFvl1zVJHe7+C4VOk4E7Dp7xnmEcVcAtcPW4oTT4t6k8+biymEgFEknJerPDcgO+HjMcYLhanS/elY2XBb4OqrT3MfBaUdDy63Yj0aXD5aLKFv0A2G/8Y1oKhs5rJtvt42m1jkaBA8FcdcR+jJJ6QeJLwLByjXMTJ8B/ZxFNfM/MLsf8l7NFnvRiT2PaQuIg2AX9ZC9qX1PS+kUtQjWgrya+2Tdx3Upq0xecUGE05529+7T3aa7jWNgEySq8Yvr55lAPXqlLTuBKnMUkyXnqGWo4z5ijKkfQyF4xzAU69Sp+DYhdBE1B5b5VwXRAEP1dhHfrLtc59cSUWVRrftom2vRzAmKyrZQK+OXSns7jCC2l92Bts8bjD5QeOrl0YsmP01E7XxLNXhagpBDgckTELW16wwVJxbphxAXW1rSXOJ3ojIrRzx6oEwslbkf6AclyLhGRTps8FvgqZNthThRS03lnZKLcbieela9RlxR0BYm1Vvz1goEcYiXoFiP5iBVeQVpBPVsiovhlnzg4DE5x/ChRf0C7aG087kzAmiMym/W/D7UIM3TL+HCRmU8QyWRjKdI/yShPtg6+8Kt+H35u0siwUkKfUCxbOwRS7xVnJXZzJrLcSQP5PmqyFxZ6keXJbhD32nEsit6C9PD65pOjMf3Zpo81DJ8aq900pLW/sFAngkIQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199018)(40470700004)(36840700001)(46966006)(478600001)(2906002)(81166007)(186003)(44832011)(2616005)(36860700001)(5660300002)(8936002)(82740400003)(1076003)(26005)(6916009)(107886003)(6666004)(70586007)(426003)(47076005)(70206006)(82310400005)(41300700001)(86362001)(316002)(54906003)(83380400001)(8676002)(4326008)(40460700003)(336012)(40480700001)(36756003)(7696005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:16.2639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7b2ceff-7ee4-4097-2fd7-08db20ae03d7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VI1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5956 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_070825_283939_F4F9A6A9 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: 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 With PIE enabled, PROT_SECT_NORMAL would map onto PAGE_KERNEL_RO. Add PTE_WRITE so that this maps onto PAGE_KERNEL, so that it is writable. Without PIE, this should enable DBM for PROT_SECT_NORMAL, which should be functionally equivalent. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/pgtable-prot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index 9b165117a454..d26d0b427c0a 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -60,7 +60,7 @@ extern bool arm64_use_ng_mappings; #define PROT_NORMAL_TAGGED (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_TAGGED)) #define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE)) -#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) +#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PTE_WRITE | PMD_ATTRINDX(MT_NORMAL)) #define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) From patchwork Thu Mar 9 14:52:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167716 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 523AFC64EC4 for ; Thu, 9 Mar 2023 15:08:41 +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=Z1sYg3dGwX0a/qNiM7yixIjtVv0m/ckeAoeaN8M2YM4=; b=Bt8s3BXHVTS90L d5eHnwUusVeIU0fUE/Nc4mcNLHgcTCiWso3Jx/B3SjRZKjT7OQ6jLxGIkB5HDT45WC3Nt2H3bRhKo ixfLa2VyakXekmAbjOC08QiOtbfyUo1W3H7QXkWsCnpvBcD+865qKZlsF8D96VXgVnWdznNX21nIX gz7asN2rtM2gytHnW7ZbcJiZrO6z1M3qvFw2FsmX7EoyDgFciory/2g/WSCqqbXGxK/Y9Sx+Wjvnb JwT3UdzoZc90S7IhcxYIUTFJNP5RO7TxarNzlI0t0Qe/59YmtPvgBA6iwgEqwxkuAE0N+AolYoZs1 z18azn7T5KTW4k4V+yYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHqy-00AmlH-Ba; Thu, 09 Mar 2023 15:06:52 +0000 Received: from mail-dbaeur03on20619.outbound.protection.outlook.com ([2a01:111:f400:fe1a::619] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHe0-00AhOT-NL for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:28 +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=wkMk6qDdip+Re7v++g8pFUjrDidVTs4aKldZlOw7650=; b=3Krq440DTiiO+bomZukr7HHwXf5L4cvB1DfFWXJe8DcIil3AuuuSj6jkYpiSgBgBhg5P/xEn5xIMP9AkSdNf1IOYY1zwvEpksC5UNcqqbSAt9HlV3mk/fr5HxdgsIlaaBDZNl4oMfgd4dTTELZnAJ6obMD9r8iB0X1iQdOLaRto= Received: from AS9PR04CA0149.eurprd04.prod.outlook.com (2603:10a6:20b:48a::22) by DU0PR08MB8664.eurprd08.prod.outlook.com (2603:10a6:10:400::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:53:20 +0000 Received: from VI1EUR03FT030.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48a:cafe::20) by AS9PR04CA0149.outlook.office365.com (2603:10a6:20b:48a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53: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 VI1EUR03FT030.mail.protection.outlook.com (100.127.144.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:19 +0000 Received: ("Tessian outbound c2bcb4c18c29:v135"); Thu, 09 Mar 2023 14:53:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6a55a74d6bcbccc9 X-CR-MTA-TID: 64aa7808 Received: from beea0b0e6dd2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50C237E5-E04D-4E9A-82A6-FB9C25BE5F60.1; Thu, 09 Mar 2023 14:53:13 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id beea0b0e6dd2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J6iofLUYW99TturaCHadrsRqwp9xQCSFI2VL5/s65aaYU8f+AUXUCZ31z1/A2UvvG47aNvN1Xw62YtTY230Mv0MoKwiqFmARyH7zXLxXXqHsGWFRS6TDxj83ZzK61urkVf6Kdl88bxiJBXeGU70CyIEyzzVtsSE/R1Pv1vmkQ8aTJTJ8/g497h6YjAWnDewS1ZYMkKxBruNkmO2EMctwrYEI0L2jlDszoZLGqAskF45tlYefm3UR6zYgOTMq5Vvm1v2miN93gnW8oaCFIKVwJh4ZH0xnm0BDii0DWTNkeTplpRZ0m/pI+eCleW1EaYQfjxmithy4b43hP0vayxGLrg== 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=wkMk6qDdip+Re7v++g8pFUjrDidVTs4aKldZlOw7650=; b=RtTSllW2LZbr7Ol/TrKX6CzNXrXTUs74RGJZV67IE8AaZvBbgU2FUCfoJd+ZQNKngWvrQLQ+9mO27/0rXfH6YZjqbdkHspTRaV5VpfuWr+5mzFvPmlB2vTAzKnARXF8DuuqhdV3p71RIh74HUgdQfg29GOJ8xnUepMM42KBKjOYTuRE8ppGL99HuWyyLl83m17A2WgNZj9CeCKMFTchUQtcDutAd50uP2su0lzYk4DgssFagooJ/4M4qgJGq/CSAXYbic8mLDJFgFo504/5s8keh2GUfPjjQoF6OdFhBEfj6UPpb515aYc2CSwaENEj1FR79h3EpH1UaOsN2yjELvA== 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=wkMk6qDdip+Re7v++g8pFUjrDidVTs4aKldZlOw7650=; b=3Krq440DTiiO+bomZukr7HHwXf5L4cvB1DfFWXJe8DcIil3AuuuSj6jkYpiSgBgBhg5P/xEn5xIMP9AkSdNf1IOYY1zwvEpksC5UNcqqbSAt9HlV3mk/fr5HxdgsIlaaBDZNl4oMfgd4dTTELZnAJ6obMD9r8iB0X1iQdOLaRto= Received: from AS9PR05CA0118.eurprd05.prod.outlook.com (2603:10a6:20b:498::7) by PAXPR08MB6480.eurprd08.prod.outlook.com (2603:10a6:102:155::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Thu, 9 Mar 2023 14:53:09 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::60) by AS9PR05CA0118.outlook.office365.com (2603:10a6:20b:498::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:08 +0000 Received: from AZ-NEU-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.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:55 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 14/18] arm64: reorganise PAGE_/PROT_ macros Date: Thu, 9 Mar 2023 14:52:42 +0000 Message-ID: <20230309145246.22787-15-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|PAXPR08MB6480:EE_|VI1EUR03FT030:EE_|DU0PR08MB8664:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e602695-107d-4957-e482-08db20ae05de 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: OmO1j5EPUf3oclFGFhVMSrZcqnNSZBs3vR+9O9mLvZH8L2gn6EaKZpTYvgU2c/6cpK7jOarvHEyDNYBG/w8YHRxtWpH0ZGKPkLnlKZcDkhSn0RKz6rTou0BoETWuHNGltnSjD5/ABgTJxOV1OPN8Z/1+sORUbQ72j0PPtz/AZYH7nmilrL6nCy0gO70SwMDqrXylIz0A0Rpyg2Hnj4C+M3fyJ+h/vC+qtSAtfEjPND0QRbb+RTO7ZFhxkW/7cPMO58NYAmORc526ywWtSpzOhNdmfMfPb3CboCmfwkg5D4XCl4h3isL7K8hDyclNZ4kX45BaeYyvwlkMCllc/xVIEFkIMj06V4H60skVkjter4uO+aq/igwL/Z6kEuC9J3s1oSq1pg9CnAR7vgPFWj3squLhYT9C1mv5hdj6QxQ684AWw8nj7KxgFfhquGwdDqx/WsNYVNV1UxFcJ/AX+VS4ULkmUCgGX3r0+AV2Ih54073XPem4Bh6q2GavY9RwgoBZFYv7woEtpDhj0vWKP6PkMhCkmKhZ4zpZS2BBvGMYfAT7R06Kvv+HJil+/tyKw+X2wQNjJKCX0xmLmIQMaToczH+9fyfbBTtSfQ4fPh7DSzJkUqoETA30llA7En5aN+ZhSD+AJaYQGpJaavInV5P05TTEKJxKm9ozadDB0e7AErZiQJGIV+X9dIpGMZsrSuxcOtokViJiaX515LkOrSnxRw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199018)(46966006)(36840700001)(36756003)(54906003)(316002)(478600001)(7696005)(5660300002)(8936002)(8676002)(2906002)(44832011)(70586007)(70206006)(4326008)(6916009)(41300700001)(81166007)(82740400003)(36860700001)(40480700001)(356005)(86362001)(186003)(2616005)(6666004)(1076003)(26005)(83380400001)(82310400005)(47076005)(336012)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6480 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ec074e50-c526-4c5d-c5e1-08db20adff67 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XVfGiSSVUiXNLVD96OtQtSf8WgehMI3G1JXI8f58f6rJqQMqhY3t9eSwXnsVQ9Tan6vOq1napFyl8nJXfn7+6OBhEMMKc2lr8UXCKx8hRTYZRXcUoJS/XfhXLBZHSd0qKlcQeFYJjnNK3oY4IL8jxCAw4hFxIssROECQFi7yOl+wxJTtVRQMl78U5qYB8lOgaQUSsN416pwz/bhIi+dWh/l/Hzlk7b3yogbsz1icvaXRxOkzUjRAB6vmXmPGRgmDtTGJnSbBf1UHOabd6cW5kuL9doBaGDVjY2qlcKxBMT6qLHxXNWvFSeCq2d2AYK+jsrvnyzlB38WhYio3RD5IwB6dgfvGD3Cbahsc3KWg2CJhkXhf6MzVbF/hNIqxaFbclULFURookuqUNw1bn28ZBG4dqfSn6l0RKJRr8NU3d9bdHMqVZqPupt8xz97hm6dpz4V8NmQgsA5J52sO2Kwc00QoromraJVf3azCaTzxH46Fnu6dBOrgmxfw1EN0s/QM/cnxjROeibJhvm/uMLibsuuV/7GCcrVg/5acv97kgohMfDIreRNDGn4ZIpTOvLnLurXTxE+1cbl9pz2r0lgKoYMGvj68sJTo3988M6Fsv73xYm0+jddEOQl091JzGh1fXPUb7KTJTapS1tEYAAb1+YeLVdDJMXtn6VBliPviTZF/MxVZRbVbvTeAzY7GNUXf1mJArOyH8pCFWOu0c850JA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(39860400002)(396003)(136003)(451199018)(40470700004)(46966006)(36840700001)(4326008)(8936002)(44832011)(36756003)(82740400003)(6916009)(41300700001)(36860700001)(70206006)(70586007)(8676002)(5660300002)(2906002)(81166007)(86362001)(54906003)(6666004)(7696005)(2616005)(107886003)(478600001)(1076003)(316002)(47076005)(82310400005)(83380400001)(40480700001)(426003)(26005)(186003)(336012)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:19.6855 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e602695-107d-4957-e482-08db20ae05de 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: VI1EUR03FT030.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8664 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065324_959971_00FC873F X-CRM114-Status: UNSURE ( 9.98 ) 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 Make these macros available to assembly code, so they can be re-used by the PIE initialisation code. This involves adding some extra macros, prepended with _ that are the raw values not `pgprot` values. A dummy value for PTE_MAYBE_NG is also provided, for use in assembly. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/pgtable-prot.h | 72 ++++++++++++++++----------- 1 file changed, 44 insertions(+), 28 deletions(-) diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index d26d0b427c0a..a45af0a22b25 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -27,6 +27,40 @@ */ #define PMD_PRESENT_INVALID (_AT(pteval_t, 1) << 59) /* only when !PMD_SECT_VALID */ +#define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED) +#define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S) + +#define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG) +#define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG) + +#define PROT_DEVICE_nGnRnE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRnE)) +#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRE)) +#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_NC)) +#define PROT_NORMAL (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL)) +#define PROT_NORMAL_TAGGED (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_TAGGED)) + +#define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE)) +#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PTE_WRITE | PMD_ATTRINDX(MT_NORMAL)) +#define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) + +#define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) + +#define _PAGE_KERNEL (PROT_NORMAL) +#define _PAGE_KERNEL_RO ((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY) +#define _PAGE_KERNEL_ROX ((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY) +#define _PAGE_KERNEL_EXEC (PROT_NORMAL & ~PTE_PXN) +#define _PAGE_KERNEL_EXEC_CONT ((PROT_NORMAL & ~PTE_PXN) | PTE_CONT) + +#define _PAGE_SHARED (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE) +#define _PAGE_SHARED_EXEC (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_WRITE) +#define _PAGE_READONLY (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN) +#define _PAGE_READONLY_EXEC (_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN) +#define _PAGE_EXECONLY (_PAGE_DEFAULT | PTE_RDONLY | PTE_NG | PTE_PXN) + +#ifdef __ASSEMBLY__ +#define PTE_MAYBE_NG 0 +#endif + #ifndef __ASSEMBLY__ #include @@ -34,9 +68,6 @@ extern bool arm64_use_ng_mappings; -#define _PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_SHARED) -#define _PROT_SECT_DEFAULT (PMD_TYPE_SECT | PMD_SECT_AF | PMD_SECT_S) - #define PTE_MAYBE_NG (arm64_use_ng_mappings ? PTE_NG : 0) #define PMD_MAYBE_NG (arm64_use_ng_mappings ? PMD_SECT_NG : 0) @@ -50,26 +81,11 @@ extern bool arm64_use_ng_mappings; #define PTE_MAYBE_GP 0 #endif -#define PROT_DEFAULT (_PROT_DEFAULT | PTE_MAYBE_NG) -#define PROT_SECT_DEFAULT (_PROT_SECT_DEFAULT | PMD_MAYBE_NG) - -#define PROT_DEVICE_nGnRnE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRnE)) -#define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_DEVICE_nGnRE)) -#define PROT_NORMAL_NC (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_NC)) -#define PROT_NORMAL (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL)) -#define PROT_NORMAL_TAGGED (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_WRITE | PTE_ATTRINDX(MT_NORMAL_TAGGED)) - -#define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE)) -#define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PTE_WRITE | PMD_ATTRINDX(MT_NORMAL)) -#define PROT_SECT_NORMAL_EXEC (PROT_SECT_DEFAULT | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) - -#define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) - -#define PAGE_KERNEL __pgprot(PROT_NORMAL) -#define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY) -#define PAGE_KERNEL_ROX __pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY) -#define PAGE_KERNEL_EXEC __pgprot(PROT_NORMAL & ~PTE_PXN) -#define PAGE_KERNEL_EXEC_CONT __pgprot((PROT_NORMAL & ~PTE_PXN) | PTE_CONT) +#define PAGE_KERNEL __pgprot(_PAGE_KERNEL) +#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL_RO) +#define PAGE_KERNEL_ROX __pgprot(_PAGE_KERNEL_ROX) +#define PAGE_KERNEL_EXEC __pgprot(_PAGE_KERNEL_EXEC) +#define PAGE_KERNEL_EXEC_CONT __pgprot(_PAGE_KERNEL_EXEC_CONT) #define PAGE_S2_MEMATTR(attr, has_fwb) \ ({ \ @@ -83,11 +99,11 @@ extern bool arm64_use_ng_mappings; #define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN) /* shared+writable pages are clean by default, hence PTE_RDONLY|PTE_WRITE */ -#define PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE) -#define PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_WRITE) -#define PAGE_READONLY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN | PTE_UXN) -#define PAGE_READONLY_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_RDONLY | PTE_NG | PTE_PXN) -#define PAGE_EXECONLY __pgprot(_PAGE_DEFAULT | PTE_RDONLY | PTE_NG | PTE_PXN) +#define PAGE_SHARED __pgprot(_PAGE_SHARED) +#define PAGE_SHARED_EXEC __pgprot(_PAGE_SHARED_EXEC) +#define PAGE_READONLY __pgprot(_PAGE_READONLY) +#define PAGE_READONLY_EXEC __pgprot(_PAGE_READONLY_EXEC) +#define PAGE_EXECONLY __pgprot(_PAGE_EXECONLY) #endif /* __ASSEMBLY__ */ From patchwork Thu Mar 9 14:52:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167715 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 D476BC61DA4 for ; Thu, 9 Mar 2023 15:07:23 +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=VDZlI/9q4etMS3hMKLAaAS55lBZsZ6Pf9W4xg5QyW3w=; b=y1LtZFIgVv8XEb +glXfCFPnm5+tFwo4ZJ6rH2vwQFQoHhNhvgaGwPnPk95df/37QgXM8JiaE3Svs2GY4lhlF4KEN3Xd DNeSG4dq4w0rYm9WoxdUlldy9obPSRX8GBzJaxZVlMD5YRWBV9l1f3hHJsEDTm7fL777WC6NK5zsC id240hRbIQAXcK15twpKtnfLIA4ogEdvhYsN85pg+ktVJFEMJDkbgyHBVzvuk9vA9Zq63ujG5BOBv WNDEyspf+JVirYoNxQ5C8fmB1TZZRZBlj0VV3I/RCzv8opnT4oSLqkOTiM7TZjttcLRnyezLGVMer r2zN5wCWgwjGQ03qXmZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHpt-00AmP9-Bf; Thu, 09 Mar 2023 15:05:44 +0000 Received: from mail-vi1eur05on20629.outbound.protection.outlook.com ([2a01:111:f400:7d00::629] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHe1-00AhOf-Ku for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:28 +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=2rQHObvCboxMOSIJ97dnwNJIUlqYa6uRE6IdVWhMg/Q=; b=nXYGnUvLVGwdHjCWvzkyzWaYjijjq6Seb5/35IpUA0HUg4l1xswb1SUTorjDt9vnIGe75bNFKAiTB7MsiyWFLisnu4rhudUciffn/v5Dve+kBg9W3S5/+PGu9XqqSeiJjyo/lNN3NCCSMJzIHu5XKEWzSvy0zFzagGVcwTFNgjk= Received: from ZR2P278CA0008.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::11) by AS8PR08MB9887.eurprd08.prod.outlook.com (2603:10a6:20b:5c0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:08 +0000 Received: from VI1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:910:50:cafe::86) by ZR2P278CA0008.outlook.office365.com (2603:10a6:910:50::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +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 VI1EUR03FT047.mail.protection.outlook.com (100.127.144.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:07 +0000 Received: ("Tessian outbound f2a8d6d66d12:v135"); Thu, 09 Mar 2023 14:53:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 463d0b54bd87ca05 X-CR-MTA-TID: 64aa7808 Received: from fa0729500e83.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F1684F7D-DFC2-4C09-BA97-CA982DDD984F.1; Thu, 09 Mar 2023 14:53:00 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fa0729500e83.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zy6tS6FBANWNM/A1KNNsqiqPPRcHXzOvsf+mg/qF3XOWRbZYgNWS+6MaQBPA4JWX+CI0VtmHCVkb/ng0139AJP6+/tw+82VXdiw/Qw5xtmtM/MJk76gi1TKFrOzRJ5ku8lcPPXDRGjo5h1U0Pf9/vFWhgMW9HWPiF1MDKOMetKAeFcX8V7FiS7JGUUxn7nIjwnBNJzVFkeAg8uzepiFWyCypfAVltY5SybgmZb5CEtOfp87wMnISGCykLiWSTOCTks3FOSorQwZ6fiimDdp2eEeVu4esWywbtqeePmjBR4zckxF/Rv+XI2fEW/749AKJZUJzK2Ddh8NfGYLz/IyU1g== 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=2rQHObvCboxMOSIJ97dnwNJIUlqYa6uRE6IdVWhMg/Q=; b=RVogZjRRQfFuYApIEw+ojpcSbArObrLoxvPAySKpGC2Jl41XxYw47OxS+PUVmqGjAJtcO1YCpw5mI+jSbZIuqhRzcc5EKdirjSG+5wXt43573dHo+PDlk2sR5Mh/zKBxEw15rL7kfQqvf01lKFC1ACFV+J9eeD9QB0UR3YURNGwaIWu1a6fbtRi+AnU0e6J3zTMoX4tmzdJdWqH47T2PD/lL03Ow+reAL8BrgP+XR1SIW93t66id2byyR1+3HeqCSpb+7ppoQufCADQ8oDXKI3j1zoTJvXB1A/BkRpcelbrleychGzW+BXn06gcFgT6a1x8ao1RwXglIT8HzC9KXOA== 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=2rQHObvCboxMOSIJ97dnwNJIUlqYa6uRE6IdVWhMg/Q=; b=nXYGnUvLVGwdHjCWvzkyzWaYjijjq6Seb5/35IpUA0HUg4l1xswb1SUTorjDt9vnIGe75bNFKAiTB7MsiyWFLisnu4rhudUciffn/v5Dve+kBg9W3S5/+PGu9XqqSeiJjyo/lNN3NCCSMJzIHu5XKEWzSvy0zFzagGVcwTFNgjk= Received: from AS8PR07CA0054.eurprd07.prod.outlook.com (2603:10a6:20b:459::32) by GV2PR08MB8001.eurprd08.prod.outlook.com (2603:10a6:150:a9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Thu, 9 Mar 2023 14:52:58 +0000 Received: from VI1EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::4e) by AS8PR07CA0054.outlook.office365.com (2603:10a6:20b:459::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:52:58 +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 VI1EUR03FT013.mail.protection.outlook.com (100.127.145.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:52:58 +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.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:56 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 15/18] arm64: disable EL2 traps for PIE Date: Thu, 9 Mar 2023 14:52:43 +0000 Message-ID: <20230309145246.22787-16-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT013:EE_|GV2PR08MB8001:EE_|VI1EUR03FT047:EE_|AS8PR08MB9887:EE_ X-MS-Office365-Filtering-Correlation-Id: 6aff633f-17bb-4e1d-17b1-08db20adfecb 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: 5mbsURH8B0VRY3wZNCXJ63tgTs+Ap9Fquzfp9Qd2+mKjntWnSCKCJ8kuIvqVWqEjIU2fhVC0d9OdZK7yfpNpPK+/ATxWmCjB+V4CNOmJB8B8eCX1m6edbWl5zIAskpKhn4ad4RqsDjlHGcfiogrbzauFfQT8old9d2Sz3JTMNG/26oQC5TWSZIXhzNNznl9NaVcNV8mDq5PnSdOGiSAepJ1TNzH9pULE5amR10kfWY/3EZBz8q34S0RJNuh3NLyBGBiJiYrH6xVJ7mVcmJPGAK3WsZMFpffxwmALSDCuJfVyDPtjxBC7aZ3sCvloNULuM9+ryMLiW+95BjSIfo1evBWxa3qhnzcI3qoo6h4bQx5bzu8Ia+P2SZA602toFn1SOzTbIA/ncaBMfq6jzReW/QwyHn1PZPOSzRY4VibltVTUH9ms1nBR8PEAomGRgqsJIjDyhiwPN44OzlszKb2Ps/D6Tx2RHHztxsLdtpX67ogbD2lwGVls2Mh/dC1YC2q/TdTNeSNqiXEkhrvPa8JnhSCR3ucu9HKT8ygC95e9m5bMJrP60wMvFGVZFlFbHcxIjMKKb/e+u1EFRTj2Vjj29jB+gl7BW8+FlZFy+OB3F86NCLM/gpDz5VPb+VJ/4jZYwtGouaMkFnVEDAqhno2d56TRVqeawaoVo3l39m8gQ0EUwrQ9aSWGbmmQ35ycYO264FiGJdFVInBm+G0Vd6VfMg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(396003)(346002)(136003)(376002)(451199018)(36840700001)(46966006)(36756003)(8936002)(8676002)(2906002)(41300700001)(4326008)(40480700001)(70206006)(5660300002)(70586007)(86362001)(82740400003)(81166007)(36860700001)(6916009)(356005)(478600001)(26005)(54906003)(6666004)(316002)(7696005)(19627235002)(44832011)(1076003)(82310400005)(83380400001)(336012)(426003)(47076005)(2616005)(186003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8001 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08f25d1b-87e4-41b8-8651-08db20adf915 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /tQ/fcNqNmX76mhjIm4hBesVVZBSDoLzDk3mMyHuJ0V/S9cepKEX/Xs5Bfw64MRCS1FsKXV5uNn9aI83h71ZYsTTb9HKu+BdA0Z966wkrLEkotVZIshkjGUJ9GwskXqb999MVkqtNT3qvZ+iMEavCtBXVBghE/BnUO9ge8JmI+cFRoCBqhxe3bMH+syofSX0YKxSBa1crFExvxSbr6Xoo6Rsz3oN+nkKsBdZgBuCKWK/at7zAybvb0BavH4Kb5DKgXs5cgm8sbOaf8ovIHXuDabDI7EAQXXwKUagUIJBw+XSgvp/KIT5qG19ZGju0d24Pn+M2IbVw4RJvoKy0qpQmObNljR1UmGPtIRDKnL/JeO8POcLVxkVWUChCN1OICAPAl8Nce/FJ+dUt1n08FAf2uRg0gKfJYBKxJeC4NBZFC7Q0H5phNXCJXBhIsJpfkNDWeCfGdtYZE0YYL56rI6PnYnnVgzooa7JnsCg/3zwUSzMIDpGN2b83iIn3FpCO8GqIfZe33p8W8wdQZJjjr2BlwX1AlqRYFkwuw9a29YFoPB9suxyHTNUg1K06sSE38E5xoBLfFtc0YeOsdX/8z8gZRMTbO7MvKqU10/Sj5EamgJzfF+sRoo8uDomkYLNsDVbQRCbt2Jl4jlSceEEJ4zbs1bvb6h/2/wMeHVy+CzHyLwD+CjYB5W/mIMvdTFizOtWKFzThHZMJ5eeYbCYfETsMQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199018)(40470700004)(36840700001)(46966006)(2616005)(8676002)(6666004)(107886003)(186003)(26005)(4326008)(6916009)(70586007)(70206006)(1076003)(336012)(426003)(19627235002)(81166007)(47076005)(82740400003)(40460700003)(2906002)(83380400001)(7696005)(36756003)(478600001)(316002)(36860700001)(41300700001)(40480700001)(44832011)(82310400005)(8936002)(54906003)(5660300002)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:07.8117 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6aff633f-17bb-4e1d-17b1-08db20adfecb 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: VI1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9887 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065325_750171_5D0B8CEC X-CRM114-Status: GOOD ( 10.55 ) 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 Disable trapping of TCR2_EL1 and PIRx_EL1 registers, so they can be accessed from by EL1. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Mark Brown --- arch/arm64/include/asm/el2_setup.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h index 037724b19c5c..6e6675fae194 100644 --- a/arch/arm64/include/asm/el2_setup.h +++ b/arch/arm64/include/asm/el2_setup.h @@ -22,6 +22,21 @@ isb .endm +.macro __init_el2_hcrx + mrs x1, id_aa64mmfr1_el1 + ubfx x0, x1, #ID_AA64MMFR1_EL1_HCX_SHIFT, 4 + cbz x0, .Lskip_hcrx_\@ + + mrs_s x1, SYS_ID_AA64MMFR2_EL1 + ubfx x0, x1, #ID_AA64MMFR3_EL1_TCRX_SHIFT, 4 + cbz x0, .Lskip_hcrx_\@ + + mrs_s x0, SYS_HCRX_EL2 + orr x0, x0, #HCRX_EL2_TCR2En + msr_s SYS_HCRX_EL2, x0 +.Lskip_hcrx_\@: +.endm + /* * Allow Non-secure EL1 and EL0 to access physical timer and counter. * This is not necessary for VHE, since the host kernel runs in EL2, @@ -150,12 +165,21 @@ mov x0, xzr mrs x1, id_aa64pfr1_el1 ubfx x1, x1, #ID_AA64PFR1_EL1_SME_SHIFT, #4 - cbz x1, .Lset_fgt_\@ + cbz x1, .Lset_pie_fgt_\@ /* Disable nVHE traps of TPIDR2 and SMPRI */ orr x0, x0, #HFGxTR_EL2_nSMPRI_EL1_MASK orr x0, x0, #HFGxTR_EL2_nTPIDR2_EL0_MASK +.Lset_pie_fgt_\@: + mrs_s x1, SYS_ID_AA64MMFR3_EL1 + ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4 + cbz x1, .Lset_fgt_\@ + + /* Disable trapping of PIR_EL1 / PIRE0_EL1 */ + orr x0, x0, #HFGxTR_EL2_nPIR_EL0_MASK + orr x0, x0, #HFGxTR_EL2_nPIREO_EL0_MASK + .Lset_fgt_\@: msr_s SYS_HFGRTR_EL2, x0 msr_s SYS_HFGWTR_EL2, x0 @@ -184,6 +208,7 @@ */ .macro init_el2_state __init_el2_sctlr + __init_el2_hcrx __init_el2_timers __init_el2_debug __init_el2_lor From patchwork Thu Mar 9 14:52:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167696 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 A9F72C61DA4 for ; Thu, 9 Mar 2023 15:03:15 +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=vyCkpPZ4RrzW3FAR0ZzV99fUtkcZ5ym5fUcLeJvMPR4=; b=jRVDlYGlj015Qz SSW8z43WInPjYkAGoAPRR7TdiKccpdWKtfk4kfR/oDdTqDmk38viu8e8Y0pQ/e++ppQ/ij7lNTPjU 0oiT9sCDBqpvJ7F7G2bzId2Oi7y696xaC8gc8BgTOAcxJ4+DXo9E0RBEbiW1eM75r+N4+hu4RMJ7s Mur0ZeLGZ7FPBaAdsQ3uYYHATpsnqSqFnYjTU5QZ8qq56bQy4u1y/cWGWL7Cl5w4TfTl6Wp9cwZGx T0f0p+RfN5Szv2w33vZWR4QPeZlwTX92P2BO5xrt10BeyYqFec82ODie1RjcaK4ciBPclBYSHTrEu LeOpR/SNdmXrjZrE1hGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHlj-00Akba-2Q; Thu, 09 Mar 2023 15:01:24 +0000 Received: from mail-db8eur05on2060f.outbound.protection.outlook.com ([2a01:111:f400:7e1a::60f] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHdz-00AhNx-JR for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:26 +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=oAy/9GQeS1ecDVZMmDRlpscUd1XhyeEq40SefYlWkBQ=; b=cOkXFea0C0rPdUrzI27dA3PtgDLnm4sZBI33W4GQDRx7ZrQfgD2H7EZTijTp5uQJSBd8mUWvvx83cMVStd+TrApDlYkqfeLwm1qM0px3XnHNuPQj9910kMH+h4mULpcuBSOoeFsQE3rTjcuqaF4sy1rek4o1iuSs52my28o+RLk= Received: from FR3P281CA0154.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::7) by PAVPR08MB9651.eurprd08.prod.outlook.com (2603:10a6:102:31b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 14:53:19 +0000 Received: from VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a2:cafe::84) by FR3P281CA0154.outlook.office365.com (2603:10a6:d10:a2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:53: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 VI1EUR03FT005.mail.protection.outlook.com (100.127.144.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:19 +0000 Received: ("Tessian outbound cfb430c87a1e:v135"); Thu, 09 Mar 2023 14:53:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a35f81f98426cef0 X-CR-MTA-TID: 64aa7808 Received: from 239d79c6ae89.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3EC5BD79-D5FE-4D68-8ECC-E8B9496C1931.1; Thu, 09 Mar 2023 14:53:12 +0000 Received: from EUR03-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 239d79c6ae89.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itMsE5/6+6KLkDYVw0d8glOt6RrVQZTLA3T8gHGcKbmU+oV7oHWs8hHxlTqFPBwq4a2+T369rXwXjeOCZABY3fadX7xZMloniibpm4+3OffpAw6r7J0xq4kFgaqKxkolxcKj9942y1jeJ2GbW4WkPut31H2FToprc4AoMnrr5ea3R7oxUgsGjL5xHmLK1UHp3qlYpDfIYbeqIHYHRpChNNoaehxUsrZlb1DI/5uguTq23ORposDMdO/kneuQDEWRfB2sr0hK1eI/AZIPCcbHDx/FlmSnsbkpdPG6t0db5NA6GXHix+r5b3fBFbBQEE42MdkYHpsj9LJ3FoN/Zr51Zg== 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=oAy/9GQeS1ecDVZMmDRlpscUd1XhyeEq40SefYlWkBQ=; b=HqKI2U7RUfAcy+DamC5Yz/BtcF3Wv5wUILfwsR6NO5rk4RgAQWQ/0SrJgSD+L6v69RD7N1wkN51TYxg452b9TOhApIRBYFIe2K16S6hdlQWxkJnqaO4uFcXvX9bI8uTs7ho7Vbw9KMFbk9eKzORqkTEYSRBUqrweSdgBCyC6YtbQByr4yBSTG8vD3W+6GLblRrpTiXrMvXlA1d6VRhs/hYE5vEeabi3qy5HyivpgZefRs6ThiDrXra9SUExx2LJY41Tvxv35s78SCqD7Z7fnoQ/0XEZHpqEJaa2azYHy0h+xKGVncMAnI3mW19FyXvTUbuF2bkBGm2SDiw0LUaR//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=oAy/9GQeS1ecDVZMmDRlpscUd1XhyeEq40SefYlWkBQ=; b=cOkXFea0C0rPdUrzI27dA3PtgDLnm4sZBI33W4GQDRx7ZrQfgD2H7EZTijTp5uQJSBd8mUWvvx83cMVStd+TrApDlYkqfeLwm1qM0px3XnHNuPQj9910kMH+h4mULpcuBSOoeFsQE3rTjcuqaF4sy1rek4o1iuSs52my28o+RLk= Received: from AS9PR05CA0106.eurprd05.prod.outlook.com (2603:10a6:20b:498::21) by GVXPR08MB7752.eurprd08.prod.outlook.com (2603:10a6:150:6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16; Thu, 9 Mar 2023 14:53:09 +0000 Received: from VI1EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:498:cafe::3) by AS9PR05CA0106.outlook.office365.com (2603:10a6:20b:498::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by VI1EUR03FT059.mail.protection.outlook.com (100.127.144.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:09 +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.17; Thu, 9 Mar 2023 14:52:56 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:56 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 16/18] arm64: add encodings of PIRx_ELx registers Date: Thu, 9 Mar 2023 14:52:44 +0000 Message-ID: <20230309145246.22787-17-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT059:EE_|GVXPR08MB7752:EE_|VI1EUR03FT005:EE_|PAVPR08MB9651:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b37b734-e092-479a-635e-08db20ae059d 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: zd3asMcYgjPZK5FHUt/iZPEVAR417u/vxgaY+8BjqknpAgpQkJKCL2+Vj7db2yemfEMb/7feWAS+Mu/F2d4AREPvCwFCHkoOzwJzTxbh0e5FAoIarIA61tqMCrmS7EcjBz52C/OdU1mmMUG84otSIbo8i/b6ojZzeXbkseyQsjto1F7Y+YdixRrWmkHvej8UcfA1ncC5KdYqZI5/4Gsy8SuXQEX5xU87OmkKnytMnB8AffRR5uFvmuMJk1xmZk6M5PlRdCD/OFTA/6cXFkyTj6v+sdvrbbD5B0LB6Cgp8EGgHRqQsgAsjF2lxL0SthnqFQdv/enbQI5/Dlb/NY3OYOZXqp4nZmYSWdJEEHLtj4mvhUH0hiO8WBG4jvtZh3LAk6gGFoCSQDbZGF2SYCCJk+LW70JM+1VtEhi5ZVZpLsNSI/sYgbxyOjoFcbk8i3+Cd5k21uG4WtBIJiYs+Ahl7AeWWevs1Au2ZNXpxShQjTMKq9TdsxFAJ4NqeM3DvMro1x4thO/XMG1nl5stDvKCCXjMQ9TjD0wwsnBmMQIakKG9DQJq3kHRozUxoHbfwSsj9Et0HGm66vm7D9jFk3X0cigcIMsJdhOwNbsUKP13p67s2ywghnCFutQ3eAgT/UcpzQvJugduHJ195jA1nuqbO3uwYia7MsrzbrURyUbPp9QvCivT40bArqBnAgyZDo9Co2JNgaI+nExnm/n06ky4uw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199018)(46966006)(36840700001)(82310400005)(70206006)(54906003)(70586007)(26005)(1076003)(8676002)(316002)(6916009)(5660300002)(336012)(8936002)(36860700001)(6666004)(478600001)(44832011)(36756003)(2906002)(86362001)(426003)(82740400003)(47076005)(81166007)(7696005)(356005)(83380400001)(40480700001)(2616005)(4326008)(41300700001)(186003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7752 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c38bb41a-e929-413a-868f-08db20adffaa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Bpm9/KTrd+lWgxtsURatvdHKXUAStSCgvEmjEigdW/TtmsS3d2ivzrW4YcjAqpKjoG70cS1tyzzc8K3cFWlWEbw13kKAmoAWC8cXygPzpOvHC/CMwBVtNAPhiz2rOmmbX73AygjxfgHJu0A7j9o1ULxajtINxVQlwl657h/3S5EEmcMg4iNokAngsOSW2rXcsaWwUfmnd2duI5p7mztD0wdAq6bRA4GhJwwzrK7VG9JPzdj2Yl+DIUTjHm4zHEv7WFKCCu0hRPXcqtBjY9hdVBHwmUYbw4/jq+fGisVXXpFPi2Ny/0rVs1nuzjQDM7ii3U7yJogSo7X4AyptJ8/zEPp0n3IGKUiKsH4mt7CNFHqprGDgECnYAxReUUqPEseWoCBd+V/5c74aZRKba/BxG5L9IaJVq0D6F6jwZnKzENz2yQwdOXDvDfkvqTp06QNAEwzCYGujpRxgHvyqZ/CVl1Dq8QQYC9o4ysUvFCarr3IOIMOcvSs8lg+h4aFzazUiWbO23cDl/tjrcuskZUeVA0iDMRTu7h5zi4KmesSBOejRc78Wr9vVoOMzaD//McsFn22v9kWHRLcX9ddCHajV3vMlmlfA3zFucbW8UOqM4wfJc0lRTbmeGIls/ApYb8gBxkUXbm54MR8nHp3vp/XJyYXnmD6QyZmIOvAuuzvN+e3AaHeZMw4wLZIhiFikF+eiPU/aJGenw4fqi3rwdmwAg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199018)(40470700004)(36840700001)(46966006)(44832011)(478600001)(82310400005)(5660300002)(186003)(83380400001)(6666004)(107886003)(26005)(40480700001)(1076003)(336012)(47076005)(426003)(86362001)(2616005)(40460700003)(36756003)(36860700001)(7696005)(2906002)(316002)(41300700001)(8676002)(6916009)(81166007)(70206006)(70586007)(4326008)(82740400003)(54906003)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:19.2562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b37b734-e092-479a-635e-08db20ae059d 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: VI1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9651 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065323_727684_E9D713D9 X-CRM114-Status: GOOD ( 11.09 ) 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 The encodings used in the permission indirection registers means that the values that Linux puts in the PTEs do not need to be changed. The E0 values are replicated in E1, with the execute permissions removed. This is needed as the futex operations access user mappings with privileged loads/stores. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/pgtable-hwdef.h | 8 ++++++++ arch/arm64/include/asm/pgtable-prot.h | 18 ++++++++++++++++++ arch/arm64/include/asm/pgtable.h | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/arch/arm64/include/asm/pgtable-hwdef.h b/arch/arm64/include/asm/pgtable-hwdef.h index f658aafc47df..11c81e700335 100644 --- a/arch/arm64/include/asm/pgtable-hwdef.h +++ b/arch/arm64/include/asm/pgtable-hwdef.h @@ -170,6 +170,14 @@ #define PTE_ATTRINDX(t) (_AT(pteval_t, (t)) << 2) #define PTE_ATTRINDX_MASK (_AT(pteval_t, 7) << 2) +/* + * PIIndex[3:0] encoding (Permission Indirection Extension) + */ +#define PTE_PI_IDX_0 6 +#define PTE_PI_IDX_1 51 +#define PTE_PI_IDX_2 53 +#define PTE_PI_IDX_3 54 + /* * Memory Attribute override for Stage-2 (MemAttr[3:0]) */ diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h index a45af0a22b25..2b192da1ef9d 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -107,4 +107,22 @@ extern bool arm64_use_ng_mappings; #endif /* __ASSEMBLY__ */ +#define PIE_E0 ( \ + PIRx_ELx_PERMIDX(PIE_X_O, pte_pi_index(_PAGE_EXECONLY)) | \ + PIRx_ELx_PERMIDX(PIE_RX, pte_pi_index(_PAGE_READONLY_EXEC)) | \ + PIRx_ELx_PERMIDX(PIE_RWX, pte_pi_index(_PAGE_SHARED_EXEC)) | \ + PIRx_ELx_PERMIDX(PIE_R, pte_pi_index(_PAGE_READONLY)) | \ + PIRx_ELx_PERMIDX(PIE_RW, pte_pi_index(_PAGE_SHARED))) + +#define PIE_E1 ( \ + PIRx_ELx_PERMIDX(PIE_NONE_O, pte_pi_index(_PAGE_EXECONLY)) | \ + PIRx_ELx_PERMIDX(PIE_R, pte_pi_index(_PAGE_READONLY_EXEC)) | \ + PIRx_ELx_PERMIDX(PIE_RW, pte_pi_index(_PAGE_SHARED_EXEC)) | \ + PIRx_ELx_PERMIDX(PIE_R, pte_pi_index(_PAGE_READONLY)) | \ + PIRx_ELx_PERMIDX(PIE_RW, pte_pi_index(_PAGE_SHARED)) | \ + PIRx_ELx_PERMIDX(PIE_RX, pte_pi_index(_PAGE_KERNEL_ROX)) | \ + PIRx_ELx_PERMIDX(PIE_RWX, pte_pi_index(_PAGE_KERNEL_EXEC)) | \ + PIRx_ELx_PERMIDX(PIE_R, pte_pi_index(_PAGE_KERNEL_RO)) | \ + PIRx_ELx_PERMIDX(PIE_RW, pte_pi_index(_PAGE_KERNEL))) + #endif /* __ASM_PGTABLE_PROT_H */ diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index b6ba466e2e8a..b31d39f22803 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -26,6 +26,12 @@ #define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) +#define pte_pi_index(pte) ( \ + ((pte & BIT(PTE_PI_IDX_3)) >> (PTE_PI_IDX_3 - 3)) | \ + ((pte & BIT(PTE_PI_IDX_2)) >> (PTE_PI_IDX_2 - 2)) | \ + ((pte & BIT(PTE_PI_IDX_1)) >> (PTE_PI_IDX_1 - 1)) | \ + ((pte & BIT(PTE_PI_IDX_0)) >> (PTE_PI_IDX_0 - 0))) + #ifndef __ASSEMBLY__ #include From patchwork Thu Mar 9 14:52:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167714 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 02F28C61DA4 for ; Thu, 9 Mar 2023 15:05:59 +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=bBfWuM/h0WqsvtWSNk4g5MLgzg9Omv/4t4tG6irRNOA=; b=gz5axX16S2VK9c IdcNlzLVIfYkl//9f3a+OslKTbSqBhT3WsxX1LjEBlaTq4SpGs3+3whn0sAJZ2gWLMIUTDXE9Kyyf hnI86kcGaeMmuU7wLyDF8yGXe2TwLuGUkY1OE4gwUA+8BcGSaCYJ/bqYMEpBTCqQuV4AXQvczyRPA IapBskPALEfbme0bK5r5NQ3SryytomTyg3zG4PN2HlbupJYHlULqNoUhD+RAYAKnO88uGd5IiN2C8 AbWd6UYv2/QBcvYnTrNj0EntVJBv2ogP/YjnFWiux/X8QeVU8kNRPjsjnqoTrY63buaepI5VQyV9x oFxN+mGOMYHQ9cbDlDcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHoR-00AlZa-4k; Thu, 09 Mar 2023 15:04:13 +0000 Received: from mail-he1eur04on0604.outbound.protection.outlook.com ([2a01:111:f400:fe0d::604] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHe4-00AhRB-Mt for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:30 +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=cPm9V/BgkIcnlBOldXtYcxFlXb656/rgWGVkGjd32E4=; b=sAuhz8Z6Xfvn8CysdeLN44Uf9CncDzk9Aw7NXjSOZha3M4HkQvlCxErV1OH45kkXtZuSUpSl4VzEXbopZEyTNyLmSnxHL1JEOF2wps2IrqBplveBujJSHWGxOcucm0/DtkDVml6/Q46+kcCewQmXgUT491ZskL1jRbqW9PzjKCQ= Received: from AM6P193CA0124.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::29) by DB9PR08MB7472.eurprd08.prod.outlook.com (2603:10a6:10:36c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Thu, 9 Mar 2023 14:53:24 +0000 Received: from VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::bb) by AM6P193CA0124.outlook.office365.com (2603:10a6:209:85::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:24 +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 VI1EUR03FT023.mail.protection.outlook.com (100.127.144.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:24 +0000 Received: ("Tessian outbound fcd8b5fba459:v135"); Thu, 09 Mar 2023 14:53:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4a722604b74b6ab4 X-CR-MTA-TID: 64aa7808 Received: from dbe0ca4c516d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B1BFD5E9-57DA-43D0-A17A-87CE85D76939.1; Thu, 09 Mar 2023 14:53:15 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dbe0ca4c516d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gYeyiA5BvfrFy/mslFjPLlPK6wToF2zHwh0ynqbii+hFWziowOSEFT/HGz8L54Bu6p3G+PA4kv8YfyUIPksiWlKro394WT8/vP4DV72BZIMDZ8iox6TE6VWgrbeIqQLlAiXU4gZeg0dbP94nvfZckUr8petygNFgvMfeklI8WRbDPA2MSpWUWOBiM3GcIMz73eq6j0Bp4rxyh+XeMf3NYbFPrIs5mXbx5r3UGPSBmAEQdoQANBhPfqgOg6ddK7AvfdFSemRB8v1eM2jLdnNp0gtmmsMhcI62yZjb/QJm/N876sXyVQH5eqiNtG7XNTued953pbSwhqYyxzmAX8T9Mg== 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=cPm9V/BgkIcnlBOldXtYcxFlXb656/rgWGVkGjd32E4=; b=TcCebVuKhc0sXUeB3uQs9qsUSuSWx0CQiu4HhnOGnQTwXIJWQy/ax+8EB5NpL35/sB6rR/YbPoe4vOYukYzezms0wDExYxfTXkp4FMqggqgcRoM1l6U+Naom+sMmwNKJgegKVTJhqCaseGYuabmPSD6E4Mwf21ni2EEa4P2x2iuw/fEusR6+/lQZZQQJTp+CHQDmonnmqsKiAtDwwikarQAT+BU8RD51GyOhK+DzX/wuiiw5EqgBcSQIlHIqJIPzdDIa7eYhc9JEQoetG6kG9EiHRZGy1wTWaD+bjTjUg4t3Xu1JpVM2gxjRECQ6KyqOacNL0/CpNHoLwll8AnWLiw== 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=cPm9V/BgkIcnlBOldXtYcxFlXb656/rgWGVkGjd32E4=; b=sAuhz8Z6Xfvn8CysdeLN44Uf9CncDzk9Aw7NXjSOZha3M4HkQvlCxErV1OH45kkXtZuSUpSl4VzEXbopZEyTNyLmSnxHL1JEOF2wps2IrqBplveBujJSHWGxOcucm0/DtkDVml6/Q46+kcCewQmXgUT491ZskL1jRbqW9PzjKCQ= Received: from FR3P281CA0113.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::12) by GV1PR08MB10369.eurprd08.prod.outlook.com (2603:10a6:150:a6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Thu, 9 Mar 2023 14:53:10 +0000 Received: from VI1EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a3:cafe::31) by FR3P281CA0113.outlook.office365.com (2603:10a6:d10:a3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:53:10 +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 VI1EUR03FT041.mail.protection.outlook.com (100.127.145.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:09 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:57 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 9 Mar 2023 14:52:57 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:57 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 17/18] arm64: enable Permission Indirection Extension (PIE) Date: Thu, 9 Mar 2023 14:52:45 +0000 Message-ID: <20230309145246.22787-18-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT041:EE_|GV1PR08MB10369:EE_|VI1EUR03FT023:EE_|DB9PR08MB7472:EE_ X-MS-Office365-Filtering-Correlation-Id: e170b2b3-9b3e-4d4f-12a1-08db20ae0873 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: xnk4EN1FTYMSPcroqu0Vb122DkwK/OhLouvz7ribULVzwehjw8sPHluFxCz0UAQWRV/vERQPcb43tqKUXlu75U3AXw4k5tNBRGAeyPAYlJ/XiOwfQsz3Q+HvggK8PRK3idciKm5cupfmzzODLSiA3U8CcPt7kmTqzQXjIQi1Xg7TXrzCdmu9HLc71wvSXXDyDS4y5mE0i2Lg1bEXBRDO/LV7PdWVfZf2J99h97ocAU8WDWVcTCqDS7WOR/i3b4/dh6QykSBOROIXwtNEzW97dE/S162zV7d9noSgcbZJkusdh3y7ESEAxl4IbudgmsRq8skEDr5Mc6mMvpqljwAdVbLWVfyxmtYiwVoMcfF8JZNf4kE7NpiKUbHMSlBGo5KihG9y3Ks9GLB5aRGanUNyBZOjy4Ge0sKhxmrWGaFahWB3Pq7BovWfWmRzZuC+8ObiMaK9GgvulvfYH30tVNP9t4/RUeOO4a0W3ePwTuUKLSd72u4tInbxTdsOjwendmGKkWuwHLEg/tH+OBCUsAOgcHT3SCsmxRw41tZnYW4ZTE31XGZMu/OJj1CJKp3uN+9jqLDfB8YK2IiRMtrY+Z7rkpyFMIjR3arMBgg3hSRxw1fhyTHK+Hm8cOY3FwqPTA77fWHNXVTRecxk2IFs2OsKBb6ygnzv1B0+1pkNXVP2znVwEu2UfmYq8SGzTHF+v0kcJa/JBe3x0oLhYvCj9Vdwjg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(346002)(39860400002)(376002)(451199018)(46966006)(36840700001)(186003)(2906002)(44832011)(6666004)(356005)(41300700001)(4326008)(36860700001)(70206006)(8676002)(6916009)(5660300002)(70586007)(8936002)(4744005)(2616005)(81166007)(426003)(47076005)(1076003)(82740400003)(478600001)(7696005)(26005)(36756003)(86362001)(54906003)(40480700001)(82310400005)(316002)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10369 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3f0899e1-f83a-482c-12e1-08db20ae000d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4CiIvigZkfxn1UMjRc9KzeIWW+yUFDzGwTYMOVOF2xyphx1I52UFIvhUXJaFq8sbQ7ytyIIM/iNgxJKojkmSHVX2OYGFzm5kvMhqxMwThrdbR/0d2LNbKDwlDDQJXXSXl2wg92OBSyh5srfkpgVFjVDnmbh1u7nkwuOh4Yzt12vxD2VqdbOV57a8cXSMBDJJnzyfEV4W9zEZUnT95GmPHDv0D0n+uENay5R5eK+r7ZLQWqT1OMZkyGTuw+JYUzwYot/4hzwonyvppo55dyrMQIPAC01Gpcrgm0TLqOBTrWe8q5MKhtBm5vyG5ArbtxkBwyJFxcOzla63Rn9lE3NIYQ/3sVyYoHTVm678E8BXpy+ByzBFTVdWz6BFTbFK3RIL46AGA8DTqbHu09v50E7doYz8QIDrRmUNy6xP9el02kW4aWxcTQfNYpnzrFV2DURZiRiAVMQr8g+bA9ueLtnfmEANxHaIy550eGK9DFs0E3sSBA8tAaC98J2+YCOGBYVwzbeTsSJMHAu0EZsln+t7NVNHeePl/0bjNPHQWo9Y4wyR0y49160a4XbQZASsyelfYEYsQnAv89IJPniSQW3BVTxRic2+nt2LsHOrL7tTPYEG+uRDbeyR3d8PJZqIlWYSQ6Od0val4H/pfRgp7uaj0M/KdQafL1M7jsPTL1219tskaNOPa7RkXQzLtC9V13zCWPlJu0n+Whqri8GR07J3Cw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(4744005)(44832011)(5660300002)(8936002)(2906002)(41300700001)(6666004)(70206006)(8676002)(4326008)(6916009)(70586007)(316002)(54906003)(40460700003)(107886003)(478600001)(7696005)(1076003)(47076005)(426003)(82310400005)(81166007)(40480700001)(86362001)(186003)(336012)(26005)(2616005)(36756003)(82740400003)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:24.0277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e170b2b3-9b3e-4d4f-12a1-08db20ae0873 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: VI1EUR03FT023.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7472 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065328_792135_23D1F258 X-CRM114-Status: UNSURE ( 8.36 ) 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 Now that the necessary changes have been made, set the Permission Indirection registers and enable the Permission Indirection Extension. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Catalin Marinas --- arch/arm64/mm/proc.S | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 644e8daa25df..5734f077dd46 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -454,6 +454,21 @@ SYM_FUNC_START(__cpu_setup) #endif /* CONFIG_ARM64_HW_AFDBM */ msr mair_el1, mair msr tcr_el1, tcr + + mrs_s x1, SYS_ID_AA64MMFR3_EL1 + ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4 + cbz x1, .Lskip_indirection + + mov_q x0, PIE_E0 + msr REG_PIRE0_EL1, x0 + mov_q x0, PIE_E1 + msr REG_PIR_EL1, x0 + + mov x0, TCR2_ELx_PIE + msr REG_TCR2_EL1, x0 + +.Lskip_indirection: + /* * Prepare SCTLR */ From patchwork Thu Mar 9 14:52:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13167719 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 C4C95C61DA4 for ; Thu, 9 Mar 2023 15:11:02 +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=CiGYU+UI+tOUMnZ1TRI8HcfGrRwWNfF7SrEx6OGPQIs=; b=awTrFZnglPzxRk WDAoPPSLh0ceAY0rPsJVe/unqnEuTGSHHCpEn5jTEfYvLe94CQFZ8ijZNl6KcapHSJL8aZ7e/KJN7 MuMulcpRP8X7LtqQ+6Y+4z+15ixtapn6xkAdcKpiuydD8KHxGZOrUT0kRvd70xIAe8cL1f8O63IdP mXXGjXiZ9nqhyjh4Vb8olmHU7/Mx4RvW7P5g1hIFJ5sGPsA60ApkEpLjTytMNXPmxWfRR+PcWRghO K7Vdoc8nkGe3JOSMtWNvHdqGmjeO+k4HkQORxaqsC5kufr79LD2GwaeacPR9WXyyVcOwcllgJUnmc GO9ts22ag+2cLhYDHZDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHtV-00Ane8-U5; Thu, 09 Mar 2023 15:09:27 +0000 Received: from mail-vi1eur05on20609.outbound.protection.outlook.com ([2a01:111:f400:7d00::609] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paHeB-00AhU6-F5 for linux-arm-kernel@lists.infradead.org; Thu, 09 Mar 2023 14:53:37 +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=d2gjcWXP1QO4l3VC9y9y41Nu8HtrnwxfjxuYT4me9WY=; b=2M5xKBhoi+3w5i7kRzMOwFmu6PdQukMHQ69Fw7YYLIOrY6m6Jys5dIjR5IcgJwH8TRwTAYrBvr5ZXfCRF2Yw74J64PMTtrCENvDhmnaXv4eb1WhMbzQvn4fMcqtWKauraea4x7q1ZwA8wsClgqeQJ4b2fGKaghUKuf4O4gCGJmQ= Received: from AM6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:20b:6e::17) by GV1PR08MB9940.eurprd08.prod.outlook.com (2603:10a6:150:3d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18; Thu, 9 Mar 2023 14:53:21 +0000 Received: from VI1EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:6e:cafe::b4) by AM6PR02CA0004.outlook.office365.com (2603:10a6:20b:6e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.18 via Frontend Transport; Thu, 9 Mar 2023 14:53:20 +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 VI1EUR03FT009.mail.protection.outlook.com (100.127.144.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:20 +0000 Received: ("Tessian outbound c2bcb4c18c29:v135"); Thu, 09 Mar 2023 14:53:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6813471086eb9276 X-CR-MTA-TID: 64aa7808 Received: from 68fcc66b6404.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 50D78FD4-74DC-484D-8911-2F2F41FF998C.1; Thu, 09 Mar 2023 14:53:14 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 68fcc66b6404.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Mar 2023 14:53:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WrKxUSLOA44SNC0TbLDzuaF8AEUSKoRjPrcQz6/an29LryxlvolTT1QTtYXyRBJmliC7U8afLQ4tHLBu/QsAxXkSRd6G6eEAeZ1vJ9temzz2TF5gOBcXujRNqJvg52gvThPAPSHBm56G6OPOX8dL5q+t4vSx8PWxRoM/NZp/spE5bjs3R5mqCMbtfjEY/v81v3MchPseaYuoZRQq3AYGxf/i27X61w8th/wycZ/4xMYoxQmdFVe+JDooyDmjr7TUzQ1uUbK62kdZRSlb9eSPCneTIVxPX363lVUwou6q2TyvFVU6hdRi5MuXlkJOQiRHdQVPjpjZ1ZSPnwGzjMepQA== 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=d2gjcWXP1QO4l3VC9y9y41Nu8HtrnwxfjxuYT4me9WY=; b=LneU2A+4BsCP13px89eK4pFUMVP6dW0JbXTKe7W1XXbTyiKMg08fqiuaBvFKG+R8Me9nQitnXyaKN9fGPg5BMNiQ5Ts+2r3S9yZEpRK7aezVcrumnr7VYuCzE60UKTXB864jexvnfUCa9Foz2Pq8CWhzeV0Qm6T9v9aXqWa2KoQp3jl70lgvXkF1qrcz1v0qrSkNyfMpDSXAiL9NeA8p70qYVQSiw5b4H4b91fYoK38b7JQmStpm014YTccTaeWJbT89yRiRRerHfxEOHVlsAdODR9RziKiD3ONUGB6K5Lp7GKZp8sdhsgosOqpRF6yBLV5ew8Khnhs+zDQky7gPoQ== 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=d2gjcWXP1QO4l3VC9y9y41Nu8HtrnwxfjxuYT4me9WY=; b=2M5xKBhoi+3w5i7kRzMOwFmu6PdQukMHQ69Fw7YYLIOrY6m6Jys5dIjR5IcgJwH8TRwTAYrBvr5ZXfCRF2Yw74J64PMTtrCENvDhmnaXv4eb1WhMbzQvn4fMcqtWKauraea4x7q1ZwA8wsClgqeQJ4b2fGKaghUKuf4O4gCGJmQ= Received: from FR3P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a3::9) by DB3PR08MB10336.eurprd08.prod.outlook.com (2603:10a6:10:43b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16; Thu, 9 Mar 2023 14:53:10 +0000 Received: from VI1EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a3:cafe::66) by FR3P281CA0109.outlook.office365.com (2603:10a6:d10:a3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17 via Frontend Transport; Thu, 9 Mar 2023 14:53:10 +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 VI1EUR03FT041.mail.protection.outlook.com (100.127.145.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.19 via Frontend Transport; Thu, 9 Mar 2023 14:53:10 +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.17; Thu, 9 Mar 2023 14:52:57 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 9 Mar 2023 14:52:57 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v1 18/18] arm64: transfer permission indirection settings to EL2 Date: Thu, 9 Mar 2023 14:52:46 +0000 Message-ID: <20230309145246.22787-19-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230309145246.22787-1-joey.gouly@arm.com> References: <20230309145246.22787-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT041:EE_|DB3PR08MB10336:EE_|VI1EUR03FT009:EE_|GV1PR08MB9940:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b112a69-db0a-4974-8a60-08db20ae068e 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: hI9pKa7kJdtBtC13KLJMLmp76irl15AGmVMMzj1xwRO8M1Gyf7FPQ1EK354IIuYrnvlwR4n3xoCwhes70M/4fbssF9KtDI1I+mKW+5gLt7qR+hWpQDrWIGa1uHjmz5hzbk69dZsebvsg+rVFjGcesw6HMtIt/NZbWnJJX+ujs6CaPYWnGWpMU5qTtkgliKKWbO3Mp5l5McMtgVm1gB15DO2OZ81DSTbOoPWqjKBFk3HWxfxl7a9Qbvk1yViMxIEsMWRF3XS762MpAh98SH/EIsvuXZ0Btq9t2VzjRZEH2ymr2DtkFybx1EG5BHPSavoGgAB7HaAOElNO+GRyFJTaVBXkIk+Scjo+oUxxkJ9YxI/vO7JAyynNN/ZwgsH0zeSY0aA6ho1DJo/xA77vgQ/KRWGmaqojaW/jQ7EBsyYzWO39zk0ygWwVMF92F9tvDKwbYUYNmKHcEMa5hijC8/UFIrzFXeBeHxqyh+1AgO6f0Sj2vPSz9xN0YhtKzxIX10JRzWatSy846YzJPGsEAHgemcr97GVMMC2YtJMZuIG82W1MdR9oYDhK0ybl+Bg1bYWWgl2Vie1X9yHiSqTIJgPprTE0L158TiM3Q0IiRXScp0NLpTwlEN8kqDNyXWJZhD3sGTNARUx5IpAo3moBUDzyBfU9CDQbu0HRVDwjy+ha5THP6nDwBafVH1lbEpGA3utTPR/fUZW2VQJJkLdIl21I+A== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(136003)(346002)(376002)(396003)(39860400002)(451199018)(36840700001)(46966006)(5660300002)(81166007)(6666004)(70206006)(6916009)(4326008)(8676002)(70586007)(41300700001)(336012)(54906003)(82310400005)(7696005)(40480700001)(2616005)(316002)(86362001)(478600001)(356005)(36756003)(8936002)(36860700001)(2906002)(186003)(426003)(47076005)(44832011)(1076003)(82740400003)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB10336 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 04555e4b-9fd3-4993-e5e3-08db20ae0062 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ep2dnbj9MwXtbkPyJKcjp1s3v0xtu8hbZrm6Zz91DmxPEN6J3rfWffA06ZoBimvTy8yoS6DRhqXbZdafXukA8TIB/urSrZb3OLIo13AbFUxaX0Qt4WXo1YexA8vh+GacMxquq9wGDvzYhdRLOLOvr2w5QA7ljuukTyRb34/rHJwmCylEVasd3Kbr2QZxK9z6bopfFpix0RTjdcIFSuPYEJ7ax+6sNe8R7NNEKTKbQZFw0R3ZaeS3Ldao3hwwofmCMxZKmjoKpepYH2Z0ai6YMhHHzQqIpj69Uz0H5uWWqDPMpz0ihAcVzX/7ehLsjAgKYZ1abjUO+MDPrr+Tyil+ipTmn2U73EnqoohNEPe31KE6AVGJv0xN2i+/D3L6X4USkioi7ZLgGsPsAyB3N51M//HQEeM5vOOpNz/bKsb02suDWKWsj9fSg/TobH0VNy7x86rU7krgggi3v4oNFZn/uPPl7WKtgZm+xNhqG4UNLVfnGHKCoL46JWs91Y6InDaeR6yQc0uFJuNnSdWZy+BqA/g3JeS1N27XZwPH9f2OKGBSBzCn8ec1Ek/R+n/v8Ga+Hs5eAKzcXXk7FdcMZS8abXxL7A9ZlCCLxXoyhgcd5URHCTT5vUuf9xAh3A7UOCMKMNRpTOA4lQla88LV9Q2dwjC60cCDwYl/XKnPQpKdoPg/yxNsmxtpksbqdNWlTKa7FX2Vo6rGxrvjsC2VoTFHlA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199018)(36840700001)(46966006)(40470700004)(40460700003)(36756003)(6666004)(54906003)(478600001)(316002)(7696005)(5660300002)(2906002)(8936002)(44832011)(70206006)(8676002)(70586007)(6916009)(41300700001)(4326008)(107886003)(82740400003)(26005)(81166007)(36860700001)(40480700001)(86362001)(186003)(2616005)(82310400005)(1076003)(336012)(426003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2023 14:53:20.8366 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b112a69-db0a-4974-8a60-08db20ae068e 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: VI1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB9940 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230309_065335_543224_9E6D3BB4 X-CRM114-Status: UNSURE ( 8.46 ) 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 Copy the EL1 registers: TCR2_EL1, PIR_EL1, PIRE0_EL1, such that PIE is also enabled for EL2. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Marc Zyngier Cc: Oliver Upton Reviewed-by: Catalin Marinas --- arch/arm64/kernel/hyp-stub.S | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index 9439240c3fcf..d63de1973ddb 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -119,6 +119,24 @@ SYM_CODE_START_LOCAL(__finalise_el2) msr ttbr1_el1, x0 mrs_s x0, SYS_MAIR_EL12 msr mair_el1, x0 + mrs x1, REG_ID_AA64MMFR3_EL1 + ubfx x1, x1, #ID_AA64MMFR3_EL1_TCRX_SHIFT, #4 + cbz x1, .Lskip_tcr2 + mrs x0, REG_TCR2_EL12 + msr REG_TCR2_EL1, x0 + + // Transfer permission indirection state + mrs x1, REG_ID_AA64MMFR3_EL1 + ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4 + cbz x1, .Lskip_indirection + mrs x0, REG_PIRE0_EL12 + msr REG_PIRE0_EL1, x0 + mrs x0, REG_PIR_EL12 + msr REG_PIR_EL1, x0 + +.Lskip_indirection: +.Lskip_tcr2: + isb // Hack the exception return to stay at EL2