From patchwork Thu Apr 13 11:04:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210171 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 1280FC77B6C for ; Thu, 13 Apr 2023 11:22:09 +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=UBtM+PaWxbcX0QhWVBXLYshylU2WvTCBoxccd+6+r2I=; b=E2tfEQ4AnOLiGA 6NL/xssFrDSxI6Q19R7Lw2VYIDhr5oG0B6YTtVzFq86jR8Svj3oKVN8ts0A3NggYaHaNS6FvA9bCJ wCDkHGgXXyUrwxUUh3bhigU4GAQsz68y2SrKe82mxsM0SKGhcTLBDK9YczCjDFe+D066B7lMOUmsy Ao1309Y0xdO6gZzujokClbf6Mu9AHkPaZfGSWXNPEi1m00/dPQAg9KSFHA2ssmnoanOy9wm8XZjwR DFTkvlLunzpje2uqX9fefzaS3aUu2wvGACE7IpKlvHJUmi3SI5HzQ3mLjgAeF87O86wRYUVh4HvuN FjskA1Jols7R4t38HO1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmv0s-00636J-2C; Thu, 13 Apr 2023 11:21:14 +0000 Received: from mail-vi1eur02on2060b.outbound.protection.outlook.com ([2a01:111:f400:fe16::60b] helo=EUR02-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmv0p-00634L-1F for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:21: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=mn45FsuZlcvzHkKubxUwbWrwdB9cgfsPNlmUqH62aII=; b=yN4dw04sRtLgYHsX7HZC+VBB/g1qmsdHK1Aow2wcbF+yUYSSdbnITgRqBmRxMYbIjFSeY3hlKkGZ1rR9pUXM0Edk5m05P/mm2Yi6DdVVEvTZjhxa03wk7dXbgLldG41zU2x4GeL5/Kc8HoeniTp8Sea+pIRuAjhwsU2OdsasfPM= Received: from DB6PR1001CA0029.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::15) by AS8PR08MB8948.eurprd08.prod.outlook.com (2603:10a6:20b:5b2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.30; Thu, 13 Apr 2023 11:05:27 +0000 Received: from DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::3e) by DB6PR1001CA0029.outlook.office365.com (2603:10a6:4:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.40 via Frontend Transport; Thu, 13 Apr 2023 11:05:27 +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 DBAEUR03FT033.mail.protection.outlook.com (100.127.142.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:27 +0000 Received: ("Tessian outbound 3570909035da:v136"); Thu, 13 Apr 2023 11:05:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 04808b2005cb629b X-CR-MTA-TID: 64aa7808 Received: from 6632932802a5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4C4FE0F7-5933-45BD-BED4-1472A0FCD133.1; Thu, 13 Apr 2023 11:05:19 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6632932802a5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AFflCDQ/9i11ilIH/6kLDCa7hV4SZj9H19ilsymIshRCMQDdUmUwnVbNA4H8BuFQYNZWEtBlUEjsLZgs6CMyQ9Q9lDTknuyCXEUwUrphCwEc955VGvTuRDp0kn6H0OhJ5Ltk9bykMuJfbrwwHoqlpXWC+kzVAwRabsmFJlkvlp60KWk/yqVZg7SLW30W53wqolzSZhRdpF8OTXtBv6/Ka+03Fc+PB+ssBdSbjRtelb1nHd6pV/24OvLc8lh+iEJ2mzmDKt/GN820uSaELT0CM/j7tj+TeVywDm27bZmneUwTGON1JC5hFzguo5UETryYC2dG9iehSwAaktkqq1H9Aw== 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=mn45FsuZlcvzHkKubxUwbWrwdB9cgfsPNlmUqH62aII=; b=aKAix/Oo2cZQL/h4J+vbUjfBc+I/FDNx/+EHJ8g5FznfUQjvZ2OIwlFL7B6duSZljuEXvwekCECW7z83ePoORXTDu/uYjZn6YxD5sphKaFBjEo+vUbeqlcHUte+eYnBT3GMpGgTBnqajGTywLfVXhUubitWYFO1O6B7suRSAO3/oT0xQkD+1a90fhGh/sjdcoAvLzksTpof3CEw9z0p0o+GSGtLlPnFUkBiw9LfEryyh94cT1TPApz4HOPHZpmnA5QWMSwF+2OEcVAekeL13M2qy6OAp7yvFeF5q7WR+4/eV8BhPNTvGk67a0A7YeF28hJvSkqOMU7x1AeFXwpxbAQ== 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=mn45FsuZlcvzHkKubxUwbWrwdB9cgfsPNlmUqH62aII=; b=yN4dw04sRtLgYHsX7HZC+VBB/g1qmsdHK1Aow2wcbF+yUYSSdbnITgRqBmRxMYbIjFSeY3hlKkGZ1rR9pUXM0Edk5m05P/mm2Yi6DdVVEvTZjhxa03wk7dXbgLldG41zU2x4GeL5/Kc8HoeniTp8Sea+pIRuAjhwsU2OdsasfPM= Received: from AS9PR06CA0459.eurprd06.prod.outlook.com (2603:10a6:20b:49a::8) by GV2PR08MB8584.eurprd08.prod.outlook.com (2603:10a6:150:b1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:15 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::67) by AS9PR06CA0459.outlook.office365.com (2603:10a6:20b:49a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:15 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:15 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:14 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:14 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 01/19] arm64/sysreg: Add ID register ID_AA64MMFR3 Date: Thu, 13 Apr 2023 12:04:55 +0100 Message-ID: <20230413110513.243326-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|GV2PR08MB8584:EE_|DBAEUR03FT033:EE_|AS8PR08MB8948:EE_ X-MS-Office365-Filtering-Correlation-Id: d3e67830-3149-4480-467e-08db3c0efcba 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: 3HKXjg1vJjcCr3JtKnAQCVeN7M1GAxzbi0jN6NzU8s7wuh7xnSAF3qic2vFvUf+jxp9ScIqzriZ8piJ1pMMssdfX2ZwpSWczBD+nVPBWIbJEoBX8rO/D63IR0sRxLpAAjFM3aZBvOJDqB261Z+QpTFHzLmXJs5H6Ok7/rOHx06X7I11uKibRBCofjl58tOQV1UqJZBRrKTzDUA286Fp/U85IQupX3JFhZI8a7fypUvYwhF1xwA5bX1lH02Z5vW5ZWnBsi9dJjvttRRTITEKrrhTbEhwEmqY4QNm2FGVss6rUCk3snPpURjRncyfcGqb3pngZ4dncWViS3jmN6cGoFsQgrnz589h3ZcoUuCnplKG4Ir7frYR0qgQaIkofHg5+9OtZFHuUbTTgqrzHIqFNuqCtqFZkZskjUgMwuSAQOZdQwnEk6RtLhn5MhRBETzapO4w2PmHa1JO/d2CmK5EW1zwfBDUXflII+IRpuvPFjgRF9P2mz4/bIXO4DihX7aUagU8MMyNHfTLcMpMmkKeuyl3XhcPL/AAH9VD0ULLmIjmMB+1CsCDpcmt5xUi58g0CnZ9K4p/t+Pyd7i1T49etzC7KEnUW2UCdvHQ2SSFWut9Eoo3fMgWnW55J1vATRmbb6v65N8kHnp38/gt3x+4wn9oyQ0ElAGJsn3kzR+T0b8xrrx8c12VBDfKA0wm+yVzd+zig9O6wqGwErris5b6Eahdo9dOJX7bQrwFH/5CK6xI= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(376002)(136003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(2906002)(8676002)(70586007)(70206006)(8936002)(5660300002)(44832011)(478600001)(41300700001)(40460700003)(316002)(40480700001)(82740400003)(426003)(336012)(36756003)(54906003)(6916009)(4326008)(7696005)(186003)(86362001)(6666004)(26005)(81166007)(1076003)(2616005)(36860700001)(82310400005)(356005)(47076005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8584 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9f8c1592-27db-4300-a93c-08db3c0ef5f8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: btHIPZW5qiL0gP4Oo5Q+Hwv7ClgdWfDhZgfB7IYg/P3enQ/Y/xNFdewcIVUb6CuTiMNrPSMFTpd7TYujquIHMsz8faFTgGA+hlHtV1/5PR86X+hwoSfxzSW4g7x6wfY9MpFZzprK8FafZn4b4ZGso1eD3hyjHFw/zdIcV8+0E8CwiU5gNT6XPXOvKtXRq9NP5fkswGY9iXB8Yq9Y60IFtveJ6rFF2I+fd4w3sy1qu319CNaUFcGHYcw2DLS7ZPKwFPwefL60ylBryMR8V/GYepb0WC3FmnNOD1lrq0f33nUH8svw/Q+Mbyfxj72OTjATU7FkyY124M2PIyYu6OETkd9RwFgpmqm1rqTSbLYXchPmmNXqwtGHsUfiSLc6Oq8hTqDRYZu5kN4VyDEfwlHp8KHvkSZquGvACdKa9u66tOF7/tQ1rG4hqL9XNGN1/48o+U6u7iwplOmd0WI5tEWMMcU8/9dQaPync1ttoiN1/WClaLL+Vu/nZtshnPEAcdv8zgd4EdJYS7Fe5fl1jukcHdbCvYYXz2rmDVCsF09/NI8qg7mt026xcj9P0v7iMPjscmLBrFtnjscMvnKvcLX/OZJ49jADxJxlMfam7y1+tR327Sq/c4wpdGC4+A4vk9TaI9m2f7GYbw1GsTgOC1OJqmHrNeBye3nqZkDxFRRqgHSsZwgyU6ao4ru0CdnvsIyiFwySYxk9SkYOtZR33/h+8A== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(376002)(136003)(346002)(451199021)(36840700001)(40470700004)(46966006)(316002)(41300700001)(54906003)(82310400005)(86362001)(36860700001)(478600001)(426003)(336012)(70206006)(7696005)(2616005)(6916009)(8676002)(4326008)(81166007)(70586007)(36756003)(82740400003)(47076005)(2906002)(8936002)(186003)(44832011)(40460700003)(26005)(1076003)(5660300002)(40480700001)(107886003)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:27.0332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3e67830-3149-4480-467e-08db3c0efcba 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: DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8948 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_042111_425920_99594E16 X-CRM114-Status: UNSURE ( 7.90 ) 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 Acked-by: Catalin Marinas --- arch/arm64/tools/sysreg | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 2af92b4f4fe4..0acbc2112f1e 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -1538,6 +1538,72 @@ 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 DEV_ASYNC + 0b0010 FEAT_ADERR +EndEnum +Enum 55:52 SDERR + 0b0000 NI + 0b0001 DEV_SYNC + 0b0001 FEAT_SDERR +EndEnum +Res0 51:48 +Enum 47:44 ANERR + 0b0000 ASYNC + 0b0001 FEAT_ANERR +EndEnum +Enum 43:40 SNERR + 0b0000 SYNC + 0b0001 FEAT_SNERR +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 Apr 13 11:04:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210136 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 C0F33C77B61 for ; Thu, 13 Apr 2023 11:06:50 +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=I37AhvxaROEiieZm1RiGiJxfX3nhsSNthPo5opGTVCk=; b=dhVZEFTkH7DuZc CWHa017AXnxscdPyZpFQB6UFb4JtzFM2bHkYS6Lf8CupcoxQAakVCkbJJm6s7MF9bjGAV7e+EA/g2 w5F9kVLpSjB+iwZA6sJv1NSa8Cmp4YONcGwdM1CRfbq+gmoiodeWzjyo56tbtpYzrqvLEOShqetj7 eHOA6C3tKMi4lQHGL1LewCSZ+zRMIjfuRNUy6J4v/ebInLH4KP4WxyCbL11im2k3V3XEX9sMzhWi7 cnna28pWByotnQmqQXvy2XT+rzOzUER7tBFDy4TjtvdZ3CRJe5DHIyk0EgQO4apWEa4DW+/FddXd+ dzwqULLPtDRcLgiHqhgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmulu-005yRa-1e; Thu, 13 Apr 2023 11:05:46 +0000 Received: from mail-vi1eur05on2062c.outbound.protection.outlook.com ([2a01:111:f400:7d00::62c] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulk-005yK8-0n for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:38 +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=JPd0LPem6icBwh79hyTOMww8HAnx3nopSHYmb/wyUgQ=; b=E3WOpb8E43t6QNfCqvnfsi8oExmzHtqgD5T/vsg8Ezuibw4wofHH1WHbmEGJeRYkRi0ZBYUjxsB2ZvB2S6e93O0WyKAuPSAknZTOKUhTFCQGSH45AOMEZbOTNinNUtcvJ08c8DVLIsuljR8kVnEcIqiXYVfoGJBu/VJxmd/MbTg= Received: from DU2PR04CA0305.eurprd04.prod.outlook.com (2603:10a6:10:2b5::10) by GV2PR08MB8097.eurprd08.prod.outlook.com (2603:10a6:150:75::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:31 +0000 Received: from DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::2b) by DU2PR04CA0305.outlook.office365.com (2603:10a6:10:2b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:31 +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 DBAEUR03FT061.mail.protection.outlook.com (100.127.143.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:31 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 13 Apr 2023 11:05:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 420317333fd5c2f2 X-CR-MTA-TID: 64aa7808 Received: from eea6fdf9eadb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4778A8F6-7180-4522-9F66-40C830358E25.1; Thu, 13 Apr 2023 11:05:23 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id eea6fdf9eadb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OBH4NmWssDGGkPhsqEd5wqW+42bEFET8BbI/OjIFnNyNdOzP6Wi0EJyyiQu0WVrAtMafe8r8fGl9aTtQOTWagjKvqAsckymZOnnxoPScRYLC+d7YvvRGdlRI7PscoodOKeVvABbZK3RpRZiMijah33j5710QIxw8CVerJMtM2ghGed+FcBRSjqLFJL/I7hPipGu10VC0Nk3oMI7iD3UvJd0GwVydaq0DlK9iZOP04uXpGdTOnw6HPf2SoRwuUxN7pngjnqSpLoLilY1nc9670cXJCKxGGUgNU15gUolN5rydrRLbehmskySiop+qAK7sNmT6bhJ2aN+zUmOmaAdRsA== 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=JPd0LPem6icBwh79hyTOMww8HAnx3nopSHYmb/wyUgQ=; b=kilEcL5GN7JLiDQkUc35wm1rFVqe7yWlFwV3pcUi8LZ6fkmxRZyvgbg2e4Z8b6wby0tU8rz+GKrDtidCrJL3Lt0zbLAd98Nwa17kLPexCUGWcBQY+ZgvEYyOsCTmROw9YYrX1+vlahNMRQOPWRVSHFQaxP5k2d+bmjjwdwoextY6suWGsRKeDVdKxoFwTtSEEmkj13N7EfyIFbaykGJ4vKsptoP5IarE5WhEOlMnpE4uPUVMVe/nHF8+61GU3RtdeBIMuoTxF4Jq9P2Io257C7eVVHWD9CaEGIVToLPL+x1WgldqINIlvPChOR2wSzFIQsBt0Yh8WbL2jusMZnTC+A== 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=JPd0LPem6icBwh79hyTOMww8HAnx3nopSHYmb/wyUgQ=; b=E3WOpb8E43t6QNfCqvnfsi8oExmzHtqgD5T/vsg8Ezuibw4wofHH1WHbmEGJeRYkRi0ZBYUjxsB2ZvB2S6e93O0WyKAuPSAknZTOKUhTFCQGSH45AOMEZbOTNinNUtcvJ08c8DVLIsuljR8kVnEcIqiXYVfoGJBu/VJxmd/MbTg= Received: from DB6PR07CA0066.eurprd07.prod.outlook.com (2603:10a6:6:2a::28) by AM8PR08MB6515.eurprd08.prod.outlook.com (2603:10a6:20b:369::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:17 +0000 Received: from DBAEUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::32) by DB6PR07CA0066.outlook.office365.com (2603:10a6:6:2a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.27 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +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 DBAEUR03FT024.mail.protection.outlook.com (100.127.142.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +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, 13 Apr 2023 11:05:15 +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, 13 Apr 2023 11:05:15 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:15 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 02/19] arm64/sysreg: add system registers TCR2_ELx Date: Thu, 13 Apr 2023 12:04:56 +0100 Message-ID: <20230413110513.243326-3-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT024:EE_|AM8PR08MB6515:EE_|DBAEUR03FT061:EE_|GV2PR08MB8097:EE_ X-MS-Office365-Filtering-Correlation-Id: b11b11fb-394e-48d7-734b-08db3c0eff43 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: 6qkiB5NSuB+pMNvX8XdUmsFLq+50NkzOqbp1P23bf5ofNIhdWSv3KacO3qHfQHVIbrOrcBTekHzKCLKxWKJDUYxJ4DUpjGh7YIxc+tBRjTC868NaOW/Lb1msGNu8S9ElQ+Js1AxmrV/mEamYQMZIp12e+f7MhkdCcibfZfbxn/a2yNhRXmK7e7VCm0TnRx0tx6k2hmTPlo3TeSsN9R2Lxp2YDqU0U5Qh1adpkUSWLNe9GTsVznwBTCNETThmuaLhO913dKHrser/4U354mk2lHqkpn/LgwqpdtAJMkO8H5X0f2u3fggzMYsy95y+wYrriQrjG1TMc+x+XsEs25hVwidw9yWZbFeYwwbl9Jm+Xt3R3OZZUSl1Dcu/W0g9kdqT/igByo+X2BpCswSTzlK1UwK3HgZMQJHk2gHuNFL9aij151HwjtzV2DwdBv0DSbEqWUNPaTC+5FuOmcJ2BQT1Lua3euKe0cAs0Y27bk8dBMZjAq4GbMnZUTJ71VsRbxfkPC22Qw5pATzeUx+fIV/UszJzhbMqu0D4xb1rcNdlOP6tgwMv8llk8CiC5X/pvDmmbioemiMzkjHpCUKmsjHGJQHJ8XnM4me8PK2ekNprYifbCskemU5h3ZDf5nFNZiMMuUK5bgdK+vOYyiGBrVRt3HLEUP5O/fjZphhIM0hdjfZipUsoJyq4XCKEHS19F+NS5oKWez2Vz2en41dsEsJtrc95gEEms9hTNs4gAzquXqs= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(5660300002)(41300700001)(82740400003)(40460700003)(36756003)(2906002)(8676002)(86362001)(40480700001)(356005)(4326008)(6916009)(8936002)(44832011)(70586007)(70206006)(81166007)(82310400005)(316002)(1076003)(2616005)(336012)(426003)(47076005)(54906003)(26005)(186003)(7696005)(478600001)(6666004)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6515 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2bcd694c-d57d-464d-6810-08db3c0ef6a8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zdsbV6EdWyeBb/je1ellDw+bB13cmUKMXPE9H1IQlPnvzDLggJAGF81LRHgqOF7lKza3VD6lIEGrjYHdcKNDNBZGbhd+q6yej5/QSSC92ZcQfUoW9VmISAU0JjWT03/0ZaukTCn8RlE6b6zY0M9HvU9uy5Egp4ZJIurl33vuQc+JgkXFlZ8gyLA95WvnSz7l12UHFTPSMC+jnYVZwwlIgoYwb1jnt69zRT8MIFRz59GxgBlRF1S90DdXlwXrtBpkQLCCoEpz3DvC+Rp95zvPjLiF53SjHjxZb0Nmw/Up1PMbzV54cT6iAQANjbn1rGuCDZFXBJsoG7NwVlvq7xQPOwPAgQNpJgwktp1xJqgz14yvu/Op74E/jZj8h60oLFra14jv3FFQQNXMLU/9XoM8TvdUXSE+SK3YcYM+WvAvTerfk1HQKSIIO3QFTQKYUCPgUtOZk/3BB0PV+giEzi/AW/g7oK7DLT/JCYTUNVJk0YT/e/pPRTogzF5RC6TxwQByU7pji/PdVqasugN8d0aY9yDQOb4nV07YSONRw3Qzy2zCs2D91QYsR+O11r10jmzZg1whUAf+axog6fJabLRzAHdDZtVttbXUheX8g+qjZ37aUIhgdnrgVmw6ale1hOGD3dLhcz4onv7Yxt9dG6C3R5wRO/OlbfKldulDnc3ttyefObJgvZurixMpTMZamAjg49hDlFkeV2NW1ItWx1WHQw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199021)(36840700001)(40470700004)(46966006)(478600001)(7696005)(40480700001)(36756003)(47076005)(81166007)(82740400003)(426003)(336012)(2616005)(86362001)(36860700001)(2906002)(316002)(26005)(186003)(1076003)(54906003)(5660300002)(44832011)(82310400005)(6916009)(6666004)(8936002)(41300700001)(40460700003)(107886003)(8676002)(4326008)(70206006)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:31.2720 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b11b11fb-394e-48d7-734b-08db3c0eff43 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: DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8097 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040536_288183_71C975D5 X-CRM114-Status: UNSURE ( 7.29 ) 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, TCR2_EL12 and TCR_EL2 registers. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/tools/sysreg | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index 0acbc2112f1e..a63f25261f74 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2150,6 +2150,48 @@ Sysreg TTBR1_EL1 3 0 2 0 1 Fields TTBRx_EL1 EndSysreg +SysregFields TCR2_EL1x +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_EL1x +EndSysreg + +Sysreg TCR2_EL12 3 5 2 0 3 +Fields TCR2_EL1x +EndSysreg + +Sysreg TCR2_EL2 3 4 2 0 3 +Res0 63:16 +Field 15 DisCH1 +Field 14 DisCH0 +Field 13 AMEC1 +Field 12 AMEC0 +Field 11 HAFT +Field 10 PTTWI +Field 9:8 SKL1 +Field 7:6 SKL0 +Field 5 D128 +Field 4 AIE +Field 3 POE +Field 2 E0POE +Field 1 PIE +Field 0 PnCH +EndSysreg + Sysreg LORSA_EL1 3 0 10 4 0 Res0 63:52 Field 51:16 SA From patchwork Thu Apr 13 11:04:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210135 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 1AEFEC77B6C for ; Thu, 13 Apr 2023 11:06:49 +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=UbVLI6UUCXpeZ1K3zjPgjmvodIBt+HfXnoJrmztHY1k=; b=EG6Nj5kUgMuPln kw/wkrUf6LuXbs+ZGUfrUsN6K/n1li9CLIx27UA5ngK3ejbcjFuy7D1iUd3r5LbFtKVgr6KrA+hBl jzlFLOzh+MPplJ2NcUNvWs+Hf43rXl7qMoHF/TBqFAmbG1qNbcuAWPq3Guw7YklH4tPl1Ld9Q0nXb QhhKV2KYjeWqxctGty7TPhGweKzSeCcO/ZvwDlq2zIEparLV4MhGpheh17E0ZMWw8p1qkclYZLJTe VfVHCqu5f6fZFUikUM4GRzxkuRQFPYF8kNltFtBZhYIu3WI0n11Q8vfiPjFaJr2ZASMk90A9Uc4VC Y8Wzntyth93QhFgJyV7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmulv-005yRx-1u; Thu, 13 Apr 2023 11:05:47 +0000 Received: from mail-db8eur05on20613.outbound.protection.outlook.com ([2a01:111:f400:7e1a::613] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulk-005yK9-0i for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:38 +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=8+0G/5yBR7mgXk9FXXhnnX6Xe9BPeIkGxy9WAxR/TsE=; b=A29AJ4dvNRfofU3kqnk207I1NujwzwTpI5b6ozunTLfOZDNAt0WkYw8O6sw/TOrv/vQy1h9dZtJTG2ENhS21QFtsxV6X8CbNLbtTJJV0mFwi3Nlc3bMp3nyg9Ejmsn2weqoPEX88llfsq/uuC5ZYzHGdu1xTCFXNu23cWJUe9eQ= Received: from DUZPR01CA0034.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::10) by VI1PR08MB5344.eurprd08.prod.outlook.com (2603:10a6:803:13e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:27 +0000 Received: from DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:468:cafe::d) by DUZPR01CA0034.outlook.office365.com (2603:10a6:10:468::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +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 DBAEUR03FT012.mail.protection.outlook.com (100.127.142.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Thu, 13 Apr 2023 11:05:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: db869bccad87a4d6 X-CR-MTA-TID: 64aa7808 Received: from af9116659fd4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F2D0BDBC-E983-4106-B252-15003982D7CE.1; Thu, 13 Apr 2023 11:05:20 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id af9116659fd4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9Q6oxKqM2hGPRAqQvz3Gj4wgwp1oRLEtbEjagt6Q9gDwu0s3A9SVU+ncdo2vtYwIKKRjV+ZFhQA42kb63GJINu4iOMXa+toVvOePh4X537/GiN2BkbZQIjt7k3aBQmHWxAkGJ7nklE6UpSMROQMmzrlyGApFCF51Gpb9eVlMJ6gbrn/2+EfAtjDCW14qAim5f+ZLCOCAPry2Gt6SHy04377m6F0Miljv2StmgKSsWCxxiuKqHoMgUxZTar0dZR3r/yKfekfKc1DGGF8tRXSFVVLxGQXugO4HBNbDQLfcZ++m9DAsXIn9g/0sLHlWzZTb6+NI61zE0JCTl4a1F3sDQ== 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=8+0G/5yBR7mgXk9FXXhnnX6Xe9BPeIkGxy9WAxR/TsE=; b=CcRorMhtqT0kraRRM2xwsTb9vPAQebf/J3gyGqqbw/owoyUuLNpKqazdI5YUrjqfqITdhNZlTfBbHPBXzV62BFxvdpytuC5EoWg0ltkxGJXsQ7il05/TRRgpNnZxqi1md9HLVJ0Tv4zpcrWnbPWIk0NhZQK2d16P3+qL7LqW1NEaMdxKSfsIj6M2vov7hHi7Knjn7uU6LFS2hQcp02yivj/rwt8LO1aEvJ6oW6hPr1+NZc1c6ZHyXQuRd0qWqGnPgm8Q1cprfxZyl34+5ygDlEaCctBasf4CRaVx1Os5zPnIk/0osLygUOVFL+spM6PHHJY+Y9jn9+AOhutFcCNmcg== 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=8+0G/5yBR7mgXk9FXXhnnX6Xe9BPeIkGxy9WAxR/TsE=; b=A29AJ4dvNRfofU3kqnk207I1NujwzwTpI5b6ozunTLfOZDNAt0WkYw8O6sw/TOrv/vQy1h9dZtJTG2ENhS21QFtsxV6X8CbNLbtTJJV0mFwi3Nlc3bMp3nyg9Ejmsn2weqoPEX88llfsq/uuC5ZYzHGdu1xTCFXNu23cWJUe9eQ= Received: from AS9PR06CA0462.eurprd06.prod.outlook.com (2603:10a6:20b:49a::19) by AS8PR08MB8351.eurprd08.prod.outlook.com (2603:10a6:20b:56b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Thu, 13 Apr 2023 11:05:16 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::ba) by AS9PR06CA0462.outlook.office365.com (2603:10a6:20b:49a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:15 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:15 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 03/19] arm64/sysreg: update HCRX_EL2 register Date: Thu, 13 Apr 2023 12:04:57 +0100 Message-ID: <20230413110513.243326-4-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|AS8PR08MB8351:EE_|DBAEUR03FT012:EE_|VI1PR08MB5344:EE_ X-MS-Office365-Filtering-Correlation-Id: 47381657-13d6-4cd8-dc63-08db3c0efc96 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: k1gOXDhAY35kgvlEVpGk98SsRo8KW1aVHEhjOJbl/quVplyk6Nl8+fPv8JgCIDOo1Qdmk0xKvXw3l3gkOdJbGQSzrZyQMjYJC8fl5Xys9u52EP0UepqSrU0sJ45+8M8b3L5B5sQeeNi8aRd907kKJob+vSlO78zH6R05EZkmzQ/Q7WK4K+8zZN3bb6mDJ0khACXhmZUeElMwST9xw9tYUPd1Hpvs5CJhbEURWRVTOV0oeOP4equbfY4FtpizTepuhbCpni9XxZfEcWXrydcPX1Je6vpS+glEacQVLnMhEu1MEZQyJQRf9hGFwFnN2cmeITDg5LR/yk6xL6sN8JijPXFH3z/PfBVuRfD3OoNyWgiBQbaqIUfx0SPq4oZqitrPYA7uXRCeli8COWiiV7d4JM0r4ijoeog0WZsKkSNbgsVgcYSr1tPrTegzyHxn0JqkFqW5ZLjXpazGj8U/QHkcoCwJVua8V75ihYf9fNjbJ/vgpCa6wg0ucRdF8C5A7ht9CPrBFmo7IRIF9zNXNaoAzyEZ3UqocLqYqU26NntAyM6bz8UzsQXOjkFQeWS89zfmFvbwyry2WmT01xNhs9XlAqROdBwZ1cCWYMpRs/SHK7c1cJuOoip+MV4cFEN8MkkNyknrhsxMb2nyOoeDIu0/JASCqaRujG+gUAIUsTPXxW1+RsLCIQY2kQcCCXoFXBXHduSLkWmg4KQOjTbrYmgxxSvm+BVGyOQmWY7fDhrhomM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(40480700001)(7696005)(478600001)(44832011)(26005)(186003)(1076003)(316002)(4744005)(336012)(36860700001)(2906002)(70206006)(70586007)(54906003)(6666004)(82310400005)(41300700001)(5660300002)(4326008)(8936002)(8676002)(15650500001)(6916009)(82740400003)(356005)(47076005)(83380400001)(81166007)(86362001)(36756003)(40460700003)(2616005)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8351 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5440c7a9-2561-43a1-c623-08db3c0ef69a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pz8AjpvG/dw7CtM3a6wIyrLG+t/jN/s87VICYRHBgEvQnI67vsSqDn6afj0BJ7/WeiVgeStI/EvEKpYzvDOIwWyNDa/ECOCbM3BKbKFc2Ti2GIbVY1i54fNRqXK5rrQMXslF+VepepXhqttp+KVIlzyjuVkMCktSuo4OD0cxflhktWeENMg6fyZP13DdRKY+7QlfT1DSyFUrZ6SvWN4r5wMZPv7c0LZorOATMh+K6J4NuK5bmobQANo1LQNmuaT6nwbOONXZNg1qiamlI8yzE5aWR2gUGgESnOee0X/N0dKJwLBV43CWgDN2YZZdpyYi4ainJm0cVzjhv1jMxRriMc/OQh0ECn/DzcCPzyQraubnDi0tDmYkV8oziGA5pI2xEZVTOiBaCbTx31Q4riVxbGf/2Zqo3JcfCAOPrd4A4enF5Ec55MkO75C/NPzEWnNAAjhzDdFDb6X5ziEKu0g4CVEZzBMOhF8TBRXQh9g/sXGCaujdLEPztno4uN6x/2rXNBGltkkLCXgw5tc3Sj8lIb1lLwZMpELlfvoQtFMb9pg2Lm1N3GQezRAiJP8axrJGD9tTSOCWERM6j+0IUlOOFLC6UTaW3y9wvHxtqeHdW2+hLtP1k31zz/kE5zEWrrG4ycbhphugC/aXOHMJbVB7U4QRQflu9zObsXXtxqCkaicnTw4Tk1hAGWUIymJmZQASvQGb8VrOMWCbeUEnUPlbtw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(396003)(346002)(136003)(376002)(451199021)(36840700001)(46966006)(40470700004)(40480700001)(1076003)(4326008)(26005)(186003)(40460700003)(316002)(82310400005)(8676002)(8936002)(2906002)(4744005)(15650500001)(86362001)(36756003)(5660300002)(44832011)(54906003)(6916009)(478600001)(47076005)(36860700001)(83380400001)(426003)(336012)(41300700001)(2616005)(82740400003)(81166007)(7696005)(70586007)(107886003)(6666004)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:26.8011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47381657-13d6-4cd8-dc63-08db3c0efc96 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: DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5344 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040536_265042_9519B9FD X-CRM114-Status: UNSURE ( 8.15 ) 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 Update the HCRX_EL2 register with new bit definitions. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/tools/sysreg | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm64/tools/sysreg b/arch/arm64/tools/sysreg index a63f25261f74..6e8aa9070513 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2035,7 +2035,17 @@ Fields ZCR_ELx EndSysreg Sysreg HCRX_EL2 3 4 1 2 2 -Res0 63:12 +Res0 63:23 +Field 22 GCSEn +Field 21 EnIDCP128 +Field 20 EnSDERR +Field 19 TMEA +Field 18 EnSNERR +Field 17 D128En +Field 16 PTTWI +Field 15 SCTLR2En +Field 14 TCR2En +Res0 13:12 Field 11 MSCEn Field 10 MCE2 Field 9 CMOW From patchwork Thu Apr 13 11:04:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210133 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 7BCC1C77B61 for ; Thu, 13 Apr 2023 11:06:44 +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=QQR3LhWhEtFgw9L31CUoOtBZopaGxTxgyI70N9bU45w=; b=KdByISPBocYXxp uPznCX/8RbmLCVdKum1N8ord6nWHhqrzozroUuChDPJwtwH7gEqg3TfqkhKGFC5dywhzneByl9MhT loRykhCoceaohdRfpKvoDnK1inLabnuNUPEru+9MWn19p4Wf/eF13Ym0yQUGnKgoNmnwq2tQmg0v4 D0G5ZeY8Ee6tW/KMf5Fb3+HEds11eVtYDtRE0kXyeJr14ExTkaV2hd4iYys3T/yNGzrwdJLMt+nnv SOX006fF6bR2Ty/MOjxvzIdQ0pXQWpFhM2DInrp+uElgeAjBbjzutafwBRz6J31JFWiC5OJKpeDnQ ox1dZebPFtCspM05/4ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmulm-005yM5-0u; Thu, 13 Apr 2023 11:05:38 +0000 Received: from mail-he1eur04on0626.outbound.protection.outlook.com ([2a01:111:f400:fe0d::626] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulj-005yJi-1f for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:36 +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=nqjfvCFCZXpCRZD+xDTT2bxW9HWD2wb9P24VqcrtACc=; b=gbkRZ72wYMRGz5FmGLPF8NlL947q/FX7yCy8bHSZXl1cHORMPKktYVQOjXkbAFzZ9qq+bpwhfPN6LZt71MpmGJUqj67xlWXjvCn5PfrXraVnGWMIK61bQdd67MCyjfIP+jJMULRF5RcXbjSY5FUvDKy+ri1Pxpe+YDc7vQTAhQ4= Received: from AM6P191CA0040.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::17) by PAVPR08MB10332.eurprd08.prod.outlook.com (2603:10a6:102:327::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.31; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::8c) 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.6277.40 via Frontend Transport; Thu, 13 Apr 2023 11:05:27 +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 AM7EUR03FT055.mail.protection.outlook.com (100.127.141.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:27 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Thu, 13 Apr 2023 11:05:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bab71d97fa9d9d45 X-CR-MTA-TID: 64aa7808 Received: from b1bfefe14e02.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F273AE46-5E5D-4FA0-9DBB-2BBCDDCCFBA4.1; Thu, 13 Apr 2023 11:05:20 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b1bfefe14e02.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ewWAdvhvZHRiuYMu7e9qDm9xXS0pSZbnSu38Xgxphb8gbMpfdvz+0Co1GXBpEBU8o6KeaT/NUFbRRs0jEULUqCqrzL5XS5AErRQ1vdxTrptMYpORBDS79HC5gyhPbhP0ym9TxrrpsUVvYrfABkvKQw4eHm1ekSv92+Nqs17tLr1FKB80sTFvaAC/ID24zIp9eE4zFNOhGg6SiCa96i6UeiaZ9xv77L6jnM2mH19WFsqm9c+B9xUYTBTizYzQOII12uy+j2xOmFR3Rdhyx9xDIBaH8v8/YzlUIY7mqcirgxZpOD/g3v3nzPcW0JgtPZ2KN1E/h/UALL1iTOsEwPydIg== 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=nqjfvCFCZXpCRZD+xDTT2bxW9HWD2wb9P24VqcrtACc=; b=AELRXPVFNU+TLDoANamf/i5IyYP749t+Ebswu6KZtS8V+mFvdVw0HRWWg2gDlqVTumpMp/BBVCdAvt1eyUpxXI92b6Kw40UqCnHZUIXVQQ2Eslfol2W3N9+DKhgin1iLO+aoNFeWh75QdvFZQ5jwLPsBQmkbmS7Og/YHc+xc1z83Y98N8piQdFnyfbDs9BZFgjttWTqttngW8Mf1IpEfJyq1ATKiTQ7T/D6/7lNiVEcY9wnZYcNVnITAUCd2nakJ13yTNwlPU8BHroT+SmpQi4DoyMecMoVxuz7kHf4N+nedXRXvS+A4JisVjOd3PxYbuG5TTKOJG1K+nlA6fJLOgg== 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=nqjfvCFCZXpCRZD+xDTT2bxW9HWD2wb9P24VqcrtACc=; b=gbkRZ72wYMRGz5FmGLPF8NlL947q/FX7yCy8bHSZXl1cHORMPKktYVQOjXkbAFzZ9qq+bpwhfPN6LZt71MpmGJUqj67xlWXjvCn5PfrXraVnGWMIK61bQdd67MCyjfIP+jJMULRF5RcXbjSY5FUvDKy+ri1Pxpe+YDc7vQTAhQ4= Received: from AS9PR06CA0460.eurprd06.prod.outlook.com (2603:10a6:20b:49a::9) by AS2PR08MB9390.eurprd08.prod.outlook.com (2603:10a6:20b:596::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:17 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::b9) by AS9PR06CA0460.outlook.office365.com (2603:10a6:20b:49a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:17 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:17 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:16 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:15 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 04/19] arm64/sysreg: add PIR*_ELx registers Date: Thu, 13 Apr 2023 12:04:58 +0100 Message-ID: <20230413110513.243326-5-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|AS2PR08MB9390:EE_|AM7EUR03FT055:EE_|PAVPR08MB10332:EE_ X-MS-Office365-Filtering-Correlation-Id: 00a0404a-dab7-4424-be08-08db3c0efd2a 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: ddGN/0TQIAHTyI/0RzGFmcLeRifPoP1dmWts0T6c3ol+yNQsIywAH4SfRz4ArxObZsfDLVjesjACoI5YmbQ5CtKKgM9uklMtaCQpXhQj6ES3c0bMtBHlEWzrF2AZU7wPW8h3Lua2QMwAsZsy1taK5Y5ucoWyTxAdmk/TWoLU5DN7jigIvIkp61pW4PkMjqHIeKneCyeT/CYglP8VrYUDzBMEDy0IIq0JZRrFjN3xwm0K1PFDd+dYFOaFk+gPHmjE9JcmZoas0960dfKFVV/nZCIuEstTNwW5NWEoLkqWgRniJCbd10A+wfqe8mKQLvX7uVTm5CLXRFwNo+Xml4Nn+0EgzRwM3V4Srb7MmSfYoBHrUL2nyRPu2nZep5UE75nPQAdKVr6gJ3g9XQ8Bkb9mz2ZIOm5Xkp1sQ7omvWgXL4e2YLxlRJ8rn79XAq85e+QG6GQ5WfqCy16IkLCnPt6NJt3Iu+rNCJtRhfsXH/7zR13z4+U97ZkkZjycB5/xD0MfQxemjtoZbe7kKRyI2U5Mqf1erPF9EurVvPFQLQUYRgfkN++dFtBvbB+BtXSy0bOWWK0gBtyNpqmaurx2kymnmznpwlvg5DJdNaAjDsbG2FtO74tSjS6BHOTy088I9EVbfO35+MJkIpu5tB3FZr/BLarifZtzBezOvzfYD1aZWvVJU8Tui8b0JnRFYy+HrmoZ6U0PFs7Ib2EdCq/XjK7PkM1f+1415NGH2SIqQTOl0NQ= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(86362001)(478600001)(54906003)(36860700001)(47076005)(36756003)(2616005)(336012)(26005)(40480700001)(186003)(1076003)(40460700003)(82740400003)(6666004)(7696005)(82310400005)(426003)(81166007)(316002)(356005)(6916009)(4326008)(2906002)(70206006)(70586007)(8676002)(8936002)(44832011)(5660300002)(41300700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9390 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f4d3f97a-6017-484b-703b-08db3c0ef708 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EBL+q2BAXAIsJVHbKBHNDETCfBancVFEB2J+7BeCjLfXAHeOzgRhegu0mV2Uri+fnDXnW+C6WKUPwkrTU1fLveEPnJIrFcr56TFhkutWyS2WbSqlClfeNmrcjDFbSRAY4WIJ4ceR/ao1SM6FuSu5BOBr7Wnpk4gV0d/LKnzKsr5WQy0Ftn+L5pvuFG5pIx6v/hdxx8PFtaHa33tqqXu2XTqDncYjwjOu9Vl8XWUW25w28SordzsV9LMixuNsd0T2SV4Gi42kp4zNryTyFyzshnvxU+BD72uCCdU3YhFPhtXrjbJ3oamYwJ3iHBlINDxt7aVM317S+DX8IdBOP5O5TwptTKLbG1/SjpJWkeMd/ltM0szdfAxNLPRGGkV41lf+oriwx2kv/rJNmiBZxCU8+3eIzvgxYxEczbIdfJ9tewY/1erd9SDTpmfIdkeeQV1/ubU22JAV1SOQSujNdDBpQ0caxjvunhcMCcDVQlir2yFM5XzgWSkCObHbWo/eWCI8k6lNibt6uP7YSLDRajUtFwAtTRhbtklYmrRCScIhxHWUZJupRzYHy9OKmVDfsz9+NlkjMPYm26/QSDwDDuIg/+jP0ojE6oBsOmc1uTpwvpv9W7mfko9YEueu6iSVYIl3lOa6uHk3g1L6qz68V4z8ZD15sjNsUjdbnh2ft3IqGcb0JNzAgh3Hdhr8hYUPx8AIvjey1l8EI0Xw1q23Yexwig== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(8676002)(36860700001)(426003)(47076005)(54906003)(2616005)(336012)(40460700003)(107886003)(478600001)(6666004)(26005)(1076003)(316002)(186003)(7696005)(2906002)(44832011)(36756003)(5660300002)(81166007)(82740400003)(41300700001)(70586007)(82310400005)(70206006)(6916009)(40480700001)(8936002)(4326008)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:27.7077 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00a0404a-dab7-4424-be08-08db3c0efd2a 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: AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB10332 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040535_579371_AF4B489E X-CRM114-Status: UNSURE ( 8.15 ) 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, and PIR_EL2 registers. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/include/asm/sysreg.h | 19 ++++++++++++++++ arch/arm64/tools/sysreg | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h index e5ca9ece1606..2b317a24734c 100644 --- a/arch/arm64/include/asm/sysreg.h +++ b/arch/arm64/include/asm/sysreg.h @@ -756,6 +756,25 @@ #define ICH_VTR_TDS_SHIFT 19 #define ICH_VTR_TDS_MASK (1 << ICH_VTR_TDS_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_PERM(idx, perm) ((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 6e8aa9070513..dd2b333334a1 100644 --- a/arch/arm64/tools/sysreg +++ b/arch/arm64/tools/sysreg @@ -2202,6 +2202,45 @@ Field 1 PIE Field 0 PnCH 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 PIR_EL2 3 4 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 Apr 13 11:04:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210134 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 45E5DC77B6C for ; Thu, 13 Apr 2023 11:06:46 +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=cNkXvDA/twQIJZogmtTG+AUwbf6mHWu5YWef92sgYGE=; b=rOUH3JulDaevzz A91jt18TwsplVKJ37mTv85otkmYBLva0vIsboDfjfpROHWJ/54QKFf32L7Jdc1VSZm9xF8fmGqHzi WRZYeQjsMsLQ+DsOstb36nWRGgSWOREUnaugvRMr9LAX9jMUYWDCjqYzKulwWZYCczTats8xVaw4N lLtIxDy2XfHydVQcMSiYWR2b9daqhmykZQbOJBv8gwv7nakOweDeesc0FDW2nBpoFQVkVLMrYmBNl CZ+h/TS2rGLQl6t7xlAWoMjp8410Bl7JI23B4LQPigNkWvUn9XsvCzCgx7JGfBXMq3VIjpkVoTbSe mJu2qTtWAKZmvSohT/cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmulw-005ySo-35; Thu, 13 Apr 2023 11:05:48 +0000 Received: from mail-he1eur04on0605.outbound.protection.outlook.com ([2a01:111:f400:fe0d::605] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulk-005yK7-0n for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:38 +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=dqWvc8+RaG7Je9rHn/C6rxiI0t6dvpok30RMqxyyaf0=; b=o3sLXsqp1FgCnKBCkLHecSrD/O2lYvyzpJEr12AYblH9fPSibJWgSe8Ik7BN9txJxEddCgOZSUdfBfLooluCojvU6vb+NJtZ8a/tXbLMIr32xmz8URVCgtjE/G4R94h0ZwIwq0jVq769SCPRmFd5VHiHaY0FMbUaTittP8XBhMY= Received: from DUZPR01CA0034.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::10) by AS8PR08MB9742.eurprd08.prod.outlook.com (2603:10a6:20b:616::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:29 +0000 Received: from DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:468:cafe::d) by DUZPR01CA0034.outlook.office365.com (2603:10a6:10:468::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 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 DBAEUR03FT012.mail.protection.outlook.com (100.127.142.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Thu, 13 Apr 2023 11:05:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 528df74550c8ce9e X-CR-MTA-TID: 64aa7808 Received: from b9cd96f8f1b2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A7DB08D3-15C8-4709-94F8-98540EE93BBF.1; Thu, 13 Apr 2023 11:05:21 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b9cd96f8f1b2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N36xWBKmCcPgcOEWbx+RTrHyAzX4sn/s5v/iiDN1OfQV+YUMJEBF0AYOmO/DRmffR9iCKODW3cKIOFnpNvwSqXZQ7+vUxLrb8Fiu47OrgRGxAeafPZofCS5JQfy0B/6cDhoTtI8TwM1G7yEGn1cG9MBejmrirg7da25EXuZu6D0XtMu/aJfCSpgK7uilIiS9a1MafE00MNhknsmhCyTug+bnKuN+FFP+q7zQOYNoAaMLNcEzEt1h4v2hzRJ0sbGbUOOsP6Kqt4xjvOSbz1Yg4Ez4wnsI+laLw8MrAPJfemU86kcATWfBzdMbWhuO78ayQ/Myr7rbHUKYht+E8Ydd4g== 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=dqWvc8+RaG7Je9rHn/C6rxiI0t6dvpok30RMqxyyaf0=; b=Zh/sQcZ50AACBEmr1essTZBXmFsZYlv5E942TQTdh4Orzjx/0BpKhntMyM6bVFtb/FPncqqf1glzx9YZr+1fGAYZArxoaLIVlqhWkxr0heIQyvWza4FXX5ZYZLtww7HXV8CQBm+fuyz4LtaSKyFB9YZiXxmI+27oiCE7kU1mi9FmR7si/+M19UfLgJl/ggD4D6K300mFqAttjLdDDTRrtufO37vBsA0TQ2+tVjMUBkBU8W7vTDRkSNgyBmEYMh46dbz0Hr7PJlUF1MLtQdFcufLgDuo616m6J1lE0MSQV+RESG82wa6kKOwKeo+YkKkkIsGwEoQGxztknAxuYKD9tA== 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=dqWvc8+RaG7Je9rHn/C6rxiI0t6dvpok30RMqxyyaf0=; b=o3sLXsqp1FgCnKBCkLHecSrD/O2lYvyzpJEr12AYblH9fPSibJWgSe8Ik7BN9txJxEddCgOZSUdfBfLooluCojvU6vb+NJtZ8a/tXbLMIr32xmz8URVCgtjE/G4R94h0ZwIwq0jVq769SCPRmFd5VHiHaY0FMbUaTittP8XBhMY= Received: from AS9PR06CA0451.eurprd06.prod.outlook.com (2603:10a6:20b:49a::6) by DB9PR08MB8409.eurprd08.prod.outlook.com (2603:10a6:10:3d7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:18 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::6c) by AS9PR06CA0451.outlook.office365.com (2603:10a6:20b:49a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +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, 13 Apr 2023 11:05:17 +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, 13 Apr 2023 11:05:16 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 05/19] arm64: cpufeature: add system register ID_AA64MMFR3 Date: Thu, 13 Apr 2023 12:04:59 +0100 Message-ID: <20230413110513.243326-6-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|DB9PR08MB8409:EE_|DBAEUR03FT012:EE_|AS8PR08MB9742:EE_ X-MS-Office365-Filtering-Correlation-Id: 616cabd2-7504-4c87-8cbb-08db3c0efdd1 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: QtehvfjguUrUd1sZSjhyMre+i4pUvwWXLg7Zob25GNw3FwuZtYz2FM5RdLYb/CUdJ/YrC7ebtl7Bx410qqHRpyaNFNspA3vj+kkVAu0LWDeotsN4DQ0T2V7srpgXqFJSMTIaXT5lDFMxHmvSDs+0phrc5skLYKHk18jAQ+q2bmwJrIWD9ZPlRoZ46HFZ6Fz2pd4G855aEVtmf1XW1vJRcsvAYJvANguRJnxO84V6AQWoiHf+ALbqg+d8MJppCU/a/NrAAXhoTJo8/gj923YdUD//UasvEJQbzoeyPZ4q5UUJ7iPEOrBtB0x9hKeVqldVLfuceF6tiyMScbdeTWjFGnh7tyG4dO5ES2XTCOtRpICDCPfC0oBYd+1Ol73734JxALZYUKBDuA/AzIXx2cNZZQG/bFzgcSWq5DMk8g2U2IYNqImXWBodbuOZdCaCjoSB5gZA+H1c+qvk63j3eiGfjV1IK7faEBp4NOTdG/jXjPZapNkJqYgOimTBSw34KvCnM8SXzm5XWi66T9h0QmZ+H2qQCVTssJVNsyQAqnLQDseoaq0Xi4zBqAInVa4gt9bPBr6sr1QZ7K15csyayNgAzvYpOETU5bp4NSoFry3Ul2lcttj2auye4yBNiJmrJm9eFtAg5PBWhneTiybnRf8TtpbPfZsIQtovpGru+wytOPZA7ecdJj2mc07Ao6cKuBUX2jbvZz8ZZwhpWeRZPXK1EzMgghMySag1kZntCg3dmR8= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(86362001)(336012)(26005)(426003)(47076005)(1076003)(83380400001)(2616005)(82310400005)(40460700003)(81166007)(186003)(36860700001)(2906002)(36756003)(5660300002)(7696005)(44832011)(316002)(8676002)(8936002)(478600001)(6666004)(54906003)(356005)(70206006)(82740400003)(41300700001)(40480700001)(4326008)(70586007)(6916009)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8409 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ca33d470-de75-4165-9d83-08db3c0ef7dc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NoMqgMHoUWaab2DwGWwjsw/hSzNt821YeuoITum9PvGeZZZfIULkP3Qqg9w7S41ojnDvJLU7GzFiR7cc1odA9PpdGmfusK96/uhy6a7in5Krxy7FqvVT1ApKw/sWH/CNJYHPG21WFzQoSkbnwGyGhDQyQl3mrGYmybNu8TId3AFyxc1nB96BnN4CYK9AT31F1gpvEmDlTPtAJsjYBulimxaNjmhop2kp/TJlngz4Usn9hDeFAz0CBZS7w2Ln9zZnFnBSgEoB9coUsiCsnYsTGkDGJhMs9Gset9W1dO6D+Ml4xZM/f/H8bBS3fL3sQyOJyAnIuwKC729qa2xFKMGB4T0S8XHWyckfyz0jANndWdvgC19chrCP+PNmf1IgjfDlaXiH0RAx9BWCasB++r3EmdHhrlVYgWy1sqX1+4Xz6OzqJDzOm+oB/Cl1zQz2pQLs2XlWvmGdJvU0+t3fYTyGSMCCLRIqNpOCqTQz7KksnaZoXhKIRQ88oVofCAf2o/UG7yj6jhbEOk/RtvkoLexPKp9I4SwQPh+fipmQfrOWZpFgH3mx3z7OHeUXXoDiP3aXSZNuVoQF0TWfkmSc3cuj4cqsySizTlBGVunWu5+snxyW1CKd6I74HKwxVQZ0hkEfw2kr1VWIZpJt6b5QNjq1wHYYfVgiaBJLqUcwNQVJELCgmjiS/fLG9344vTn6W1MYLxR/a2gA4dhCw6Pgbow/5Q== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(426003)(40480700001)(5660300002)(41300700001)(86362001)(81166007)(36756003)(2906002)(40460700003)(44832011)(8676002)(70586007)(4326008)(8936002)(70206006)(82310400005)(6916009)(83380400001)(82740400003)(2616005)(47076005)(107886003)(186003)(1076003)(54906003)(316002)(26005)(7696005)(6666004)(478600001)(336012);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:28.8478 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 616cabd2-7504-4c87-8cbb-08db3c0efdd1 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: DBAEUR03FT012.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9742 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040536_448477_CFF4C20B X-CRM114-Status: GOOD ( 10.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 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 Apr 13 11:05:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210138 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 49167C77B6E for ; Thu, 13 Apr 2023 11:06:55 +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=nyHc2uqU5+5kvKyUdgjUr9A+z3c02uHMVKSijroX2ZE=; b=uG2ASmpErBWsAl 4I1wuQnLEV57TArKrPJi2qocRp/1uT9gYdGBcZVGkIB+sqexyIKqUys6zsHlLY8ZiVgI3AvRh5Qzc oASbomExNi6RaSL1JrRNq5TgkamRJBlAWDDerhCZC+0b9vtU+VHt19u/A5P9y1geBkHkqt8ZE24TF Comgy85I9w3o+K3GJh7qXUYfQAaSGMwdOEDXaPNdUsfE3F1YUonHZGzEOeqdveIHl39GnCRXWjodV VPnaIitRfEtmRcOsS6FKmgk6vLNHQeKOWRif+Ofbfhy9dMPlvrQ7yCIsaf0LU+tMCPnYBJdD3NSUW 7eTYy5VP7mRh3ZMMpAdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmuly-005yTZ-18; Thu, 13 Apr 2023 11:05:50 +0000 Received: from mail-vi1eur05on2062d.outbound.protection.outlook.com ([2a01:111:f400:7d00::62d] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulk-005yJx-0m for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:38 +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=fcqOk+s5ZRiIJ1uQ0LQ9DfzfSekgAsjUhR10wRL34SU=; b=yyPkccbdDyMEQPeECPnGtin7YUWlv4/OSCE5HIEoFdGkvG0EN0mJIrXh5OkxTvw2JhJLLPqIkej6EAGF7/uGGtl9eBxB1jDyGTyY2GZJAe6wYeP8kqtTY3U9MdX0kJDT0Q+63C3gYKhbm0KCgTSVptqEiIWZI8qIVUXVByMAQYA= Received: from AS8PR04CA0121.eurprd04.prod.outlook.com (2603:10a6:20b:127::6) by AS8PR08MB6728.eurprd08.prod.outlook.com (2603:10a6:20b:396::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::1f) by AS8PR04CA0121.outlook.office365.com (2603:10a6:20b:127::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +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 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 13 Apr 2023 11:05:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8417a70af3cba965 X-CR-MTA-TID: 64aa7808 Received: from 737378e1e6f1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8F16DF74-33D8-486B-AA13-49235D5418B3.1; Thu, 13 Apr 2023 11:05:21 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 737378e1e6f1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S/WLtO84AiHcnzesWKbjPT6sdo6K+XcGFohtVedolesNuKpY6XbKpcQ6bWnrWqACoTlwDVyuneAbW+PoDQqnDvqD2i26dWsrVsGhuuD+HC+lM3GsFrEvicIgou55MXyRB3GV6byEOC0096A4wGUywEdGARhR8EU1PQqb8MA5JsJwsF12p1KgZVL97CeyO1sahPJzy3FD4FEUmdn8XyTufT3pnKaf088G7rk4p8hMicWeWljoLmWdJ2ezpC6Adzl5sgTK+ITy7lOw3hHBpkagNfsxs1Pu954fUeTU67K3mKAKr+KSNdpHmEnsDfFRTupf/tiq3kDAGqmQyurY1aYXTQ== 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=fcqOk+s5ZRiIJ1uQ0LQ9DfzfSekgAsjUhR10wRL34SU=; b=expyig0dgqh60oDSgA+pn+WUxoAVsO8s/r+bJ7ANGl1F4BDe4hwF8w5O9cn82VRoyIGOxe70DrWuUptGFLSY92EZLJtklGYcLEniYbHf2UUprdraqBg3Jm/kazdRc/+3s28cx7M89zDJUmFjS+fpXe4gbr6MGq7oYQKwncmT3JWT7F+tEOWTqhhm40ZsOTCgy6lfjMvwK+40BZucrhg1fOVI3uyL5wfioVuI9C3458WAyy+j6Udh3zDHu5V98P9S7cVF7X8vUlN9+KQ41jk4thZwJ63F5Ho/NimFC0h7mykXgBFXXBU9/pKWEe1Ldj86PNQY2zkGXxcTUbBsM7YGpA== 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=fcqOk+s5ZRiIJ1uQ0LQ9DfzfSekgAsjUhR10wRL34SU=; b=yyPkccbdDyMEQPeECPnGtin7YUWlv4/OSCE5HIEoFdGkvG0EN0mJIrXh5OkxTvw2JhJLLPqIkej6EAGF7/uGGtl9eBxB1jDyGTyY2GZJAe6wYeP8kqtTY3U9MdX0kJDT0Q+63C3gYKhbm0KCgTSVptqEiIWZI8qIVUXVByMAQYA= Received: from AS9PR06CA0479.eurprd06.prod.outlook.com (2603:10a6:20b:49a::28) by AS2PR08MB8830.eurprd08.prod.outlook.com (2603:10a6:20b:5f3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:18 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::d6) by AS9PR06CA0479.outlook.office365.com (2603:10a6:20b:49a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:17 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:16 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 06/19] arm64: cpufeature: add TCR2 cpucap Date: Thu, 13 Apr 2023 12:05:00 +0100 Message-ID: <20230413110513.243326-7-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|AS2PR08MB8830:EE_|AM7EUR03FT046:EE_|AS8PR08MB6728:EE_ X-MS-Office365-Filtering-Correlation-Id: 96a772b1-7b09-471b-abb9-08db3c0efd5e 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: NrBn0uMbXch67Buim9Mbgjrv/aibjUTBJD8UBeslWrblksIONq2bzV1RoWNiEDRBeK0XljrYFI1JjUUTd+KQpsDliVRrhePW4bP/jNsSAwtXQpZAxEgENE65OBkiXicNfKg6rjIOrXN3iv7WRp4asNwosBU/FiK4VOMwaxQWw9maVM9BKl93qaMnzDFpEbs9WL0OaRX6S5/ioTeJRE/xGDm7WS3k0dNvB8wnkPqsGcDo23iJc847yw0153+55JiBVQFiKfXGZ5cdCbTivfxWrhNJRyXC32Uyhnqs/NK0ZxhZ9/5fqMCxPvPICCxftTCrPlVhvVltXZnXH4vNj2otUoPvPm22/kZ6v8Wf2Og3k0B78377IdET5TYRPfRfSXixBM02C895h1QmArTF/adDOo2Y+sZQ55WxGe5jGRPBYLpbSh1/3PakK1L6LxsuHfhAakQ4aXdPFYO5NWxHx4gIPcOJje38gGZ46BNhOW9X9P0YimGmSeJ/aoXtHHLR0eN7rGFOnqjCLfycjAhHXkOIbWan21tSGE/oH1/cuvhtxwPpqsF3JVmuf/Pyrg5J6WW5hSM+YTuwPex8iTwjKx5nlRqYCK9xaoul0npEm523C1mvFugOTuurFZuSCRTfzocYMft6x5CSVXp+napBPBToXYiA+L8Ym9xlPH0V0/T1hv0ir42FaLjCJ8/VlR7GqmZ4GfRZvtj0ws/fUiXmFMhCYexRp2ORcN75tq4jqzNIyLM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199021)(36840700001)(40470700004)(46966006)(2616005)(8936002)(44832011)(86362001)(81166007)(36860700001)(40480700001)(36756003)(4326008)(6916009)(8676002)(356005)(82740400003)(70586007)(82310400005)(5660300002)(70206006)(41300700001)(426003)(336012)(40460700003)(54906003)(478600001)(7696005)(6666004)(316002)(47076005)(186003)(1076003)(2906002)(26005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8830 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ad331f42-9b16-48c4-1652-08db3c0ef7b4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6gi86jYcH89ylUrgxxZsJ3lTX6J40BAe6XEsr7rO4LJP9vDeqTNOFMdELc4cE/t187WFGVoZeL45ccjKjrvV8fG1qetoE4iCySsTGJ3DJ/iPpkrW9uvUu4px3KDDRQPlJAz6Jm/uZk+nAxalUfTChTEM3Srobdw357pJoaEifRM3IMKua+GKA2NHN2Kk/S0XmiS5PZkRy/KGZG9KGMpxGEuBx6VgRXOCps2uWfI1J7HAMcRScNC8lClt7J/fOEX7pB4WOd+ez6dHeSAtwc660PygmKioWAJpCYAKycMe1XyZrcIcPoLrjd4G0VxguM5fkrFEybBEzzghpUc29NirZCBY4vuLGKlz6EwmTzj6bjRbccxOrdynkCgQhbquCt+Sw6QSRbA7aqeRwjqIbJZ9YXWHIyHkfQlrDXF7kRSyo+IoRC8JwOGOr/kWX+w5KVA88NPqAytSPny9wUD76p0Nx+BT3ZLc6kujin9LIbgrlCGQ2U41N1wL7FRbkKQ1CddkeyJx1ovwaNEN1Yvz+T2kmBzMWOPXtetYUSprj4LyV3UvUX31OOQOFi/Np0zYtFsoZTYOmMd/QnS//rXk7aStG1KTMr/x4h8atKe0F0zcBt2WgQSNJ4TqpsTfV/GiKZtjkVJ2eOKiMBH7eS8BdKt4xdn0O/C8EzaM+Aio4v+XUNcNIAmYexs+kqW16aK/Zj+AMXk2d3qDpwG5o/6bd33ZvA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(7696005)(40460700003)(6916009)(70206006)(70586007)(4326008)(36756003)(2906002)(44832011)(86362001)(81166007)(82740400003)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(54906003)(1076003)(26005)(336012)(426003)(36860700001)(2616005)(186003)(107886003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:28.0168 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96a772b1-7b09-471b-abb9-08db3c0efd5e 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: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6728 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040536_287627_51A7DD09 X-CRM114-Status: GOOD ( 10.05 ) 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 Reviewed-by: Mark Brown --- 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 Apr 13 11:05:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210139 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 5D28CC77B6F for ; Thu, 13 Apr 2023 11:06:55 +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=piIcfepJBcnejPspCFWkqyev4boCKjAJVeCG5Myiqss=; b=wYNuslcr6pJ7rP bUt+Qs7Z5ZpOi+pStfr1RVV/hNW4FpV580vqWf1QJIeZb5SesfvgH/tLNeJodZv0iQEaiGtoyqmfg /lSH/XizsIYJdj2Ncx7qYdKe0+wkUGlbfNGWEJoLD7UyEkd6QTs1eK5Nfis0yIWAwdUpuFjqZA/Vd HtZxWBpMtqJFIvcPzekIXt8/ymk3n5AIKRQx4KtRgnvebeB7ahEKbXrqNCF9syCxOj1TEXXtoaGnD Pxy7OuYJAgVoS4xR9mQ9QS/aVoaLOEorjSacFWjQQgYbyT6NYhe9iukd8qcHVz2ZjzRzBamMuLNpI h+++DFR2/x64bp84BLew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmulo-005yNu-0G; Thu, 13 Apr 2023 11:05:40 +0000 Received: from mail-vi1eur05on2062b.outbound.protection.outlook.com ([2a01:111:f400:7d00::62b] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulj-005yK0-1u for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:36 +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=bRm8+xVsh8OD+XCzuLOP8yAsY93LRitiHF/BC0EWlL4=; b=kdIBc41YjnG1I848X3QKQQ1xvRJ28R1AkJANBlj0h2HtzK36cr9UxI6KCk/JN75hGENXyzw6hOyZsuXm4wDg5p5AgO91B+3i+zNVMI/sLfswmxBYiGxC0er7hM/oPqM1hQ4bqS9joVuaf263Hwvqt+DwTmxOZvPR6/zs5Kfqwvo= Received: from DU2PR04CA0325.eurprd04.prod.outlook.com (2603:10a6:10:2b5::30) by DB9PR08MB6665.eurprd08.prod.outlook.com (2603:10a6:10:2ad::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:30 +0000 Received: from DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b5:cafe::f7) by DU2PR04CA0325.outlook.office365.com (2603:10a6:10:2b5::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:30 +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 DBAEUR03FT061.mail.protection.outlook.com (100.127.143.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:30 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 13 Apr 2023 11:05:30 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f282351753bbbcd0 X-CR-MTA-TID: 64aa7808 Received: from 7507a6ce28eb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 25414EDF-DB5D-4987-A495-55EBC5CD8AE3.1; Thu, 13 Apr 2023 11:05:24 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7507a6ce28eb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SWsLadsXGooLdTTv7Nf54fns8EYlhU62Ix1QRt9hSnpCpZ3+aNKTBUQ9OrZldmyHlEITqowg41Cp3Et89MrO1h6DsMQjA4yhqh6aYqyI4yaCXHQ5XOC6jAyY7L6Z9w3tgRiVqr862KMdGVHIuTsIrh9euK43V4mDOilUfVoq7Ze8W7FLJ5nDH79NFRBiWLvcirUxPW8V8HMNg8eo8OSC+q3LDvsuO592vRvdUe/Dp+ZIQnIFVDKgOepLzTnf2QNWVy5vVmvS1hT/Lc64/GyNbL04j4UNbnBjzJaHsx0yaqRlxJiFhAP2WHka2SaSZrcDaAtUki3m9vi1IVhz5ilFuA== 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=bRm8+xVsh8OD+XCzuLOP8yAsY93LRitiHF/BC0EWlL4=; b=M/rbdcGMlS5XSe/rCuE1e+TbTI5ZEfgGG3hYYgAigm9TLxmGXms+o9brrIiqRNz3ZkRsHdLrzDWwCHGN9P+HsGb1yi2g/uXexd+v0HppXbiwtwa7d1jrkWz53byVkDKR+VgEMtALITYtSgvjUxlAyGg/a3kBrDjtvD8bi0c6DxrUe4kqt3+8J+k6R46A9fSr9MyuzfzTMUPmiKQTQrWQQ8SyE96or/STp9mBzHMs7obT/HIITljgK1uz+cf4QK5Um+vxgjd+pAJpQn8ROXd3bssve/iwqkbA+Mzrht+mfvsP56N4ANpJ8jtbijYeTiPuTnu9dS0JplOg7o81qVDAMQ== 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=bRm8+xVsh8OD+XCzuLOP8yAsY93LRitiHF/BC0EWlL4=; b=kdIBc41YjnG1I848X3QKQQ1xvRJ28R1AkJANBlj0h2HtzK36cr9UxI6KCk/JN75hGENXyzw6hOyZsuXm4wDg5p5AgO91B+3i+zNVMI/sLfswmxBYiGxC0er7hM/oPqM1hQ4bqS9joVuaf263Hwvqt+DwTmxOZvPR6/zs5Kfqwvo= Received: from AS9PR06CA0476.eurprd06.prod.outlook.com (2603:10a6:20b:49a::35) by DU0PR08MB9463.eurprd08.prod.outlook.com (2603:10a6:10:42d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 11:05:21 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::93) by AS9PR06CA0476.outlook.office365.com (2603:10a6:20b:49a::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:17 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:17 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 07/19] arm64: cpufeature: add Permission Indirection Extension cpucap Date: Thu, 13 Apr 2023 12:05:01 +0100 Message-ID: <20230413110513.243326-8-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|DU0PR08MB9463:EE_|DBAEUR03FT061:EE_|DB9PR08MB6665:EE_ X-MS-Office365-Filtering-Correlation-Id: 86d59821-8930-46c1-6b10-08db3c0efe95 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: OpHsrfnLjk6Vm9L0EQSqN+xnksSnN5jeuDJKFddawp3+I39ZuVT3vzDzX+BXLGz1VP0QlHhWyC+33P4OLzt1V+8oLYe4rE1S033X/zk7zHz1mIN0ZV8/WfLsGHyJfYM+mjwRGNYqWh9LPrW79MtgRBZWUSyvPntFouQ/cEmzZLrqXhs+lyFjhdIcQXNLICPo8ckzumDhdwDfw+K2HzuN+zIUBA3ljFMjZv/JL1OCnAX7qnO0Dw7fGBgigX8U6LMW8miwSv4ukqoi668JgOR6WUrOeFK+3/iE3D3VuuzL46QvUIH71r6hf2q6qNNxrs4Yx02Eo+OXDeQrDerqvx2s/YYAvb3ISP14YeU8Wrc59kIT+o9m0/+wt1sA6Y+PyLOXFjx+nC0Nq3Byf0OM3ojC0jF0W6xl1YHVI+DmiQ+6r5FbH8lb4donONk5+QIscn7/+Ix6HNbLY5aRaWJssyrTQwxzeKwwdGRvXNHrjQv4WEz90MatUoK7kkY/rcpPTmq7sf0KiL1yCxUcFRoexKD2VsGTyVjXdXXYc2GR79c0zSdGVxko4kT8xdI3LIGF8xdzGQ3KXizAErCURdGfHQ0KkyMcsM3pKN0ZlNItJ8AxUaRYuiYB/0qlD44steGQEF1EJGFxSY0jdVMNKX6ORFJjh3Y+dXoqgzs5EFKrfec58wjjtB/yptpET2Uv5QxGaPCGBsSTRv+Qvi5Vp9q3QO10n3XW3K9fuvPmWPhVuBgJ2Hs= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(40480700001)(7696005)(478600001)(44832011)(26005)(186003)(1076003)(316002)(336012)(36860700001)(2906002)(70206006)(70586007)(54906003)(6666004)(82310400005)(41300700001)(5660300002)(4326008)(8936002)(8676002)(6916009)(82740400003)(356005)(47076005)(81166007)(86362001)(36756003)(40460700003)(2616005)(426003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9463 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: bc6f28ed-036a-44df-378e-08db3c0ef942 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9a1duxil4v/cq32WSsyLjx2Gbs8rmSg44MIRWSu3k/DOGJOD78gboTf0JPHcsVTDc9AnCsPyfi8Gwp+FfV0Cm+yiv3Ts0vRYJaHnnA2KSvDUu5IYgcRGup7Ur7GxV+TUuyEyIAQuCMtH8f1iazd3RbkunJivn/oo9IpPCwImqlL+dZwyHUk8+CH0hrREKBCjtMGmXdGiiyzCeR62aXjfVvGbqTEy+cASo2TX4LW8/zz0aqpc/eMSD10AP3zHk0xfl+lv8PwqRtma6dqJb4QbE0lcuGABwvBAFPqkoLCFs1abZnY2s/tSpxbF11HQIoUTa28l5iJME80N9RUVnnwKbkGnIqrePr5Alzvq0rZbDqsw4dq1PGgk8VunA7fkIGOOcn6pdqAgHemBZfmfpbz6ejPP3hWJkht1qgTwQF7aUFs8rHliBiZXhnKsLFKbshdVCNJPCwp/ziw9K6bZFD5VezxiWaPvh4wHLM4bdJVS+w9lIOb83ho2iCCf96CajAEI4rt3AVvBwDv4bVpeFnbD5Fu38NClX7wyJwGVEzaNZHH1MOj9iDP46Up98eUG8QImu9ILIlebdIY1CLkLtt51kwC6Z1l0jOHT/98RLOUSSvVFF98KkO1Bt7QNnT04pgd4Wl3R/3Qe7SJFzvnnHCtQkRpmesYogfHJZ0qG9S7ERO5ioA/GfAZwgJC/nBv259RaIxw+YsQ4wMbyhtfMFLI0uQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(7696005)(40460700003)(6916009)(70206006)(70586007)(4326008)(36756003)(2906002)(44832011)(86362001)(81166007)(82740400003)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(54906003)(1076003)(26005)(336012)(426003)(36860700001)(2616005)(186003)(107886003)(47076005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:30.1314 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86d59821-8930-46c1-6b10-08db3c0efe95 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: DBAEUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6665 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040535_630875_885F77EB X-CRM114-Status: UNSURE ( 9.55 ) 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 Reviewed-by: Mark Brown --- 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 Apr 13 11:05:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210141 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 ED0E0C77B6E for ; Thu, 13 Apr 2023 11:06: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=1AXfSteMLtuPZ64reLFgZ2Kp/WbXmWILTLlrEs4wnoI=; b=rdbLjwW4wxFxxZ jpMVEU1fr9RwebMMS6rXMyL69O28xzIHrLlGid3/0AlKNpIFa0WJUxPAxj3BqQ8WEbpSFSM6iP81n 9474unQbOrOd2Ic/xzRjCm8nKQPcdDZoyZPytgxylTeHeWUOUB8S9hj5pQxKZBlYYJPyTh1IwNcqg X7FBotke2AcWjQDur65fPd3tdCk+j3BToLrYYZ/PFB0tBpZPV5ODYoySQYyf+Kj7CtvuissIjmtHS raFP4Rb+oEf1OWP6mtbgXPej965luhQ3lYBZIu45NvSvIHYS6aZuNqDsO2UWi1u/gt4mIR6tFeNWh l9yNGH3j12x1/MnfZ2sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum4-005yXe-2c; Thu, 13 Apr 2023 11:05:56 +0000 Received: from mail-he1eur01on0613.outbound.protection.outlook.com ([2a01:111:f400:fe1e::613] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulq-005yMe-12 for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:43 +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=O1t0EujhGT92ZO0VRsbSyVZGLcHrVw9/yL7lh/S+z7w=; b=ftoASo/RpTdqIIw18M4IR3IM/ay9+m/dMRPnsNIiNe96rCAPesAOqkFhhWynNgMyxoKKCOUAf88FUhSEe8XSMQg7h775Wv3FcbsnjC2K/COc9K4g9ioCo/yUxVIG3eZKA/GEtfBwut3GctZeQtzapBkOv46nm4v8Y9CFjuIU8vY= Received: from AM6P191CA0048.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::25) by DB3PR08MB8817.eurprd08.prod.outlook.com (2603:10a6:10:433::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:33 +0000 Received: from AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::7d) by AM6P191CA0048.outlook.office365.com (2603:10a6:209:7f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT055.mail.protection.outlook.com (100.127.141.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Thu, 13 Apr 2023 11:05:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a2f678f9e9c1b3fd X-CR-MTA-TID: 64aa7808 Received: from 0691915492d2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 47167538-9191-45DA-BBD1-1E3C47CA1E0E.1; Thu, 13 Apr 2023 11:05:24 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0691915492d2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mQDc1RGZcPhH4k3bI39UuTWENi0jakXIVtUjzpSvyRJr/5cboeWaj9Y643B20ajqDhHpk3KfqVc274nCGePOXCHulG0DBVmLr2rduO8h5sdK4hHijcvvZzl+bnqd70pl7e+87++dJljJjqVWpgDiCR23OI6MDdCD5Aw36GZS3qwcxtaPc+fcQCIdZmthmQYsg0brMjJACIH0xCcXzDHP0+ygUm2KxM1JD3fJ4RJRRXngMVMWyx/y+iXVJzUwezDfN9fRW6N31GfuzvXcFWA++us7smaAZBf4kBtMnv4+sxkIk0eok8zP8gqkSu8wuGP9yt6D/lRj3zDTmFPcKRWyiA== 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=O1t0EujhGT92ZO0VRsbSyVZGLcHrVw9/yL7lh/S+z7w=; b=L/hVxFwfkZDr3eMl6bPRCLjSQPLszJ5XRaiDJUHe88RWsCCKR+ffJC8BAPJIO4Y/d6oxzSn83N+/UtfeG0dykstg5XVtjHfMhfYa3e7kbS2IRlznETnAa1ryZhfwwQgq3rSW0IRXG0gjDtQYHewNvxqj9DEZTaOx6Bmd4Kui2m4RvETrrv/Rrgb3nHjPOfFfoWmVLy4atdWnQEo+zsN8QFlBgHVj0KW1FGEEvBpfOfVPcogqYJDVfKdZop88PEzCpHVtxasPoUj/epO15Y78uhx36MuYrciGZy0jWaUnUbQVFhqcY4r2nsdDEUdefqUunzE8ZyGoj0DqV8gN+DLCwA== 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=O1t0EujhGT92ZO0VRsbSyVZGLcHrVw9/yL7lh/S+z7w=; b=ftoASo/RpTdqIIw18M4IR3IM/ay9+m/dMRPnsNIiNe96rCAPesAOqkFhhWynNgMyxoKKCOUAf88FUhSEe8XSMQg7h775Wv3FcbsnjC2K/COc9K4g9ioCo/yUxVIG3eZKA/GEtfBwut3GctZeQtzapBkOv46nm4v8Y9CFjuIU8vY= Received: from DUZP191CA0039.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::13) by DB9PR08MB9658.eurprd08.prod.outlook.com (2603:10a6:10:461::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:18 +0000 Received: from DBAEUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4f8:cafe::37) by DUZP191CA0039.outlook.office365.com (2603:10a6:10:4f8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +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 DBAEUR03FT004.mail.protection.outlook.com (100.127.142.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +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, 13 Apr 2023 11:05:18 +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, 13 Apr 2023 11:05:17 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:17 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 08/19] KVM: arm64: Save/restore TCR2_EL1 Date: Thu, 13 Apr 2023 12:05:02 +0100 Message-ID: <20230413110513.243326-9-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT004:EE_|DB9PR08MB9658:EE_|AM7EUR03FT055:EE_|DB3PR08MB8817:EE_ X-MS-Office365-Filtering-Correlation-Id: bea4409e-de51-4628-ec2d-08db3c0f0052 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: Jb/oSotklt7XP5kO63L8F9FiDimxRzLGXQJJ0cUQl7wWVgxEEkvhSaTWJGlIn5vBKki0WIWCI4BpHDnpaKJdtMX6OR1hy/BdSi8yY6GcX7m5sBqmK2QjG4KdN/HqXHmT9eDq4XRipxTBN077TOEYZZEVemmU94S+iVnRdehqRk1i093EZwOcXo7PM/83lOEpxuvqUWDm8SFpI/3ClqUXpjH3HR4uas80n8KHhZguKY2EWXY2hDIYdyiL5DJDkpCJGlFtShPR23fZz4r2VBANGoJdX2SnMx6MqF/vjs+shBZMYBoC8V2cFcD+Bgqrr4ZggMhdKzROlyWsKQNVVs9S2/dQ4N0Qso6PeMOKj8xtwKajmSzBDN9IXAU8tE9Th6RuauLLxc7wBLhgzRTn3YDlr2IL+YkonApq3W8CB/ljcWArH93d8uoh+HfrvP5Y0kGVGoXr9v+OT++Lr0UxhfdzuSQrXJBvyhKzpJVLTL+ytdA6ZwwCUA9FW4a5y17j0DGPlMQ3wXdgt5TAtaZvq0vOf//zAGxvg6sHqDE96NtZkkGp7yKezbDzgnr/QTuHE6R9+EhCPu4w2+LQeBDhGR5h+G02fqmDLJOiK44mUiiuHTn6SEgSw6LSvcZ6MyT/+i6q0Nivp73/f2zlL5BYAMJhDFntT0tiKuEy+h3sfxFWBwlNOmpguXbcYTkuJZ3Dv9Wnt+4dS7HDXmbC4FLYX9xha8/KB8hukM32/gjpddaxqZk= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(376002)(39860400002)(346002)(451199021)(36840700001)(40470700004)(46966006)(316002)(6916009)(4326008)(82740400003)(70206006)(70586007)(2616005)(47076005)(426003)(336012)(5660300002)(41300700001)(44832011)(82310400005)(7696005)(6666004)(36756003)(86362001)(40460700003)(54906003)(40480700001)(26005)(186003)(1076003)(2906002)(83380400001)(8676002)(8936002)(36860700001)(478600001)(356005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9658 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0a1ce1b0-3120-4b40-f27b-08db3c0ef7bc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: akzFWDdaaOtqIvtVI2Wu69XqzaH0kdMWED4VdNNLk2IZC8NudrQp2YiiQTm7QbiZnNBX15h28N4gLBLzjUdBVG2c8JinCEVr6ZUpfk2ANjjLq6ekh7eYx5cZL30tQrZwBIuj5FC+jo3I3Mn8lHlUy1cta8yZpqfs/G0u6M/lp+qOnWhAPMINpaHUQWpGCxIEXrEYTEzybryxCY5hH7a55Mo2+TDipj8vX0jtPMNtL1imLuMUGt7KMFRmrrCXu/qAQ4ofawfy3eUNb9T4BCDtCXD15Ul8hOJpLW2yqeq2i8jZBVlMt3Wp61/JELCi97N4I91CthwhLvhvLUqRUg9TpqURvWq4oClIpUr+XdwcQyqNsstvWk3LJlrZPJQ/umf3iKh84O8DbjjrmbCe7MlVJiX+Eao8B3T0do7kq3uZLAy0nn/ZKsIQnziaBfVc65oNT6ycuYlBFHpp91I1Pa8G2HvHv6SDN0fK2LchsBN8sDgKfKqd3vWQUWmp13IQ0P1zgW09w93YkiNpoMS+qcxrSJg2KvqHWhWwGXvGfslDaITLnOSIb9RDNqCXhBiFF//d1XNgo4bNO0oPkI6YtC4luWvYigjbWWjaSyRtOSytS1tZz4i8tnuz7rwA+aL1F1VC7g/sQWT0FGCuaNY8r8G7DZNVn0vj2evxmNzfINGwzmW8V+ZMhVOaTetcHAjLDexH17tf9udWxuJZ+j91IZP9yQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39850400004)(376002)(396003)(451199021)(40470700004)(46966006)(36840700001)(8936002)(5660300002)(44832011)(82310400005)(70206006)(41300700001)(86362001)(316002)(40460700003)(6916009)(8676002)(2906002)(54906003)(47076005)(7696005)(478600001)(107886003)(6666004)(40480700001)(1076003)(36756003)(26005)(70586007)(82740400003)(4326008)(336012)(186003)(426003)(81166007)(2616005)(83380400001)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:33.0042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bea4409e-de51-4628-ec2d-08db3c0f0052 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: AM7EUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8817 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040542_376791_39353BB2 X-CRM114-Status: GOOD ( 10.87 ) 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 ++++ arch/arm64/kvm/sys_regs.c | 1 + 3 files changed, 6 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index bcd774d74f34..e1137832a01f 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -269,6 +269,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); diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 53749d3a0996..5e7e4a433035 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1871,6 +1871,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_TTBR0_EL1), access_vm_reg, reset_unknown, TTBR0_EL1 }, { SYS_DESC(SYS_TTBR1_EL1), access_vm_reg, reset_unknown, TTBR1_EL1 }, { SYS_DESC(SYS_TCR_EL1), access_vm_reg, reset_val, TCR_EL1, 0 }, + { SYS_DESC(SYS_TCR2_EL1), NULL, reset_unknown, TCR2_EL1 }, PTRAUTH_KEY(APIA), PTRAUTH_KEY(APIB), From patchwork Thu Apr 13 11:05:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210140 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 C3E1AC77B6C for ; Thu, 13 Apr 2023 11:06: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=5nH908DL+sKPJyWXFjbV64ckBPhRtAF1o9B/OhhbB1Q=; b=R6HTMEOnLBO4iY 5EleII9lQfGHqNNA3JEbGLn1cOUDvpEGmNMn3tIyr6UF4dCx1nj/qvs0Gf5W+GPnGgM50H0oSNsvn bjBbMbFEJS+96rci7KRN21suPCRCPjeqJoyv4+dHf+cTmtpKYO3Ksjekq0oBhS+9Ir1B9iEYuKcEH BFcwHdVKbGS+y2k859NFWxY+ge8mycq4fq2P6n3jfyiUiyIegWNFlt9JslW9QzP0zN3HU/opvVlAF z5Iknhf0CHW3HNJYwmq0iK5Cvy0fsQkgho2pzH/vYpUKCYRfUIQ1Gum70aE2rslFN/k7xNd43gfRI 2D8/1ol52oX9uuG66lSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum2-005yWE-19; Thu, 13 Apr 2023 11:05:54 +0000 Received: from mail-am7eur03on20626.outbound.protection.outlook.com ([2a01:111:f400:7eaf::626] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulm-005yLV-2z for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:40 +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=4u3oTOV0mSMj0K41nnJaT04mCHT3IqPCmPX8EXms0yU=; b=uH7YEHi7YfcGGPqulMANY/dB+rMI/zeIZtHK3OqAMiSKHE2uH23EFxyJeyoIwgoNJf/2/221o1MVP2ctC+4K9Nan1kMnSy1t6HMjHa8w9GZkN8FGT3uQ55EEX+lza/xKfIpy1wAvn8ev6pGlZ5e2wpu0mmo8cMx+0itJJKRn5rU= Received: from AS9PR0301CA0057.eurprd03.prod.outlook.com (2603:10a6:20b:469::11) by GV2PR08MB10354.eurprd08.prod.outlook.com (2603:10a6:150:dc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:32 +0000 Received: from AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::60) by AS9PR0301CA0057.outlook.office365.com (2603:10a6:20b:469::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:31 +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 AM7EUR03FT064.mail.protection.outlook.com (100.127.140.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:31 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Thu, 13 Apr 2023 11:05:31 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 10bdd5c6c494f83b X-CR-MTA-TID: 64aa7808 Received: from d9313f6a807a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C943BE6E-A8BE-4522-A3FD-81F5EC4D3F4F.1; Thu, 13 Apr 2023 11:05:24 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d9313f6a807a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hsRNIihMJoyMeOYhPhFG9yoID6Njeb60g6R9zNdZazZJPJveHuZSwWyCVr5zJYXCso7P4psDja7tlO5vGr3tOkdfuFrO+GQv/0ZxapL+mxHIZl6Tt8FKHiCCvJ7O7FBo9IxG7OvjwCCTPAyTwDVpDAm5sxhhkz+NcBE6ULOT4h0dQwgi3QDAnciug4RukTtagbmbXJQ3EkarbFRkvfnNZeai1rwLxG3I4ZizGyHKWM5iNkLOvImzTYSIIu98f1LSDNaUTLGgPZrlA5dCvECiYm0dC3L5C+AKLXHl/QRFxFMMxbWHxkm5DJdNCXeDUk24h8r/keQMGiy1aGyDqUlHiQ== 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=4u3oTOV0mSMj0K41nnJaT04mCHT3IqPCmPX8EXms0yU=; b=kF1aGTj62jK5N67LKJ7Zwd1C4eMzc2JmEVEbgyPn12E/vIGG8oapcMUAP/afJ+dRoAWAKyELIpzAmEosRpexnqYcGrBkuqZSEs7TWjRTmO2xpaJUgQC7pr7o7b7cCxPT3N7dn2DiQiYHP+pKTQpxTXuLAeXb4AbSfFaBOR02wAtqpy/Uo13TswEJFHY/PqAHON2/RjaVb/WEGsTAm1EF3vpMBuFe/zcf7yMFzF2yeTaQAhmKYJi/yRZwQonAisGZwQABAxEPFTO4O+4jwxhSrEknlEYJZYToDjSKaQawjBuKGY1SnkaQEJuK4o+AL78Ddi+Ji2+XCkFtizjjJIyHxg== 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=4u3oTOV0mSMj0K41nnJaT04mCHT3IqPCmPX8EXms0yU=; b=uH7YEHi7YfcGGPqulMANY/dB+rMI/zeIZtHK3OqAMiSKHE2uH23EFxyJeyoIwgoNJf/2/221o1MVP2ctC+4K9Nan1kMnSy1t6HMjHa8w9GZkN8FGT3uQ55EEX+lza/xKfIpy1wAvn8ev6pGlZ5e2wpu0mmo8cMx+0itJJKRn5rU= Received: from AS9PR06CA0455.eurprd06.prod.outlook.com (2603:10a6:20b:49a::16) by AM9PR08MB6115.eurprd08.prod.outlook.com (2603:10a6:20b:2df::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:22 +0000 Received: from AM7EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::74) by AS9PR06CA0455.outlook.office365.com (2603:10a6:20b:49a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:22 +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 AM7EUR03FT021.mail.protection.outlook.com (100.127.140.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:18 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:17 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 09/19] KVM: arm64: Save/restore PIE registers Date: Thu, 13 Apr 2023 12:05:03 +0100 Message-ID: <20230413110513.243326-10-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT021:EE_|AM9PR08MB6115:EE_|AM7EUR03FT064:EE_|GV2PR08MB10354:EE_ X-MS-Office365-Filtering-Correlation-Id: a42b950c-fd61-486d-4fc6-08db3c0eff94 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: 8mvFyBfPtsyj0+n/sIO/edJVVPrFj/hF8Orq2n0tF1Ot7qjUk9RyPZInhSZt+WgMEIe2qBM0fCQ6NhDlYrgs+wgf14Fh/54aNdfOjLm3y2ZGIs8i2PektRO36B6W9j/TmPby/BTXlShZ0VBau0DRqWkoIPWF3yiJG4mOqr2LpVz/jth8xLpS4tmzimAUCkMk7M3cbC4+9AQ7NNW1rGKIVhMmOIjySrQPabHAWpcW8fqyqR/ed12Ox2X0hWy3DlvlXiAR3yBe9quhRTB328hvoquiYJeXvQqpRHyX70NAzhlkC5T4zs8bN2kDewU2MbZDrg2uL8+FWCsFLdGyDp5AMPU5JMmIDuh1Zv0JCXIEEwS6IT56wblwJG+RJ7nLjJJoaI265ANgT/IWJ0b9uAgki3mxDiyq+F2C3d4nYxaESAZIwY+D5KNgRG9DbUxTe7Fo1HXJtP4VsiAT5ikx98BEGtnNNTY2tfc32OgGx1VES+a/6JbY48cklojlSdLFEUBaseeoEP1pV7z0OXKkSDFDypIJJbcEw6uyR6JIBAV3Qk87Fm8A+8CvgU0tfIgzelWKEfnc9hnp/kdqYTRS1Rg9Bw0RM2EB3dAX2xDBA7X7jWAtAHT1mRc0cPeHk3inel29z7vlADE3H5pTOf1UEkyfCB3WCPTomzxw7GSQgHOHFHHwWejpHkbz9bXILVZcfcRRraCdkUsTbZHA201u+Qu5AZogWFCCiD6yCUQz16kWLz0= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(39860400002)(396003)(136003)(451199021)(46966006)(36840700001)(40470700004)(8676002)(8936002)(41300700001)(5660300002)(44832011)(6916009)(4326008)(81166007)(316002)(356005)(2906002)(70206006)(70586007)(426003)(478600001)(54906003)(86362001)(82740400003)(7696005)(6666004)(186003)(1076003)(40460700003)(82310400005)(83380400001)(336012)(26005)(40480700001)(36860700001)(2616005)(36756003)(47076005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6115 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0eec4454-6060-4641-cd35-08db3c0ef9bb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Uy+1lnLmW4fbKmshK/58gG8zF2doyZ+XIKqeBpBNhYL7FeeLgoKC67lbYGDTEgrHjRGGUAhR54mp4A2VvzjbZm0exaAa96dPSIkC7YmqM27/HcfZ4rpGulwect70iqakAiKbWSIstlpmpThu2dleMq+qecDYhPpbn+pztPhE4I8VSV4tEOn3xnelZf6hhbL61rT/Kh0UwB24yeo2sWYEqoZWw0ueIeDcc0fmZrNQQlLC/gLVkjYoDVezGVDTFRrg6EeUwRqa6e8z37Ylx8N6LkTto2WHSdLAPR2hvD2D7ISUwLpakp9dsQamjYvOuciqv86zwdO1boQLTc1BO5bQRoNALSjPT232E6Sm0ieXcJGB6jSHOqQhgzeHjtsxGG0iQlzaDSjqNvLlvy/Lind46f+G/YJh7nJ8IctW2zGQHRTJm+mJPh4WxADThpIAxH6eyuvT8Vl6ad027QbdqnXXbZp712+2FrYITJAwe1kMSQ4QD1tjjhxeAq3M8JgyNQoxFRnudwoqKpEZvyTHE3zWp1TRX3uOORn0XgnARjMUHJ7Snmeo5/47FqcuNR2E2Rz/BUuCJv910tPwWHaXZjZJmw2I4pfYpRD9j3qKljoK/wxJ3Esy4Fy5yjTFp84Uw3TU6m6aRUcSTD3BD2PnKyIjc3Oii1YQ+EMSBCuJlQr/UpI3c0u3bJl60Otu/C4o72iU28Q+HpMJUVg2Y/FSYPzJMw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199021)(36840700001)(46966006)(40470700004)(54906003)(36860700001)(2616005)(478600001)(47076005)(26005)(107886003)(1076003)(83380400001)(6666004)(7696005)(41300700001)(316002)(4326008)(6916009)(82740400003)(186003)(426003)(336012)(70206006)(70586007)(81166007)(5660300002)(44832011)(36756003)(2906002)(40460700003)(82310400005)(86362001)(40480700001)(8936002)(8676002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:31.7394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a42b950c-fd61-486d-4fc6-08db3c0eff94 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: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB10354 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040539_011480_0F4C16DC X-CRM114-Status: GOOD ( 11.76 ) 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 ++++++++ arch/arm64/kvm/sys_regs.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index e1137832a01f..381bd0763abf 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -367,6 +367,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); diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 5e7e4a433035..6e92821b0bea 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1921,6 +1921,8 @@ static const struct sys_reg_desc sys_reg_descs[] = { { SYS_DESC(SYS_PMMIR_EL1), trap_raz_wi }, { SYS_DESC(SYS_MAIR_EL1), access_vm_reg, reset_unknown, MAIR_EL1 }, + { SYS_DESC(SYS_PIRE0_EL1), NULL, reset_unknown, PIRE0_EL1 }, + { SYS_DESC(SYS_PIR_EL1), NULL, reset_unknown, PIR_EL1 }, { SYS_DESC(SYS_AMAIR_EL1), access_vm_reg, reset_amair_el1, AMAIR_EL1 }, { SYS_DESC(SYS_LORSA_EL1), trap_loregion }, From patchwork Thu Apr 13 11:05:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210147 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 ABBD4C77B6C for ; Thu, 13 Apr 2023 11:07:35 +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=LsIoxj5fC7oW7CFcr3CyrAAwfVTK6swswj4xFyruTuQ=; b=Gn6JvGlC0tDxfv 1IkF5h3YsObrhzq8iTkHktG0VwqTRZicu9Al4Wd6xhXDO2jfJ+a6JywY5oMqaN3VjCVXGyP4XCtid P3z91540sS00+DSLj/TJTsn9L7w6j6xmFj3i9udoZ0P/UzHG4YUJ178nMfNQDKCwniG6VohRxa5s9 wc020g6IeuAq26LoJYEPuZIKy4oy0xf5TYRnHc1Fb0RO3W3izG/NmqMldBoh1JIrgH2SaJEkIy/MQ Vao4W9rmK2uBVxgnlIXXnkNbBduCEFxAavIr4B2L6jkDOMQ81xrS1MGgZa01qBG4n0pGcDZG+qixX /ftjN3IH9AImdZ+mBYeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmumf-005yzP-1G; Thu, 13 Apr 2023 11:06:33 +0000 Received: from mail-db5eur01on061d.outbound.protection.outlook.com ([2a01:111:f400:fe02::61d] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulu-005yPw-03 for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:47 +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=6IG1pGvR2SOIGK/SlwDl17GiwczO7MutrOpMIXB6rOw=; b=l79ustBXfPwymdUmusOVtBQhrw+EB/Oc8Drfy+ti9JeaxGwI5K5aEiMlyQBAI08pFfU8CwsDfduuYwYqMBnocV3U8lSmgW7wWLwmVidCwEC9STwQ/HQ2fdRDgxNoomRZTMGPbF0NRihWkSsuerPW3jgeRA/J/IIviSeIpmLn3lI= Received: from AS8PR04CA0137.eurprd04.prod.outlook.com (2603:10a6:20b:127::22) by DU0PR08MB8836.eurprd08.prod.outlook.com (2603:10a6:10:47d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28; Thu, 13 Apr 2023 11:05:34 +0000 Received: from AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:127:cafe::46) by AS8PR04CA0137.outlook.office365.com (2603:10a6:20b:127::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:34 +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 AM7EUR03FT046.mail.protection.outlook.com (100.127.140.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:34 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Thu, 13 Apr 2023 11:05:34 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2ae3c030c0d9bd4e X-CR-MTA-TID: 64aa7808 Received: from 63b6d75bd939.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0439C67F-5849-4F47-A63A-DD0BA3D99872.1; Thu, 13 Apr 2023 11:05:26 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 63b6d75bd939.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6XWOgIcdh8gMUUdkyVurGku1rIPO8/DmygGhwluidZLw0AureMcLH3XTtdDhOllxISeYBDZEH1f/NeqwCW3AQfl3wGBY1mGCZ2sr2gRSJ70/rKboh+njvJ7euA2aygLK5zowrYd1eRGw4wMKdeoYg+CynlFbV2EuHEwbWj00zZ1j+lqnIXE0v3DUJysOFm0SELI8R5tbVp1KQkEIvMsTmWpcuoU0hopb++yA93M6Vb9A34/fT5z410k4NSTLGwE1Uk7brEsG5zcUSkHoSy1C9Fb7/BpgdCTBSXWFHj9VFZcnwGdcvu2TIIGO0uVlDhluNX1o22UNvTrCHQudSMh+w== 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=6IG1pGvR2SOIGK/SlwDl17GiwczO7MutrOpMIXB6rOw=; b=Uv81ubpOjMOkVR063GXw4WF+t8Mm51I42LJeFAjssoE4RuHpNz0QTPedeC7DXXO2NHf0u71CiGjGraqLEDG6eTqkSYcVaCFBZ2OIoM0DEERDxGxIyCwp0YyMCBcZsZCJtWPuottncvHKC7VDUDPDH60bRoq9aRgxeYFGx4veHE0tLDchNoJ6e0lMDYgGMrOV25X3ebdyNbDW2Vj9t9M+zQcV20Nqm4X+h23m9A5d2ZuA9+UeX7QTPh30iNWJuUIrktoR5QHqPdLjMBEGjpowR/yplc+d6YcovD9yvs29csjadqLPBV84VY78ePdcJ5T3IVUdzctGgaTKMiHk9yX5hQ== 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=6IG1pGvR2SOIGK/SlwDl17GiwczO7MutrOpMIXB6rOw=; b=l79ustBXfPwymdUmusOVtBQhrw+EB/Oc8Drfy+ti9JeaxGwI5K5aEiMlyQBAI08pFfU8CwsDfduuYwYqMBnocV3U8lSmgW7wWLwmVidCwEC9STwQ/HQ2fdRDgxNoomRZTMGPbF0NRihWkSsuerPW3jgeRA/J/IIviSeIpmLn3lI= Received: from AS9PR06CA0424.eurprd06.prod.outlook.com (2603:10a6:20b:49e::8) by GV1PR08MB8641.eurprd08.prod.outlook.com (2603:10a6:150:82::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Thu, 13 Apr 2023 11:05:24 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::e6) by AS9PR06CA0424.outlook.office365.com (2603:10a6:20b:49e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:24 +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, 13 Apr 2023 11:05:18 +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, 13 Apr 2023 11:05:18 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 10/19] KVM: arm64: expose ID_AA64MMFR3_EL1 to guests Date: Thu, 13 Apr 2023 12:05:04 +0100 Message-ID: <20230413110513.243326-11-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|GV1PR08MB8641:EE_|AM7EUR03FT046:EE_|DU0PR08MB8836:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b8df19d-c1e0-4c76-585a-08db3c0f012b 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: Pwwtz2vkSOW5mezgYu5YerPW64foU+uWP9R6DaEjh/04LDBDdC92tmPGo0KHBfqddJDTV6lSxQI2E3UfJKzuGaSX/1AttFJ5SBsKHStKP7/QN73USkS+Enhq9tQoeSKUzK4JZAm3JdBtFiBvzY/ZxGbEBrMkB4k3GckbQ4TsHiZAjNpYE1p7UFJz0x8h5ifNJlVT9tbaJDMFz9vaLL61kw4K6TziAfP3B5wcKS+7I+J/Tn2WmAWfCOFX9p9fTdts1iKBi40i6aQdt3niXs6oJ/ov74Czqez2HVLXOxx8E3eUmjidsx91N7OJkQAK2SLph+dj0u846LLpEpaacMwexVv6S2EShsY6eGVUOb79DzUE5wnl8R9JpWWhPzRtr1ktDcKhMWdl0pvulNU5j70a2tUDf7CnLcbVjju8A6xszR72UPMgm1I7OB5YJ1ksWqP+dvS/lEhsgNOBe1IJENnDJv3sF9jCipgA8a3ylAeNobcXRUZFmEhVv7uh1sIW4WfFGAwTkQYJzHvC+/olCT52DslUgjBy344QwwKdiwCSwamCtHr99cRHH0GuSp5EcH/jxBkd41tQDWRpFsN/TREDu5osdDvxPRFltedHH0l7e7OiNBCMDkGxSV93u1iXHe56BjAp6wREkP0YJGF78/LViFUfaqEsqhViy5GYaITtHVECu+JwQWdFKYrpoxOEJB1L7gjwZSnTPsWUNmyyca1p7gqtgtToa4VMQEPgQ4Aprxg= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199021)(36840700001)(40470700004)(46966006)(478600001)(7696005)(83380400001)(40480700001)(36756003)(47076005)(356005)(81166007)(82740400003)(426003)(336012)(2616005)(86362001)(36860700001)(2906002)(316002)(26005)(186003)(1076003)(54906003)(5660300002)(44832011)(82310400005)(6916009)(6666004)(8936002)(41300700001)(40460700003)(8676002)(4326008)(70206006)(70586007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8641 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f180f1f1-d919-4e5c-4f07-08db3c0efb23 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qgxpbscw+a+wZhYSZ31Oi1qNUQlGK51uVNdye0ClGJd+EHiE2N8F4S9D5LiTKQl8BA1t7jf9/+3nywgWyadFrwZkyUKUG26rrXa2J101mTZy5Hk7qeFEeUSnzJG/v4UB3MHShyRcN6N1uhSuMnnCgs5vcRGaZ/y5kP6q6UJYZHC/iB4jN0WD+ITE7g9qN8YWnpjMAoajddCS3aqnCEXAjzglDrg0cnnXMd1jAVVfXMbQV8nMyB+qJU5Gi8RTYsKqhnwmVroIMRucNAEv8tATsX5p+ksRsnhObQjp7VyRi26xet1WMW3SvR+oRZ3w3FI6Q/QjIeMm4wkmJoNoMm34jnA7sIkEgMj9GEZ2VcH3bFC6G5KNmK0Tcx/JD04KtI6PTf478pNGrH1Id5qEPtVzm7LhI5OjE+GENJnr+FwrqRPygPyLW3AxsZ/mDmE1wHDr8vVEkfmcR6ysLljrP+DV1L5l76gSw9YYY5KAYQ/oXKAhA808o8ca771F/S2rFFeSJ8ILXoEYVQI2p52Gu7gAvyKpa5mrimjfZ/Us26Wh8mtn7qdpEtcfcfulaD2JwGuGrS+XvWK1eaEd1xHeJ9fUVyJ7zkIX+O9t3UILHkfqIMDWeVziM2S6MDaQcllGYA56EWiiucGduEALWgmZ7ZW+N42q1JF+qcsDvPcJvniBZvOHbH+f6GJHoPdkFqPl4ezF339iWWYbyXUFfxm/45j1sA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(346002)(451199021)(36840700001)(40470700004)(46966006)(54906003)(316002)(107886003)(6666004)(1076003)(26005)(36860700001)(40480700001)(478600001)(81166007)(41300700001)(82740400003)(83380400001)(47076005)(2616005)(7696005)(6916009)(186003)(336012)(70206006)(70586007)(4326008)(426003)(5660300002)(44832011)(8936002)(8676002)(2906002)(40460700003)(86362001)(82310400005)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:34.4226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b8df19d-c1e0-4c76-585a-08db3c0f012b 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: AM7EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8836 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040546_057855_8623E036 X-CRM114-Status: GOOD ( 10.88 ) 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 Acked-by: Catalin Marinas --- 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 6e92821b0bea..e98d8daa95de 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 Apr 13 11:05:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210146 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 576FFC77B6F for ; Thu, 13 Apr 2023 11:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aUt4fzUwKVWzZ+m0lOKx3lbpEAPUz05164m/80HNO5g=; b=mfkt7MVgPl3CMK eqi01xHL22yj9uBGP9PvTPYdsFX6HecJT9T9uUchMBrLV6H06P6v11R14uu+sqOYWCpgHzTd4f/SR 3vXOKXQKLZKUPKd6T6HT8mTjy58UPFVnfWLmQiIZvt/vth1DSvWwMWDEPe+orqyRaGvOWPqgU/HU1 PJUTAkmMaBhN75oNdvzJtM+0J6zezLP7lnF1HyDRWKn8weHZgwAD1Ue5P764XYWla57NncGy7ZNd7 yLhKFCKlXaUDrG716y4/UmULKxiNsOnWuziQWNumu3AYOx/Xlv0E5ubbyn4CP+CHJtNnUB8rENgo+ w//dMr3OETMj3xEMiDiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmumA-005ybX-0I; Thu, 13 Apr 2023 11:06:02 +0000 Received: from mail-db8eur05on20614.outbound.protection.outlook.com ([2a01:111:f400:7e1a::614] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmuls-005yOe-2K for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:46 +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=G9YoXAJgHz1hsYkS8QYefEgXjOQmd51F5A+Hk68zCkg=; b=1S8rl5ih9obeWklU0HCUY6ZaaAehq/M+Xxv5VZNVIbRroS083cr7vJ35MwtmGf3QUI2GvswPsAUMkLMymp9QZ8q8SXrRhTXIxCKBHS6fZrjqqx7bJqnL88Y1YcHPQwzREOElsY7MBc4S6Pskl52d5ETSSPWSm1bAwbLGzg0e154= Received: from AM5PR0402CA0018.eurprd04.prod.outlook.com (2603:10a6:203:90::28) by AM8PR08MB6530.eurprd08.prod.outlook.com (2603:10a6:20b:315::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:33 +0000 Received: from AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::33) by AM5PR0402CA0018.outlook.office365.com (2603:10a6:203:90::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT016.mail.protection.outlook.com (100.127.140.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Thu, 13 Apr 2023 11:05:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2debb0a2b3ac97e1 X-CR-MTA-TID: 64aa7808 Received: from 3e227ccb0391.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 610A8F2C-E79B-4254-9105-F16551BAFCDF.1; Thu, 13 Apr 2023 11:05:26 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3e227ccb0391.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cjyTYx0b8+uLvAwI9qITq4nlVPUG0BdKgs2JrXTac3X1uc1weciMfNw07HrzI9uivKlMnRtbJrzT2tJuy1Xc8+Ttm6PFjWsMC7rqPwztEmWZ9UCNWtxIKgw3nMNUM2XbXhNn3LO7BtYkaoQW1LxofJSmuCC9OaKpf1ylDQwgw/RBaGfzLDhl1nbTk64xv2Kt3I1pi2u+3RtiqACexEma4Cv/2ZkuC0AXy5kMJfXg4ry/PRZHM0Pq9zPs+0CAAfmzsk/iEN3VXcSooEzxgUaIsiYITymXLCHE+kw3xThKTBCjralBqZ9EbPTLqM78v8LtHRYf+SfI8qMawkLEBJrfcA== 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=G9YoXAJgHz1hsYkS8QYefEgXjOQmd51F5A+Hk68zCkg=; b=EAEzlNg5A9crfRWgU47h5vFz7Awz9R+/wOHqs/r/6iyT35nSgjI48vmHZ1AiOqw3axnnerOvOD5jPnMyA4sdAK2qlGnjiv1WRfZ9b5yik5SU7yZ6ppC3pfAsV37NZhm8Kl2c0ufL/hNUMIWmkkyKaNKwkV5HuyAVMr6fIZ9MXF5iNzX7q8Sbz/b8hNjZp3TSSOHCMVFdX5yIWTJZvgfE/8CUnXxf9/M4tjtpBMOedAX+DsPTjoXzSgHpJMLmoJNqt8S6ODN6my0kuLNWv2HVi1Ekdhtw8M+w177llwfloxg0k3UDTqbfjOnUEFLCIMHIRjYCz2rBhSHbmUTnltCM2g== 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=G9YoXAJgHz1hsYkS8QYefEgXjOQmd51F5A+Hk68zCkg=; b=1S8rl5ih9obeWklU0HCUY6ZaaAehq/M+Xxv5VZNVIbRroS083cr7vJ35MwtmGf3QUI2GvswPsAUMkLMymp9QZ8q8SXrRhTXIxCKBHS6fZrjqqx7bJqnL88Y1YcHPQwzREOElsY7MBc4S6Pskl52d5ETSSPWSm1bAwbLGzg0e154= Received: from AS9PR06CA0432.eurprd06.prod.outlook.com (2603:10a6:20b:49e::28) by DBBPR08MB6283.eurprd08.prod.outlook.com (2603:10a6:10:1f7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:24 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::93) by AS9PR06CA0432.outlook.office365.com (2603:10a6:20b:49e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:23 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:18 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 11/19] arm64: add PTE_UXN/PTE_WRITE to SWAPPER_*_FLAGS Date: Thu, 13 Apr 2023 12:05:05 +0100 Message-ID: <20230413110513.243326-12-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|DBBPR08MB6283:EE_|AM7EUR03FT016:EE_|AM8PR08MB6530:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ba585e2-4f02-4af1-7b88-08db3c0f0053 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: sxXH0qvu4VgxDXwLGiLNSJziievwF1etH4Xy8jfcobkSoEJHT41+yeIcNMY26ECVeKluqY+AsT09n38NkBeoQQpKjsqaRNvXnRxfZHEK5nuoAdO2bHLgpG5MlEy+HkFY98G7Q9Ongyt0ps3kRVuwTEnJx+ljBSNogtxMbwUymjFbd5SG5RGq8ZOmYNPkRbiBcKRgDOwoLMU4ERkgzltMQs0yY3zfeUeN2kpxE9CvPMrb2qSs+OQAcWRq78tkwmviPi/CcPBZsgP55t9Z/GEyRbdEJ1Hx840n2df34UvwKWUvaGl+riqNEYYM4R8JYpPPnSpkPjinMSi0T0YU3VOTT7QbVXegkhRVb8tdEidyICyi3TqrhWVF7+vxNNg3/EThX9zxgMCDLM4qj6OnXVwIHS4Eh6v4G00gd8dmlJq/oRbmBkzNMfShZ83Y1FfXUJOtspMUOsFeJt1FAwdwzlhg35MqqisyH6mobb7vZ61UGdpQ7Ru5esFJoruSC8N5DyyvKsZxsB5FCm+cP9L7hH7c12fhWcpw5KPas5aWX43H4INt5QTlpElLkwPMdL60UGNf9vqyZB2rhCuAMa1KQsLqEIzuExAC+i5OwH8+ra5Ax5iHo5NyqaKmONGUFpKk86SvHcNKfrfH/JtfvoQTfrDBSyR5kZRWHzBMwi9yKjLPErJxDTCCGyDqvcQUfshFOrw1qt2bzzgkStu6cOlkfQJEKGUiNq0LgC66BST1QvpcWHQ= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(7696005)(40460700003)(6916009)(70206006)(70586007)(4326008)(36756003)(2906002)(44832011)(86362001)(81166007)(82740400003)(356005)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(54906003)(1076003)(26005)(336012)(426003)(36860700001)(2616005)(186003)(47076005)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6283 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d258cd79-2677-497a-c9c3-08db3c0efadb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +7KVjtgQ9PDy54gGqYfccD4zlRt4l2Aw3/XYCTAHe+NfBE6tmlfGLN9jGFigVR/G0Z1l9oxooIQs9uE3o2S1FjxWth+JKS+Cc7x/y+dM8VZwVxx/gOK6OiwlBLcOnX0QhubmS3mZ0HF+xqHSfh2Ygzn+16BxdZEZ3bGizEycSMzwKI7HcOkXZcAxpxu7xKXN5Sbgg6Xa4i6K/pZMQaUTLhRUVVjhcFVha9vGoSXyaXHRW9EQcQ6nd9MVsriZyUPpsGcD7dVyMNbKS30j1XGAlbQtXfk+dUKpk5wvXxSSnpOJDnwvjn4Pq6qvYNHw2bqQp3Gxh98nlrC4nVHX77Vlr70twojqtmr58tUxVOmi6rfdqnKaj5FytPtPDJZYVYgQyjxNJaTmOyFAnG3nee+3o4ukiNLSzwP2kazCYqjmPy/ZjiQHYx8vjL89aMSE3dU6cA48Cv+SM8PqDwG/FEAY5N+Tkl8JnmZTXlxYpyOme3or5gRW67a6ql2V/TziRUX5ageqC1nRdNchISxIxqVEhadtWiXBhM26iXyOj0FFJPcfoYvLwjoWKTPeT+6MF7T6bqa/F/CLH88Wng8lRpYwnne9yyzX4rMr4F/a7dSFtwFxSYa7Dirm50X9WsX9FZUa/mwDndpjEWte0I8k5h3FwaKx8ZuivBPO+GHcUBPCarDzzlcr0l7mnEMwDIAaf1WxJ3SUNzTdrGt1bZU0XrqPjg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(36840700001)(46966006)(40470700004)(40460700003)(2616005)(336012)(426003)(26005)(1076003)(186003)(2906002)(83380400001)(47076005)(8676002)(4326008)(6916009)(70586007)(70206006)(41300700001)(54906003)(316002)(478600001)(5660300002)(6666004)(107886003)(44832011)(7696005)(8936002)(40480700001)(36860700001)(81166007)(82740400003)(82310400005)(86362001)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:33.0079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ba585e2-4f02-4af1-7b88-08db3c0f0053 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT016.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6530 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040544_760877_AC75D991 X-CRM114-Status: GOOD ( 11.90 ) 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 Apr 13 11:05:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210142 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 40E80C77B6C for ; Thu, 13 Apr 2023 11:07: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=eZXFnqr10jetJSNvq4GQZw9zKruY2w07wUUfeSHC3w0=; b=TtlK3sMHLlfo0y DhPR5ryYLJQPZH6Y1gzecuKeCvfrI3emYJscCrzmMsk3EZ7+z3+vL2OD//9K/tratPVupqK19URhd JsJz63oz8k/PMakD+ZlqyO3imY2GM/GxRbPGLYvP+VCKzSSOLb0Nm2AaFTJezPsK/6v4RdIFeg4kO 8UsV/4cVrq9sQPfA5dKOnt1tXKR2Iyud+d99Q7oAGZY3IOS43ZUJOFAtraXZZKHbYnUnq1n61CLOo lCkfsdJ65Ei/rp1LXDkgKkz4iWB2w193NZhG+4Eo+OkeUz7M1IJ5eE/K/BizzBJCm5ttFfQBH1ITN GSJBSSCAdsnpE+PzUQxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum1-005yVE-04; Thu, 13 Apr 2023 11:05: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.96 #2 (Red Hat Linux)) id 1pmulm-005yKM-32 for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:40 +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=1TnyYVkw7n8Wc8GFE4nFlzKYeqKDxRQjUxf4WgUmQ/s=; b=SNPXBWgsKSSj59FBHLUwcwzZVEIULH5NnaEYZSwswEwPxL6TxxR8FwvUrMgwppITnZix3BWddel+MvXCeyYVAKCyRe1qysB14KYivi1yGWckT0crlbwYK8VIuT9zo2t0fN6b2dF8If7ntB1j8wTuckJW2ydJaC694eU1NHf/F2c= Received: from AS9PR05CA0218.eurprd05.prod.outlook.com (2603:10a6:20b:494::7) by AS8PR08MB10222.eurprd08.prod.outlook.com (2603:10a6:20b:63c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:494:cafe::4) by AS9PR05CA0218.outlook.office365.com (2603:10a6:20b:494::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: dc0f0ac27651bcb2 X-CR-MTA-TID: 64aa7808 Received: from 767d7e912c85.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ECB748BD-B6DF-4CD4-A71E-4438A3227A09.1; Thu, 13 Apr 2023 11:05:21 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 767d7e912c85.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AfA1tBqqTUuRaoQTjLRtyN7tJ4FxJUvYNrmhGs1RTLWZW7+JoGq+VOKInOvqSv/HZTKxWS8SHjkSRm+w9gS5lV7XTNSqBag8SkUtQop46WgNhBI05BSSSVtfYTeC+BvKbERci8F4WlI1gjZfGdL88C7xYlkJP4TJpNOOJxqFjkZW58XVdVcCxIYpOc3mrh167Rnxm/nGrRB3mYZ6B4Caj5guqtEicscnY2PZwUHqFx+0jEs8m0cn9NRKnot6M4aw+lto+2hSz98YzTZZSIE4xSNjr3ljWwTwr7je9XNfgud/Z0uwFehWCWABUlfIORnBowxGRlks2twyLTPAbjR/8A== 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=1TnyYVkw7n8Wc8GFE4nFlzKYeqKDxRQjUxf4WgUmQ/s=; b=R6z+vAoGusfK0iltiqOCGRG5lO9VBYwp6iI9q3D3Vdm04SXJyOXdFgiEhAHmzPjDi01CxSAwSHMUyoSQ8saib6yGwCVOQAqNlC38mm+bDLvVc8edGbd0mdbrntEzfMpPDDGSCkpWKqt4FaGwDy7dF+EmpcaSJjxNqtokw8qhVoFfQTnjxJmjzOnLhtYqsSFpAS2kC5xX3ExPqUEVRSvTulCJiMWRzH4ThHmXrrvRlcA+GhqC/kJtUKHqqodxh/XXFq6crezwIbXa4eH6JmR3TczkmADuz2Lq8mIh7Q5DckTzKnEGAsyEpmTwL/gUwZj3qxk8uUsk8gInZw/1tIKozw== 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=1TnyYVkw7n8Wc8GFE4nFlzKYeqKDxRQjUxf4WgUmQ/s=; b=SNPXBWgsKSSj59FBHLUwcwzZVEIULH5NnaEYZSwswEwPxL6TxxR8FwvUrMgwppITnZix3BWddel+MvXCeyYVAKCyRe1qysB14KYivi1yGWckT0crlbwYK8VIuT9zo2t0fN6b2dF8If7ntB1j8wTuckJW2ydJaC694eU1NHf/F2c= Received: from DB7PR03CA0095.eurprd03.prod.outlook.com (2603:10a6:10:72::36) by AM8PR08MB6402.eurprd08.prod.outlook.com (2603:10a6:20b:363::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:20 +0000 Received: from DBAEUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:72:cafe::64) by DB7PR03CA0095.outlook.office365.com (2603:10a6:10:72::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:20 +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 DBAEUR03FT020.mail.protection.outlook.com (100.127.143.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:20 +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, 13 Apr 2023 11:05:19 +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, 13 Apr 2023 11:05:19 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:18 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 12/19] arm64: add PTE_WRITE to PROT_SECT_NORMAL Date: Thu, 13 Apr 2023 12:05:06 +0100 Message-ID: <20230413110513.243326-13-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT020:EE_|AM8PR08MB6402:EE_|AM7EUR03FT059:EE_|AS8PR08MB10222:EE_ X-MS-Office365-Filtering-Correlation-Id: 45d0c2e1-42de-4876-6f9b-08db3c0efda8 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: NTY7Fbksxj1/tOl9JokOuUfdVAU9pe4ETkrrKyivrcHgdepuvHNegQ4rcLB+zZT/esbCxzskBUgJQiZIG06jrys52YQYTtp1Af0Uh7kkpGd8apyOO8h6flJ/VxeAvb3+rHIfy80nMC4u9uEERdzEDbHE5uh0CTiPoP2qAwCFGvtWB5QQ8PoYB4ARNKmmk4cp9TNprlbm+/C/q8fZ6q18wxtV3lezEtFQpVD59XQMxQURrdjIf/YAh5TcMzFfR3yyHmYcI059Jybj6ghSOhAe/5a7XLI2TMoT56IVmxUwNvehUttqCuiC1InMIH7sxNwdfbI13H/lg+8sfsDXHj1FwWuClvgcei9XV1sfWglUxGNPZo09+VHgBY0NE6mCFN8/6DOhUP4jlfNYf4IojCHLrDKz4UafFTqd8jZcbXs5tsFbkoOcMLiiPtnOR5o4rBG+vjAmvyVua8zTTAE8wzqcxaBzkvAhwMrdNqXeQyKL3Jxhc+uaKdRV9isE32dupek4IeyC9Xyx7ocwWjkP5K0BGYV2eCb4bbQ9Qy4D1lkAldRJHPUZXidWKyAJUn5eavdZ+8V9XLwBKHzpbbySLF+CffeksXkXtffnHPhRIL8mNCoWf7D3yRT7Q4ML1mu/fB1khE2bOLUA/7coE5UiPz64O+mulL/cmn10VZKeQQBXLpjTs3W8t8U3lW+AocjU69WORvcj54xXJT867gTLuvv4UAWv/GqxwKQQp81sg+ia90Y= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199021)(36840700001)(46966006)(40470700004)(40480700001)(1076003)(4326008)(26005)(186003)(40460700003)(316002)(82310400005)(8676002)(8936002)(2906002)(86362001)(36756003)(5660300002)(44832011)(54906003)(6916009)(478600001)(47076005)(36860700001)(83380400001)(426003)(336012)(41300700001)(2616005)(356005)(82740400003)(81166007)(7696005)(70586007)(6666004)(70206006)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6402 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4d65c924-a5eb-4ae2-2571-08db3c0ef88e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6b2EdYguPMpeun9edJLa/t/wjbDbtUtqKcs0QXt0oGry02MS2YAKM6MhJ5q0JkKPrHaQhCh1PRyv7N712lwW0E1WLj/objHb6/i62XwoK8WfUWQ7QBAjIHJIqNB3Eso6PG3vjUjfm2nBLL0VjGoBy+5t4Q371zMIMgRmyxXwJw1qYblz7y9ps7ew2PoS+qQrwEANca9RvYm66tW+nksgw2gJm2MafIZ5xjPV01/MogZoI81SIc3ed7VSZkFlpk+NmyXMM4+nvKz+qAdHDZbbPxRtRa9WzVftUqwmpBMuti5oCC1qzjkwYmv8Wz4LkoLdvgB7wwRKS0WrrJSaDAvNSh0JzCb5h/syJ3jTe77giBUi/U28h0937FJ4ex8nTDkbCj6TaF3M83bI0/D+fu+lWHzi/iSQaT039D4QXVnY0DcrjMzSTzNpS+9tETj6Y9mEGj2D3Agv2bH7DuxeL2TfA5GBa8JF+RJHQOt41Z8RDHFVtcFNGSdV55nCu+5jhSs9uTyaUZoDKeBl/Tzh9Px6StkuRUHA9pTzwKF3AQigUTJUbjJLASdmnAcuDXTHEf8dGLfclzUXsuQ7sEMLDH3QcrgJtS+rGBoLvitPOvFA1eo3sapTIisWaiwdFjsZk1jgjh2EabywxbTOMpT68SStSzXxHRa2HZdxB1E5Qrn9j4v7uiBlcFZbRORlTEuFkpl3bezqXl2sFm/DH3L6phHLMQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(39860400002)(376002)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(5660300002)(41300700001)(82740400003)(40460700003)(36756003)(2906002)(8676002)(86362001)(40480700001)(4326008)(6916009)(8936002)(44832011)(70586007)(70206006)(81166007)(82310400005)(316002)(1076003)(107886003)(2616005)(83380400001)(336012)(426003)(47076005)(54906003)(26005)(186003)(7696005)(478600001)(6666004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:28.5471 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45d0c2e1-42de-4876-6f9b-08db3c0efda8 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10222 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040539_021490_22C6E7FC X-CRM114-Status: GOOD ( 11.04 ) 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. However PTE_RDONLY is already cleared, so the DBM mechanism is not used, and it is always writable, so this is 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 Apr 13 11:05:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210144 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 7C1FAC77B6E for ; Thu, 13 Apr 2023 11:07:01 +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=UAwu1+MRUBZrkHD17TAR+b6WkaZbmDMPyNQjgNRrL6o=; b=yuyQmyscqe31PH m+4/IcLJ+8btg+wddL7BdrJ6z6sGYsCe6biMt9wBdUHZ4nQ82m5JBFpa2pAPYIxojR+iIenvIavCK U1LqMyV9IFd6hLR2/CXtQx2bu9i/JeA9z03pjN48n29t74HEMr/6KUkV41Zo94nLrl3WyAxRnG1o1 1aoW6lVLwKuHjgEghiKM1CkK1tY+xsfGo/jiJCQ/j/kNTndlNkOJBLxpUm80EMA3dYoXL2+JlC8AI 4E0f8NUKFVqshV1fdUndLj5dGv7pbB8mqEZwbb/lF+TAR5NnaAGnqoZypTEe+Yj1lYC9rnBBv3neE OCz406cXDkQa1IKXCv/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum3-005yWp-25; Thu, 13 Apr 2023 11:05:55 +0000 Received: from mail-vi1eur05on2062d.outbound.protection.outlook.com ([2a01:111:f400:7d00::62d] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulp-005yNt-0W for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:43 +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=NGTI0YTL6PM2JPEJg2ubM1Zrcx84uY5eFXPvMvRWQLw=; b=75oWZrBtM6rZfvlutfUUb1TzYEMGXKqt1he9cJFquN/R5BXbZGPdYEqhzXKaItNAbYkp96F9U9aU9WyuAF4izh6Bp4XGTrm8Ye1OIYQS0RPmRxMdvFAWx7pWasD5MepCjX+SgjEY7t/qf4B+9IOeepAyv/5W9Z0RgrDcOZYMPgA= Received: from DB6PR0802CA0038.eurprd08.prod.outlook.com (2603:10a6:4:a3::24) by DB9PR08MB7583.eurprd08.prod.outlook.com (2603:10a6:10:307::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:36 +0000 Received: from DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:a3:cafe::41) by DB6PR0802CA0038.outlook.office365.com (2603:10a6:4:a3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:36 +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 DBAEUR03FT014.mail.protection.outlook.com (100.127.143.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:36 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 62a9f29a8b0025ac X-CR-MTA-TID: 64aa7808 Received: from c9952f8a9ded.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7480848A-597A-48CD-A6E9-D82EE20DC23E.1; Thu, 13 Apr 2023 11:05:29 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c9952f8a9ded.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jdahNCNpQ0A2zPuBV55/Of+Zr5YS0XBIx9blb0wPuPTe7e3qKJ0qEV1ddy/BUe0C3GBTHnRv5ONRJPOwgrccjz/RCITaaz2Hx2xQ2CghEftwNjuBBix2brXmt6Ge2J41hLTheH4UImgPXWor4MZhiT1OwNX7PAbEOZDuve/S945qHxHbiKr5siRrKBV3VRCfQPv2qHWHSsE36Qaeqwtg7Gq3Xeh28HRpM4mKrpoklp+hvnJAQEF7rFdABguYI7BmfdkHNErmhCkcN/KiKCcnBiL1ips1Oh7YKlqDTgKhWiRbuT3ggt/F/MHtM2jLhmX5c1IGr31qrzD6JDkOQmxZBw== 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=NGTI0YTL6PM2JPEJg2ubM1Zrcx84uY5eFXPvMvRWQLw=; b=QzCfYB86ALs0KurIcGraOYEfzogrq7Jhhx3nDfP1EZNphqpPKFTamwEUBEAEXHXhwd4h/U+5ueDRdt2vuRppMJzEH0GH15L/n52nCqdpeuweKMFycRxKR4BY5jjVAFLWsho/7D1RDSZprj8ZBxDNK64fbEw7hCfI2qVSrH5+W++wePrnfUzJZrX1WmUMurTUb/hQS7TTKbgKtwz//Cx5K8icPVSK82qQnALJpEzn3j/vhHhaLrZsKvFLt1Ou5pbi+YGHoSDSY0UmYC9FeVRbebLw4n6Ad74/d6Vn1Omw1tHYxnZucN8WVDyMZ1qExpFJ3KKME8uJ88doTXZZ4X46Rg== 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=NGTI0YTL6PM2JPEJg2ubM1Zrcx84uY5eFXPvMvRWQLw=; b=75oWZrBtM6rZfvlutfUUb1TzYEMGXKqt1he9cJFquN/R5BXbZGPdYEqhzXKaItNAbYkp96F9U9aU9WyuAF4izh6Bp4XGTrm8Ye1OIYQS0RPmRxMdvFAWx7pWasD5MepCjX+SgjEY7t/qf4B+9IOeepAyv/5W9Z0RgrDcOZYMPgA= Received: from AS9PR06CA0445.eurprd06.prod.outlook.com (2603:10a6:20b:49e::31) by AS8PR08MB5976.eurprd08.prod.outlook.com (2603:10a6:20b:299::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28; Thu, 13 Apr 2023 11:05:25 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::d9) by AS9PR06CA0445.outlook.office365.com (2603:10a6:20b:49e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:25 +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, 13 Apr 2023 11:05:20 +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, 13 Apr 2023 11:05:19 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:19 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 13/19] arm64: reorganise PAGE_/PROT_ macros Date: Thu, 13 Apr 2023 12:05:07 +0100 Message-ID: <20230413110513.243326-14-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AS8PR08MB5976:EE_|DBAEUR03FT014:EE_|DB9PR08MB7583:EE_ X-MS-Office365-Filtering-Correlation-Id: f0fcb197-c713-45ce-f927-08db3c0f027f 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: tUnfSt0ce2AzMMzwjsK7ikM/8fY7ka3YGULDybBttmEgMMC5owm4g7C2oh2Q5gIDYAHs4I8l3GroHQbQs7VbPKC3RUqgdFGK80r3+h7MVqsP/WyV1+tEUt7hDD02qYgvMMV/2vpnp7OSyiWY1gzOHn2MVGiyv5u7bx1pBQeS7baGOY+mljpifUoIigyHw6/yyPoOvnEKLgapSWA8FjakEc+u07/7+uoo0Q8/+xJwC9MRDYcca5ltntHXQ7NKVl29yQLYBk4zmeV3zIhLuBmLZl/mFTiyuFtvqB/89U0VvCUCkFWu52pApF2v9zFub4B0jGR8R6CT3vmGrOiikKvsjvAy+uxfWdcwhIHMV4eO++omXRX4qG7aDKpf44o2Gm80zO4w2cPTE9pPA4jTkQ4NoORPpZvg5qxq6tRvYlNOVtUYzdF5WLggR0faqalqPoJuIzxvrEca5YKxWwmDyYF6Z4A5XqOnId17NOUS8Lqtd2DYWBpCClGn2JZrPsgKblriGXbFjXKDN7aHnMeMFFRwIpAbz/JKD+fUMxO0pRJvS8kNjHHOUhQlv+nsSJA9MTta8YU92K2pThvlzDjqKV2nSfNkkYuBBpoWEnwUKvLgEuQA+3TtKglDTLnMBEief2GEjRz9YT1+AicY+K+QwYztrYrZclgPnrG6zcPeFoK7NUVEKjIfmmtDeVO4z3I3W9xpD9alH7bfkf7/I2vqrxnjbRf/ERaoC0sNRjxxT8kvE7o= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199021)(36840700001)(40470700004)(46966006)(54906003)(36860700001)(2616005)(83380400001)(478600001)(7696005)(1076003)(40480700001)(26005)(6666004)(70586007)(6916009)(70206006)(316002)(82740400003)(4326008)(47076005)(426003)(336012)(186003)(5660300002)(44832011)(8676002)(8936002)(356005)(40460700003)(2906002)(81166007)(41300700001)(86362001)(36756003)(82310400005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5976 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4756438b-3f2f-4aef-e552-08db3c0efbf9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QlOBQj2L2gkysox9VFdlA3rF40NFY6vgBRcw3ciSLVn3nJD+UJX24Y8HPOrOhMRdZNGebe3qo9XnR/4rFd4I+B3UCATMzMM24gs+Xg8FdKrlKTua5nJGVhdGYyr+DKJtUSFEL3Hj8eTxNeUyxuHQ3dGj+Yndn5DtjG7dKxC65P07VPqVo0NGyuaEbAKtVgrZsGqaCjsOV09wH+BR664L050FmPFjmk+sxFwPO4P1nfsMNKN1mYvKAo59zDfIj5fHLUKzKMgvQFq23Qw+1LZYNB39vK1eksXXgQ2SehPiYwSLKE5P0yKA/FYWUXur1AQKJKZbpPrZs569SW4IibFcqK4ESrTgM7bgZaVYByNa6q7ts5n1iAJ9olXxNJHindrm+lBDXjhU1sKBrD7DHVGLn5Qk9hmqBdtlSyaMCAFjwEM4nNkKAy81opbFerlmIW//Zpl0wVKUtjojp5znxfub4IrmLy+AX+PcWL4lvujKkkMBXxnArtp3qM+DNaXbKWturP7ohlIvEx4C7zSeCCZT//x5nbG5Q+3tCKUJXZG17T6b2/lUJCzNLVhf+5uqnvIOKFp2TNGEoHuzgnrxfFymYH4eGCUthM+mghQv0BCzb2QGs7rvD9SXN5MWAxErev+5sr8/fqI/Qz/fCDpsmX+6UflDdf/bBhNWA3iSzYWyv2V6tRQG4m68TJOanF7lf+vPvW6BvhgsZd8RAZyhiGN4Dg== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(346002)(136003)(376002)(451199021)(36840700001)(40470700004)(46966006)(478600001)(44832011)(336012)(83380400001)(2616005)(426003)(86362001)(8936002)(70586007)(47076005)(4326008)(70206006)(5660300002)(6916009)(8676002)(2906002)(40480700001)(36756003)(82740400003)(107886003)(26005)(36860700001)(1076003)(54906003)(81166007)(316002)(82310400005)(186003)(40460700003)(7696005)(6666004)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:36.7018 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f0fcb197-c713-45ce-f927-08db3c0f027f 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: DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7583 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040541_380658_F141EE94 X-CRM114-Status: UNSURE ( 9.70 ) 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 Apr 13 11:05:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210143 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 ECDF6C77B61 for ; Thu, 13 Apr 2023 11:07: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=h199oWYm7fVXBYea0Pwl97InJWxa21AccVgRLpNCloY=; b=puqgOmZtsLkaao 2m2yrH2ALxfXuoFY+QBuquHKfOH8DxnHx0DtS4wvUmCpJE0sV/HOY4Tz2GR40Ym1fEbZNrvzSCHV8 /hS6VWK7tx5kv/ibu/pHEUa5hahHfvJfglPJNmnz2TLfymCJU56WsJ2PYXaYZig1tpwtKjSl2wkeu 4t+g7eD6MY1KXwb4tMX1iSayrb7msW5OIe9n/0ffAWGdetuf6ltFmoe9vFaa1vxf/ZUn2faQeim2j ZCCi8e3AHf32QDZf6wPe0JLcR4Teg3ejB/Lm6xUQ13nx11Q25JHiSZXHD4IKufL3HYpiNKuakwsI4 1X/0uFrKI2DZjchDM9Vg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum7-005yZC-10; Thu, 13 Apr 2023 11:05:59 +0000 Received: from mail-he1eur04on0616.outbound.protection.outlook.com ([2a01:111:f400:fe0d::616] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulr-005yOb-2b for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:45 +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=BgFdRvl9DnNeMucFg1qWaS+9fPvJ571aHehQpbozuy8=; b=zMiDIa43WxvHifvr3yE+pqzNXnTLQ/9yEhUiCQgSWIAAEnXZ+sn2COj8JVjLR69B1N5SZ2TVwvDNMDk3uetEBwDJlDNZorhfC1nyX2GlWA4gCyfPmp1LCiiQsbtSPllnli/FEWklUek6ABqlXx6Hq41er71L0hLuClqhA5vNwjk= Received: from AM6PR10CA0037.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::14) by GV2PR08MB8028.eurprd08.prod.outlook.com (2603:10a6:150:79::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Thu, 13 Apr 2023 11:05:33 +0000 Received: from AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:80:cafe::8c) by AM6PR10CA0037.outlook.office365.com (2603:10a6:209:80::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT065.mail.protection.outlook.com (100.127.140.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:33 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9c8819a42eefec0a X-CR-MTA-TID: 64aa7808 Received: from a4c49c88f833.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A0246CF2-C9D3-4443-B7A8-663083F166CF.1; Thu, 13 Apr 2023 11:05:26 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a4c49c88f833.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQwZPu3g9n2Ghn+9jMyynb/Sb9tnEZwW1+NOiveC18fXDKlYYp21SSCPT8/+lf69ZB3zGo/I2whvX5R36l/D5d8Hi4t7sO/TI3wx20Vkr6Py2We8oOJmeNju6bsnUOw9CE0sBOU+OdshHbf56jVgG4aODR1NUAbUPD6qfLOZg/TeoQ84FF8oHKJ9vHbGkezDUQbqCl8Gn0nJVVGXQQqzeixG9797B4GkWsrb9dgHMoCU7ctoi5e0UeDU2a+BAYan/UCL+lT3KYfLfX97qtYpZs+vsfkQMflTqoUcKMPpXCTt1Hz7o2sTsN1lhC4EqPQeKDD6GpUZ+p5iT01VkatTZA== 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=BgFdRvl9DnNeMucFg1qWaS+9fPvJ571aHehQpbozuy8=; b=VeeJbkzUPpo8JRgmPluD42De1twcEenaVLUv276zcbGos/eO4i5lgi6GutRG7TfF5pm0oSDrQcxybz971w4reSbDkMOkATUUqvkps4B7qGw947UXBwBGmtf1na9UTtTmtHDnwfda0bL5u5LXf3GEUeY4aYFNxOUCG4ArMLJP81mlkQmNHn9xFAGAeX3qc50c1hkKWALCssvh4lUAdh5yXZtWd2A2zeTlOEWZsZrDu00ungl5MVdp9NoXS4Qd06NKi14WLRkuogyTM0AH3gkhOnQvX4s6+Aow5XfOyWfP7nAq/74erKQGZVaPC6LjIYsBRf4jCg7tfUwXFlBMy0XbSg== 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=BgFdRvl9DnNeMucFg1qWaS+9fPvJ571aHehQpbozuy8=; b=zMiDIa43WxvHifvr3yE+pqzNXnTLQ/9yEhUiCQgSWIAAEnXZ+sn2COj8JVjLR69B1N5SZ2TVwvDNMDk3uetEBwDJlDNZorhfC1nyX2GlWA4gCyfPmp1LCiiQsbtSPllnli/FEWklUek6ABqlXx6Hq41er71L0hLuClqhA5vNwjk= Received: from AS9PR06CA0421.eurprd06.prod.outlook.com (2603:10a6:20b:49e::9) by AS8PR08MB6085.eurprd08.prod.outlook.com (2603:10a6:20b:294::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:25 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::ca) by AS9PR06CA0421.outlook.office365.com (2603:10a6:20b:49e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:25 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:20 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:19 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 14/19] arm64: disable EL2 traps for PIE Date: Thu, 13 Apr 2023 12:05:08 +0100 Message-ID: <20230413110513.243326-15-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AS8PR08MB6085:EE_|AM7EUR03FT065:EE_|GV2PR08MB8028:EE_ X-MS-Office365-Filtering-Correlation-Id: 2073911e-5d83-4642-8413-08db3c0f00a2 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: w37nGv8C5ggxKjo6qT+qkCW/IVJGpvw5AeEXD10F4+4+7jB2HtqrW36dbe72VhOfR6C680oNtX2L6XPeDlzm6DEs8+9zvFzbnpNntDrP/74DO4hepuoAaFponp+sCtVVA3XgmmrznlhlLIPa93hJ2i4AGsaHNfuNhM6tpxs6gIQtJlyej0sHThOKFMgGExFYMTUNW3Y1YYMwzrJTJA58iBDeRPhwnXzIFDmnl8Z8LeSiDxZ933b2YPGCk4y4Q2kM/tU1yWHuVlhE5u5yrkPdo1+oHktD35L1YoGrM+mMufs+vKp8dG4m+oBqK6oj0iwKf5R6uO54U28NEORv64UDHaDBtxKsf8UbN1+VThGDmcoSVaHEhk8uxlyfbz0W8jJJLoEsgEJV4PHBoS/LeEyrSyuRq/0jMy/6GwMiAcVQj/SL3GXKc6/JF/NJ4p913PrLE9IfzmG0otjAUEdPY3cVn6i+QGXF7trr+puRBveyaiFDTZtpLyRoxBL6VPhFAALMbZeG2g5Hv7Yy8LXffWkSbZ3qPBusEY6/1xQHUF9iJNK9XUf9bJwtgm3Tid7A90mIOc1PzLaU6IezfrJCejCQJLcj0FipFh2AZc+i/aJmG5ixt2HX5KLBfh+ES2Xd62s4/LZwjiODRXIO6csBWz5e/+Z7jOjx43/4VftKWZcuZ0uqaxjHxlRwCzo3kFDMsVmeQo/C3JK8H5S+yZUDrE5HnQcGTBMTYHuhMl7QUpYlI90= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(40460700003)(82740400003)(44832011)(8936002)(5660300002)(356005)(81166007)(36860700001)(1076003)(2616005)(26005)(336012)(426003)(186003)(2906002)(47076005)(6666004)(83380400001)(478600001)(40480700001)(41300700001)(36756003)(86362001)(82310400005)(7696005)(4326008)(70206006)(70586007)(6916009)(8676002)(54906003)(19627235002)(316002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6085 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6a263b0d-1f4d-41cc-0e40-08db3c0efbe2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TyQD2TKu13pbH0Ka6rvkcaluDjnbtVD672CphTalzz+7OCrtD4C8LrV7uTkXeKXkK24aJC2DtgTZ49lkLBDp9IxSN31qjs+8SklUnMdyO0W6SF1qU9v8zLoYOx2X36G30nTlFdWpXTgBpxSg5iVgQJZdb5nQGnWv5n3I+Q8hTxGTyBfxDo41bGOG07Q1ni3HRCFRWQtGCpLLa5IPGVGacol7YDPcl/xZDrfNMGEKEqdBFD/dF+0kMSG/DefpLj28pJm8yEAU+goV1xphnLCxZV7ITVagDr3Tch4cJnix7WZuC/nrk9juryuyQZopO8++92DnWZQwJzT4ufz0ZhrVn6jTRrKOIkr8nzW7tvQoEay3dbKg/d7lxvTRmKBOu8zsuFuLJyXUWGgWVcalelI9Rihp4jwcPBGM4cEtQTIKHjgESmsKl3Msulko9W9hQMfmWTYc09uHC3TSSrhSM76EPDJ5EgXqPnEII4myzZqhnKaWRWlpUjWUvGIWc4ssoBib4T6wPrg2xPzdJn9KwecbCmXt1pImU4otvrUIBYvef12q7QlhuMUKa66K9W+lZkapG5LJcIdbcia2DZI+C0tcUdj+POq+AWM4d2p9drGLmiNQ6gChub3HxG1VzFn+4/w2/eLmjW/vMZMTCEbK8oY6oMDzRNvSdQwccnHeJ9DwVDCf2mOn6ZRNAMdkqcTo3GT/ardU9IzTf6EHu2gzkyImKw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(36756003)(86362001)(41300700001)(7696005)(19627235002)(316002)(478600001)(54906003)(8676002)(6916009)(70586007)(70206006)(4326008)(40480700001)(82310400005)(5660300002)(2906002)(44832011)(8936002)(47076005)(36860700001)(82740400003)(186003)(81166007)(26005)(426003)(336012)(6666004)(2616005)(1076003)(83380400001)(107886003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:33.5258 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2073911e-5d83-4642-8413-08db3c0f00a2 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: AM7EUR03FT065.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8028 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040543_890055_756F965D X-CRM114-Status: GOOD ( 10.28 ) 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 Reviewed-by: Catalin Marinas --- arch/arm64/include/asm/el2_setup.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h index 037724b19c5c..67a967647628 100644 --- a/arch/arm64/include/asm/el2_setup.h +++ b/arch/arm64/include/asm/el2_setup.h @@ -22,6 +22,17 @@ 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 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 +161,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_EL1 + orr x0, x0, #HFGxTR_EL2_nPIRE0_EL1 + .Lset_fgt_\@: msr_s SYS_HFGRTR_EL2, x0 msr_s SYS_HFGWTR_EL2, x0 @@ -184,6 +204,7 @@ */ .macro init_el2_state __init_el2_sctlr + __init_el2_hcrx __init_el2_timers __init_el2_debug __init_el2_lor From patchwork Thu Apr 13 11:05:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210170 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 51A4CC77B6C for ; Thu, 13 Apr 2023 11:21:08 +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=54maB6F/gD1Ez6ZerTtj1ZmF69MgABilnEBpO6qYkjw=; b=bmMCHK1AeztCt/ PVr6vWjIKZkNWqOFFtfkyC+ob0O16o22KQm8pdaOjUraCYJvdNjnd6g7tCJWUkyykDJduZ45GFu/U kkbUVvPETJZBT/mgpK6CmjQsxx5h7N6OaGEhkVf0iENxCoykxT/fCi50hTuW2/wgBUXCQRWDXUAQa RR1+Xco1O/GaGVBJc3XXw3XHD4XOCb54/qVOBVsQDffLMRO0I9dBdC8O8XFXhFjmraGfvUGo7O1T9 wWpoo1IHQAzkE+pfNBMLeFS2vCWqIMCFBFqJMTx7B7g+SQJXrrESNnLqVbWFcI5aNa2rzRqnNMVHI qwdLlPLfqXn+pw10w7qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmuzu-0062p8-29; Thu, 13 Apr 2023 11:20:14 +0000 Received: from mail-db5eur02on20604.outbound.protection.outlook.com ([2a01:111:f400:fe12::604] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmuzr-0062ni-2e for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:20:13 +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=1BRJuDFqbG5oOotnhqszZVxFdPZc4ZXh0baZVpCwAtw=; b=ibi4MctMiUNHcKuAWQGPrtGzco4hLc0k7xNvxTu2AvOwalF0YtBkACEccZzO+5YtKWfTcUeG8d1ev2cVcIcivpa06YEZUpIccYGOK4JWdz6tjnDZZ3QC/3hdAYQuuFyiodL31vgmCLlb67m/hhsiBaFcVyILEavSjKe4mx/zD+0= Received: from DB6P195CA0009.EURP195.PROD.OUTLOOK.COM (2603:10a6:4:cb::19) by DB3PR08MB8986.eurprd08.prod.outlook.com (2603:10a6:10:42b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:35 +0000 Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:cb:cafe::21) by DB6P195CA0009.outlook.office365.com (2603:10a6:4:cb::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:35 +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 DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:35 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: de206a47072dd0d2 X-CR-MTA-TID: 64aa7808 Received: from 8119b9e59c89.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6B793FD3-F466-44FF-B3C7-8B564A475EB9.1; Thu, 13 Apr 2023 11:05:29 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8119b9e59c89.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ISuuUooTxrEltOSGIOHHXmA55RHHSHhxTF1sfRl9G/PW1ODGa28gbNurXO9KC39KE+2lzvWxqjhVCyEASGhXrc3Wh4iaXVfaoYSSvCIQhC+vM9Ags+vQSexRa9m9j13baBmOkDr/D9SNcOUJ1KK0vw8za+wEaReiU8ILClJwIGq5VXoPjxP0lEDr9LBe4EcC8JJwcXohtsmyyuFTHkHtw/k7sjVSsfiqrm5TM/ZdTLlYbCJ46s9giWK+tSKtIGAtkojukvE0BdgsqSQ5gWDAh2uCHA//5IDIT5/JkN1+zAxuAKMp8edoGuO5YktcFxlwo8k0vR/ofMkqUewp4RP5iA== 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=1BRJuDFqbG5oOotnhqszZVxFdPZc4ZXh0baZVpCwAtw=; b=G2sgotAg7cqddm7ygGhX98ku4eYsJAxPtScDULpVt9MFm7ln5g0Zjad9WIr+3JVc8vGNiG1Yb5brlauTO2LNXBef1gewK00H5gLTPdD+zOnlWirvQaA5X1aEQLnvs5WsudFJJK1vKA2SyRn7ID8HBoNkxya48lPcqJDYNpWWBIpLTcHV07TRzXGXp07blG9vchl8keTBDqtEp2NBDhd1Yvvnmz3mWuY+RQzSMUUTycpCeYw/9fi7jIdoNdHU9xKZnDHsWStrrmFuA8jTJ9h81fQGlV9JtDlsazWhUZFIxmFBzU97PqQk5uaBSiAHD4LdYHwsgdJow8ak4T7LjL9Rxg== 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=1BRJuDFqbG5oOotnhqszZVxFdPZc4ZXh0baZVpCwAtw=; b=ibi4MctMiUNHcKuAWQGPrtGzco4hLc0k7xNvxTu2AvOwalF0YtBkACEccZzO+5YtKWfTcUeG8d1ev2cVcIcivpa06YEZUpIccYGOK4JWdz6tjnDZZ3QC/3hdAYQuuFyiodL31vgmCLlb67m/hhsiBaFcVyILEavSjKe4mx/zD+0= Received: from AS9PR06CA0428.eurprd06.prod.outlook.com (2603:10a6:20b:49e::10) by AS8PR08MB9742.eurprd08.prod.outlook.com (2603:10a6:20b:616::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:26 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::69) by AS9PR06CA0428.outlook.office365.com (2603:10a6:20b:49e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:20 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:20 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 15/19] arm64: add encodings of PIRx_ELx registers Date: Thu, 13 Apr 2023 12:05:09 +0100 Message-ID: <20230413110513.243326-16-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AS8PR08MB9742:EE_|DBAEUR03FT013:EE_|DB3PR08MB8986:EE_ X-MS-Office365-Filtering-Correlation-Id: 3aa0e75e-24e7-4def-b703-08db3c0f01d7 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: DB9Yuq1ajGm2+Q3A6XabOWOZKvRWLtxgPJ82nuZDdNCcq6xsn07lXa3ocB9QuB54nzeQHdYvJvqSAkMWyuplUZP7ycg2VMcyHtBNra/6zEjxGEJZNfTGdagWcumRSnPvfSVQHDZma0Hv3aTZYyC14advksxAGt4/op9j1j1SDsWfEWpqGROJZO3CmMsagB/jfk9XhsCMMsVR+BKCUtyBQf74kO8kHKB1LzfZCQ3DaN2Mrq68EKFJjZGcr/8FYpNLrD4YDpmPd8cWHoq6AjcU7wkQ4hTAEtXoA1kRbJ82halexQlbpQibIEgtq5czMmStR28J7AwDbt6Ro6qOMvkWHamYYbpkHJixD73241F86YSqVRWfhuNtLFA9ntivhmQqElOKs86R9jdYyDcqpHCkbfmVXr/PtgFWXiCG2/7kY8s46mppWwX72RgIoY/rDO2IX/3E5RivDF4Lfcb/QpZMAYHTP3F3DhjybQvYhKTXsqN05ClOiyfBCj7exrTf/N2B5x+Ov0Ynw3szY4V8K4i4QtQAdzRWvkFN8FC2hhlpD2Bx+l8dTwXCGvXStP7DgITHv7Q8kiT4qKlO7Qk8g6o4Ck33ixqJuu/BoZU0PeFd3ifD+X8Rn8mWlozANxXTNpkFmWNFj2kj/oF5VU82k/bCvsFfRUvPUmlj5B3MFI3NdjULAkSMEqjF6WPu1tKTbnhocpyxzayA+nI/RyH7w+ZtqrStJZ7nhVRwowIrwICNKEM= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(426003)(40480700001)(5660300002)(41300700001)(86362001)(81166007)(36756003)(2906002)(40460700003)(44832011)(8676002)(70586007)(4326008)(8936002)(70206006)(82310400005)(6916009)(356005)(83380400001)(82740400003)(2616005)(47076005)(186003)(1076003)(54906003)(316002)(26005)(7696005)(6666004)(478600001)(336012)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9742 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4b2b11d3-b8ae-4386-3fa8-08db3c0efc78 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AEoTmtCQDLqR59JCoBe5tsh7y4UceYLklSbO1zKBD56J1oT+b14+qJRvTbfTEVlpfmvPmzDX7WjqUPPEC5yGIphEzdJ992YWQSiTFdGsfwCApdnkf9khUMIpWlLXFbqXMkTafEdFNShV0XQbWZPxSheVZ9WsxgCU2HNmKlBK9pBJYFXcjhGUWRGjrJraMumcjL40DMqImrvhIRaupOsrG0GNy0VMcHiI0lpo8XzkU3FAjnCTJf2Raj4epCDxl5rHQb0jzwbe7TRGKxrxcvkZPbTUsZ0PIu6CLYKwUQkEHWs8TJjYQ/sKRY8aZYdpXzPi7cL3gYIjjHTPt8QDjoc9+BDnCrvRRU8xku4PZgnPSvzoXcwEBNL5Y7FJ+62qzUsxvCZWlR2ouxkjqnyFm1Xeb4OwT8GZylD1pXHXXGBBrBwihdh6HkyLhbu2ahIQkr0Z/I1QVSGbXacrYAwSobeZJCIvcrkUaYy3oJhN7dpvK5xnYHumpo6puGFVQuHSatbDoA1uK1RFJdx8z9x7l/l/tPpHTzFYoVfo4qGuCNjLwONn4pGaUSmoMovB7vAm/KlL+pdl9iubp9/CMXJ/Ns79J8co8vviBfD2UP9UiaCOO9FovfIfJ4Mb7v8OnQ/y35ftodh/5Jc/1UBw7e3kd8VjwMBZ6BMG+ARjXnZWfcoYEVxdVJsI0PZzToQ4MAgPCf1FT4YqbpozKyJVY6JckPIhzA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(376002)(39850400004)(346002)(396003)(136003)(451199021)(40470700004)(36840700001)(46966006)(82740400003)(83380400001)(36860700001)(2616005)(47076005)(426003)(40480700001)(336012)(36756003)(86362001)(107886003)(26005)(1076003)(186003)(6666004)(7696005)(478600001)(40460700003)(82310400005)(54906003)(44832011)(316002)(4326008)(6916009)(81166007)(41300700001)(2906002)(5660300002)(8676002)(8936002)(70206006)(70586007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:35.5991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3aa0e75e-24e7-4def-b703-08db3c0f01d7 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: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8986 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_042011_917588_ADFEBE1D X-CRM114-Status: GOOD ( 11.08 ) 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 | 24 ++++++++++++++++++++++++ 2 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..f5a6de8588b2 100644 --- a/arch/arm64/include/asm/pgtable-prot.h +++ b/arch/arm64/include/asm/pgtable-prot.h @@ -107,4 +107,28 @@ extern bool arm64_use_ng_mappings; #endif /* __ASSEMBLY__ */ +#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))) + +#define PIE_E0 ( \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_X_O) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_RX) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RWX) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW)) + +#define PIE_E1 ( \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_NONE_O) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_R) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RW) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_KERNEL_ROX), PIE_RX) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_KERNEL_EXEC), PIE_RWX) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_KERNEL_RO), PIE_R) | \ + PIRx_ELx_PERM(pte_pi_index(_PAGE_KERNEL), PIE_RW)) + #endif /* __ASM_PGTABLE_PROT_H */ From patchwork Thu Apr 13 11:05:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210169 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 E20BDC77B6F for ; Thu, 13 Apr 2023 11:20: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=T6bnYZHHtRH+3BefLz3C1sOugInBpdHIZZvzldfTpH4=; b=2Lie7UPdaUMfLY UviKLhPL7Xvp8PBRK96HmCeL6Y9oGivWX2Na4D7oDptT5QIUUaW6NO4pD3I/e+k+s7af1yLQMhmen 0RdQAF6BkG+WlvkfwN7+ytm4r68P/AlIY2BETi8YV4FlKHFJMGoNFwHATeuteacSXD9ET2reO5bTn XS7QfyhRa7u22o0alV0zawm5tJIQcjcn1Oy3R1Zt/Oz32gjGxaewQJK70iv7cstSvA78RGjyb9gDU N3iuK+qgsPnYcHcz5RH0gUSNH/nZYd8oqDyKRFNVxoHGIk4NwAKAgx+0Sr3mEkn873KW8nb61/Fe/ QuS8dswAUSExwRCUofuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmuzb-0062lW-0x; Thu, 13 Apr 2023 11:19:55 +0000 Received: from mail-dbaeur03on20610.outbound.protection.outlook.com ([2a01:111:f400:fe1a::610] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmuzX-0062km-2m for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:19:53 +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=Dg8h/Kks3gw1dZsKPVovuQz3Zwm5qmizU2EkGb6xbJA=; b=9svxUTipyYgEZTibaT7zWTtNjteJEAiKtFqK/OpmVTsJlLOD/js5J6ZBoWdNOXGnuVauqa5GuA5ACMTBXc1v6R05RHlkgmLahJ7Ft7MeqyVew9posxk9+6gTZUUv/WRKXCGxIwSaP3U+XtA9ISCdf2sQii8BHwLFhqVA3g45VYE= Received: from AS8PR07CA0013.eurprd07.prod.outlook.com (2603:10a6:20b:451::21) by AS8PR08MB10072.eurprd08.prod.outlook.com (2603:10a6:20b:634::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:38 +0000 Received: from AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:451:cafe::51) by AS8PR07CA0013.outlook.office365.com (2603:10a6:20b:451::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.6 via Frontend Transport; Thu, 13 Apr 2023 11:05:38 +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 AM7EUR03FT033.mail.protection.outlook.com (100.127.140.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:38 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Thu, 13 Apr 2023 11:05:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 055d5ecccf1c357a X-CR-MTA-TID: 64aa7808 Received: from 66ea4bde5584.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 633898F7-DADC-45DE-92EE-66D71E838193.1; Thu, 13 Apr 2023 11:05:30 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 66ea4bde5584.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GTGchkOwnuOMq+Mxk1WCnXo30541nBoHAKgQYBNk/npcSe+hHDeCEMv1kaAPYEu/4uDZ7cTd5gOIrmvbQLOj/0S8z/Ya88eQdMDaKSVH0xQ5BNLLFpiVcuxfHtk2kegYQ2CK9IgWAHAIJfKjMc0cdd6bo2RrkrJoYw1ORgr9QP3w4dnQrBehKKuTw4tKawEFWn0d/FrLFlBSWkEWRr9Fj2p1WoEcsnA7t+A09DN+A1dtZs3ejrTJvED5xJwfVS15yrNsfhrPurciPZ9ywtfNBC4lfrT6PGU7L/8xz8qU+tVsZep1RD5HpvWbMxxxEbK/xiqn6vVrpoX234/y+8vnLw== 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=Dg8h/Kks3gw1dZsKPVovuQz3Zwm5qmizU2EkGb6xbJA=; b=Zdn2JGtDLaxSXeZ6vtUp64SyCvSUmhH2jZqPsDGeUphTTAI9BsUEOineRZPOltqg/FhfQK96AEquqSMCIYqs+9cif5B++5vaNnWoEJY/b8efwbk/XcXR0XfTpiCpqNGs5nKO9JVc3kK7lKFtsdi7TtOlFVCqlzEeN5Gwk0cl10HCR02m+om9css5/TXUk8wvKLSCwOmUOAceM7KtAboZ1tFpDm3plci+sIlX1y186Bt2kgRo/Pm+goniJEN/ojqVkA6pimwb3UCD89rBtW3ck03+YckXG6HDsh2LByU8I8Ddsk0Uzq9nU8QBGWpNeyM3Pgp94Ai6mKM9KWHVrf2SeQ== 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=Dg8h/Kks3gw1dZsKPVovuQz3Zwm5qmizU2EkGb6xbJA=; b=9svxUTipyYgEZTibaT7zWTtNjteJEAiKtFqK/OpmVTsJlLOD/js5J6ZBoWdNOXGnuVauqa5GuA5ACMTBXc1v6R05RHlkgmLahJ7Ft7MeqyVew9posxk9+6gTZUUv/WRKXCGxIwSaP3U+XtA9ISCdf2sQii8BHwLFhqVA3g45VYE= Received: from AS9PR06CA0429.eurprd06.prod.outlook.com (2603:10a6:20b:49e::12) by VI1PR08MB5422.eurprd08.prod.outlook.com (2603:10a6:803:12e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:27 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::45) by AS9PR06CA0429.outlook.office365.com (2603:10a6:20b:49e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:26 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:20 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:20 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 16/19] arm64: enable Permission Indirection Extension (PIE) Date: Thu, 13 Apr 2023 12:05:10 +0100 Message-ID: <20230413110513.243326-17-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|VI1PR08MB5422:EE_|AM7EUR03FT033:EE_|AS8PR08MB10072:EE_ X-MS-Office365-Filtering-Correlation-Id: 58ac3641-8e05-49e6-5d44-08db3c0f0367 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: wgrF+vH/drTp1WkJV7FrC1LfODpxczfrpZWmg1bOl3k8sD/gZVHJ8NOhbT2ZD6t/7gyZjKois8YpHCjjoPMuVR2xTKCC3i6mlQWJRa0RTlGpJIPYP09Gd0P8hbWQq5N5seCqbbANI47D6HHz1RAskFYeWf9SV9Q0tNwRQdY4eaPgKD1VoZVxTzFKzlpSDotfuFdt+ovqUJjf6I+3eJOos4WawXINQL9Oe+eNpiAtDRzxZNkpM/0J2pXUqAXxp61MKk51uWFy9jbRbBOtbrND/TJwNmGOnJ4Ud+xnWVkmrs32EppNXuQ001Sn+jDO5HZrpqmnFptmnkcZ82sjHKo+tPjc3duZCZvTB2l8jLD+sS8zfV9U0MUhghFg+QIF4xvuM8oxDQqKonRJ0j6OgT/PiiunomjlHcztLTXxYqW59haf7Oks3NrF3X72TvmliPCTgFBCVv36hN7EYMbcryluTF+aRYDvq5L/hM6Smm91EThU6nJ6gNOgitIwdoiW6gA/P6kF2Daz7hRljrYVQvzLS9LGNOIc2Tv2IZ1dbcZaLP/fIW3OX9NlQDTHzJAyRwiy3u/mzw4spQYipeyWq/MdzLo9yHixI1ZLlg9dGnjNAjiYyr9eOAOfhO9rMJcXvlRsQuiA1ZbaKvoYlaJ3NuhFUIeuYE9c4K4kvS5q0CUM8C649225t2e5PO2PGm/4O0JHqDJi99yLWqvo5UYyec3Jhg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(396003)(39850400004)(136003)(346002)(376002)(451199021)(46966006)(36840700001)(36860700001)(36756003)(5660300002)(4744005)(2906002)(6916009)(86362001)(316002)(8936002)(8676002)(44832011)(40480700001)(70206006)(4326008)(81166007)(82310400005)(70586007)(82740400003)(41300700001)(426003)(47076005)(336012)(2616005)(1076003)(26005)(186003)(478600001)(7696005)(54906003)(356005)(6666004)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5422 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 96091ccf-d6e2-4c43-8b88-08db3c0efca5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hDPdI6RNHMSbkgiZXCgb7yiFV8QXVPIHzCUwdvFxcW76okWkjt5WUFI/mUW/RmsBjUHPn7BD80TNg6257x9tCYUuaUloDEi3mKQiiGnVXXnjoGOQLNA0C1GRlyIJ7xtmuWgzH4ET/9UBPo4L5tkX3GbuloRzpiQXNjOuDepIAJ7O+7RUqqenPmAdESUSOpOWVQSwuJgq9Alc2v5BjTO5z+AmkVN/2tV4a6j8mBbuZvljH2sK6zwy+cDkOmjhcYUeIf4DWgCAajQvIYtsMM9DD/yHGUkCtHVCqd7ySGSx6Tgy0JaIrF1pe89a+X6o4mjIFJuvdFSqHpu8x4QD9N72t9hAftRx380IcxWooElj4EGxnJP4plW1IjSDnNrrnOrckH6tOydzJyxpPoXY/jgde+RHEIizYTmtT4OTCO7Ca6PnCVcK57nHGg4b2jm8ifnfsCmy1n/AtszMZUgSw9SIB7QQKKgKDulyE65T+UmTl8ahKI43gF9+1XW/VwLwiiO28bc1DlQkcrwt8tDjf7Af7DmxqYJB76LKSdvR1r/7gqO7V45LMmB/7RkrSBGI5yswrpC9JTBTh2GWfpZfGnYnfBF0WZJfwJUU7VXkqEh0vfNrpTQo9uKS6Gn0ypeQ9Wia2fk39tMrq4UDqdHRUjoAATzMkAmOAEVyJlQ8I8oSQBos5s7fc6eaaBmD9TNqRj3wcwV9iFtPoxvEqgmY0aXjWw== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(36840700001)(46966006)(40470700004)(478600001)(7696005)(40460700003)(47076005)(36756003)(81166007)(82740400003)(86362001)(336012)(2616005)(426003)(36860700001)(40480700001)(4744005)(44832011)(2906002)(316002)(26005)(5660300002)(1076003)(186003)(82310400005)(107886003)(41300700001)(6916009)(8676002)(8936002)(6666004)(70586007)(4326008)(54906003)(70206006);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:38.1713 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58ac3641-8e05-49e6-5d44-08db3c0f0367 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: AM7EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10072 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_041951_902416_4C06B2C2 X-CRM114-Status: UNSURE ( 8.03 ) 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..c2695e3ffc96 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_EL1x_PIE + msr REG_TCR2_EL1, x0 + +.Lskip_indirection: + /* * Prepare SCTLR */ From patchwork Thu Apr 13 11:05:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210149 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 A91B0C77B61 for ; Thu, 13 Apr 2023 11:07: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=RCTVjMKNUm6NtzL8/ZSMBSdSTh8wUgFRMgZIStc9PPc=; b=QLXd6mCFhDInmL VFiiaDi4R2VEHXoz9YmBJKLZ2dt02m/MOIKkkN5wYnBnf4tYZVMQTUPye1yIcQCpsaCCy87bh3wkc J1hDiAHGlatgvsZRqvuBjC4rjU/aCxAtLZSXmKIHQ6Q5YgvSqXhXGs5a5NJcSwJMQlHD/JFVZ0DVx 9TuVmdyPJUhV3fEsGtsKR+tQdHHytKZcQGYJvh4/YUHvpCgaNqSZZSWCGwBjw3KTdhuV3nZe85QPL pDnzam6jtBEBPAsXhdUesafsPQ6bkYpGBye8wjNjIbrMfylxnmGiU3uX0+5F0sSfTO8mzWZXl+QKj ILJBz91tMyxhrRUd+uVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmumu-005zAm-1Q; Thu, 13 Apr 2023 11:06:48 +0000 Received: from mail-vi1eur05on20612.outbound.protection.outlook.com ([2a01:111:f400:7d00::612] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulz-005yRi-35 for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:53 +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=2PkvxGMwAh7TXnG6EpHIgjGW4tOcTdrH8C0yGwIB5Zc=; b=aq+poyT0d6CX1hz57vDq8hcnlb3v31KgEqhJvXPJF4GaFz7OfZIF5351ctYtk2a33wW6s+qd8El6FzD/qqJoL8ccASTSeYYhwIDQWTOJUDdO4391zPzgsOBAtQTL/8uQAW4tHLXGC7h9pnLOgMnQ0giQEZZfpzudYGUGB5Kv72A= Received: from DB6PR1001CA0026.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::12) by AS2PR08MB9426.eurprd08.prod.outlook.com (2603:10a6:20b:5ea::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:36 +0000 Received: from DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:55:cafe::b) by DB6PR1001CA0026.outlook.office365.com (2603:10a6:4:55::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:36 +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 DBAEUR03FT033.mail.protection.outlook.com (100.127.142.251) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:36 +0000 Received: ("Tessian outbound 8b05220b4215:v136"); Thu, 13 Apr 2023 11:05:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5670fad22b998a39 X-CR-MTA-TID: 64aa7808 Received: from a2db9dcc8cd2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4A54D2D5-8B1F-468D-B584-5C841F456958.1; Thu, 13 Apr 2023 11:05:29 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a2db9dcc8cd2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dpkFKyATVPwQvQFrlS55xLScYWprlSqR6N8OcGcB9GTlkgS7+J8tECQap5dLBA7mp2+PIctU17e/M6RrPSQky+HyFaPYvozqxYfHrXna290a/Rht4LyuX+Vi3m7JUqlFylchCO1Vr+prAJ5I/0aNklKKYG1gkuTCG0VfeNgqj0etA3VNz7RAuyiGhKcgdJzXcbjymhkZovNPGMn+IdH2dunK402B4f5jy2GNkWdFocmo3QA2GjfNh0vqUvm4vLYE3U5/A0W3qDh4I6DFn7EJ47jfI8Z//u2j2rqezwIaa338IT+91GXVUHmVAefqyPrdn0M6yQH4yDNq5nO2TtyLgQ== 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=2PkvxGMwAh7TXnG6EpHIgjGW4tOcTdrH8C0yGwIB5Zc=; b=iwKIwQEOfJc9eTQMRQKYMkkd9LTuJdu68vqq2+HxpipP05vEVCuxWGry6b2XInQg5NxHKLyzEzVuaV7sD93ya8UU5Ac5JMtAgoCZTeLuciHe0TRk65iABJFcZQQVvzQO2kQS4qbU8+2ci8Hq/65vDDB2yW1v1OFMm9Hb7gHpJ4WYahAXMg42Jv7x+euQdEN7bv5/ZR8BLNBxdVbab58KeZPWJWLgOVEQ7ckdxCW25AfqpJHZmpRYmL9Jy8xaVrkqBWv/nZSI2VccUD/ayyAdNU5/Poy6ToCWHXIqd5IYqwm6rAP2qfcu7H/Gw5mRwd7g/PlQr4QRD5nfcPFGN27LQg== 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=2PkvxGMwAh7TXnG6EpHIgjGW4tOcTdrH8C0yGwIB5Zc=; b=aq+poyT0d6CX1hz57vDq8hcnlb3v31KgEqhJvXPJF4GaFz7OfZIF5351ctYtk2a33wW6s+qd8El6FzD/qqJoL8ccASTSeYYhwIDQWTOJUDdO4391zPzgsOBAtQTL/8uQAW4tHLXGC7h9pnLOgMnQ0giQEZZfpzudYGUGB5Kv72A= Received: from AS9PR06CA0441.eurprd06.prod.outlook.com (2603:10a6:20b:49e::24) by AS8PR08MB6712.eurprd08.prod.outlook.com (2603:10a6:20b:393::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::d2) by AS9PR06CA0441.outlook.office365.com (2603:10a6:20b:49e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:21 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:20 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 17/19] arm64: transfer permission indirection settings to EL2 Date: Thu, 13 Apr 2023 12:05:11 +0100 Message-ID: <20230413110513.243326-18-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AS8PR08MB6712:EE_|DBAEUR03FT033:EE_|AS2PR08MB9426:EE_ X-MS-Office365-Filtering-Correlation-Id: 13edb374-2f80-4b43-d363-08db3c0f0276 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: RK1sCOQoKCPDNMNjfWggBMMwfDawZqhtBZWxNfjfUyShCpV1INvAxiRjMpo4enFnKieWBs8lO5fubiMgCfRo20eGNA6qabp+jeVDtvNxgHCVCMzUVGsbwcO/j5kKcElls3nmnkCssXN5JhYki5SouIBScFFRqvdwb6bQjzZocVM9FOtHByZPSBrNoPB7K7fezU/qecL2E45dSbEf/RLm971wsiq71bN/Iq/AfNwQJZw2lwGCC/prl7/gi9Of7GdHw4LE94rzJEtnFH0/K5buk7Ngo6O1+6j14QqV5qURwcvcs9uEZ3PiuAdIM37hWP6aLRh54XbJhWFkSABrb74qUA6BKeMGRVKMeuuk/SHSpqJF6CfQeH7L72vofOmBx8R2JSR03r69BIOVtcx9hU+dm/4UIuAlGH0kCE8jl/OJdxB9BolIV7dEwvA5q9OLFyu7lEJ8H1GzemBhHAfRPmFClB3iBQx68D9KmJxyY5epbQN2wKN/v7HcZR6iA8ReUb+Yqqlwuj9TS6qvMx9/z+VDp8PDlsqcxW8Zx6tOYg/XQ3mBfJLATj8uyLdKPjejYuKMqbRTTV2S3dFN/Z/FYbnCjmiX9z5UdDo1jKcAxifroZ7o7FlO/2qoYejlqgF8mZiupgHlO64AruP1R3232Za1y7Jgi0oc1DaxHdw8xAjyRVLd7hgJsFWFHXIcTBsTtKhUEDmtBtZefZQxg3lrMpyR3SCRYukcHFxWYTly/6H6Vkk= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199021)(46966006)(36840700001)(40470700004)(86362001)(54906003)(44832011)(40460700003)(478600001)(356005)(81166007)(316002)(41300700001)(82740400003)(8676002)(8936002)(5660300002)(6916009)(70206006)(40480700001)(70586007)(36756003)(1076003)(26005)(426003)(336012)(186003)(36860700001)(4326008)(6666004)(2906002)(7696005)(2616005)(82310400005)(47076005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6712 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 94e6f6d3-a0f2-4eb1-7f93-08db3c0efd5f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oIU2CysvLHWJYeN7OOZVLAWEVK2gWOyTcxoNR1oxlTFduboO6cvYwXeDheRvF0jJG7lplWNRD2z8uxktlUWeGQecEdSXngBHWbWPtC6gaX+FpN4lvb3H+0syus71difsL/gWal4pmmj/+WCCEX/be2IHu/tMSth49hQMxCgBfPeYWrPiMFI145ZUwvht98MYPOs61CK5Ua098GFxD57TqGRwubG0DyB87nnDtRvE2mQ8gPoimb5X1O14EvMph82it+6meo1oEb2Hqwl4SnRxr+ttLHwcQynl/IMWfgyc81/SoWkkUKu9UC4vqFt8NHvUH3Qx6uIMxGbS62S9IU02EE2UvlpB9ErQtS4YsrHSt/QPPTyuekhqukGE1tXGnEEzsSo1wc6V0ltNkxJauTcIc2pjMNl7iZSzPZcFW7zwGSqdZDcDMU6GKpMcCUSeR85BC2x42UAmPVE3PMzaOuGQhVvC45J49K925sLVWiFbDO8x+xpIVw2iorZUTZGEwakRX6hzRr3YCKIOcNZSAGSfzHsHi/gQQi0A0MYExs+IvjMpI0A89/2HwQA+JHLXTvHxQXeebBXj1FoH2S3pqBmXlG+naeIDfgF86pizJUnIFbwtJdZ95lN1xhWiz8UKsxZe5FV9ihVsWq65GPyk7j5K4ZVBO5yvyk8xsG0ZcddFa9AWNsugTAF8Oxkc3rriqU2CHGq2mMHz5CAS3CWKol1ifA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199021)(40470700004)(46966006)(36840700001)(36756003)(2906002)(26005)(40460700003)(54906003)(478600001)(8936002)(2616005)(81166007)(47076005)(1076003)(82740400003)(44832011)(186003)(5660300002)(336012)(40480700001)(426003)(86362001)(36860700001)(70206006)(70586007)(4326008)(8676002)(6916009)(7696005)(82310400005)(316002)(107886003)(6666004)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:36.6574 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13edb374-2f80-4b43-d363-08db3c0f0276 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: DBAEUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9426 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040552_018853_793E8DB1 X-CRM114-Status: UNSURE ( 8.32 ) 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 From patchwork Thu Apr 13 11:05:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FA08C77B6C for ; Thu, 13 Apr 2023 11:07:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EiWJvUO3zuK8pp7Elbs8AQgtboCKtRRjZzlEcRViwsA=; b=U1XmNsp3XbT6I9 yvLPcxpSMOCxT0IczXhoFDUh4ifb4W4WbOtqdDWgU7sC+8emF74utIs9aFlngKqUYytSpMb0Rrv1d jqB7D7MLpPuNdDkaR5nsZNCtdj/223rghqxsKPgUqWpI8zFMkyZ3QO4ZGEcN5HxapjHpmUCALRZH6 37qxtejHkMHqkpUuJQlTrqeVKVlAB8wvhn0hCjwz+9waiFE6duUURS8LGgn5uYjmLbDis+EpYsKXw Hisy3yMyL9jAHc3C0FkEh6RQSsgTNqB7OCRJlCU/lgbkl5L5FvHE+fwfYRhIml4zrd3HS9ceGB3om Ms+zyjcE9dP2ctZMwwQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmum6-005yYN-05; Thu, 13 Apr 2023 11:05:58 +0000 Received: from mail-vi1eur04on0606.outbound.protection.outlook.com ([2a01:111:f400:fe0e::606] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulr-005yNh-0E for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=PjR923HtlSQK/rpFR0dxgGkauR740lYEuzsGIhC9MtN7fGb01YsR+LS85pZyOrp17QUTGDDm1T9j5YLCZ2zxzFcsWsrR6Lgo7Y+QI4OodqG47fZegZ2MjveAz157zEUTBvGKprJBhDWgjgbeTInuiGvsgmnpasJo6lwCj67eiqc= Received: from AS9PR05CA0236.eurprd05.prod.outlook.com (2603:10a6:20b:494::11) by AS8PR08MB8971.eurprd08.prod.outlook.com (2603:10a6:20b:5b2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:37 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:494:cafe::74) by AS9PR05CA0236.outlook.office365.com (2603:10a6:20b:494::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.32 via Frontend Transport; Thu, 13 Apr 2023 11:05:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Thu, 13 Apr 2023 11:05:37 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 13 Apr 2023 11:05:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e6b7c20ac53e91b4 X-CR-MTA-TID: 64aa7808 Received: from 1e35726010cf.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 43379424-8A14-4D34-AE9A-5786973B8FB4.1; Thu, 13 Apr 2023 11:05:30 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1e35726010cf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lEF/yseoEUn+i+mUf8zYzciEd9ZCkFPRg8OgO7siYGZkTD1Ba///2pSwjCBLW8ijP59FuWbFRZTDyq9xeXdmCwEZonEjfigUjrnagc+IW3PmWp8Edf3A2Fpn6kp6YfQ88W7lljfnemevqN11q1sEMqkz4OMhACUuXFdA8mQ64+v+6c1CcUN3Pb01lut8EyF1Ls6C0hzaVSxEWVZP3uBUlDz43gQT6DEHWVrTNKiq/FGuYotp4mIYpIj3V13LdM87M81kq85JW0m18MBSfVy4jRUXvXqdJAa5+wGFccUIE2Fbw32OjXpXY3BwsHgf8ZkEysHd/sNF8J0jYyhL+38IWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=kOqafftinu/BtSPGcaeRyPhkln5+MSlc+jjqbhFvDgy2OXBLroVglAWIVSmwrjB188JnP08YCV3IuDsXTyZYYCRlMRvttS1TejOvXOZkndzIbt3Dx3usn3mcluPTEX44YD7kegHxrdlYwyv5LPjCpJRA/Ojg+jt19eVSEPT4jjEGzKrikyy2hWCKXP050afzX23FZ0tAk6WgY024PSlCszOjxvSvm7mwjPGS3jUuKTQiXM/+ba3KUGrICSdg+fjTxw+8x16bug9i8fU8c8a8evVvGmr+ZKSyT4IPGjGsSYqNgyg7jcoss7X8Z+lQH/aI/SRxZheHeYntrnVLPBBPUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y6NwRzKkBh5XW55WVDrgX3Td1hmHnJB94hBMAr675Fk=; b=PjR923HtlSQK/rpFR0dxgGkauR740lYEuzsGIhC9MtN7fGb01YsR+LS85pZyOrp17QUTGDDm1T9j5YLCZ2zxzFcsWsrR6Lgo7Y+QI4OodqG47fZegZ2MjveAz157zEUTBvGKprJBhDWgjgbeTInuiGvsgmnpasJo6lwCj67eiqc= Received: from AS9PR06CA0449.eurprd06.prod.outlook.com (2603:10a6:20b:49e::29) by DU0PR08MB8277.eurprd08.prod.outlook.com (2603:10a6:10:40f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::7f) by AS9PR06CA0449.outlook.office365.com (2603:10a6:20b:49e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:28 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:21 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 18/19] arm64: Document boot requirements for PIE Date: Thu, 13 Apr 2023 12:05:12 +0100 Message-ID: <20230413110513.243326-19-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|DU0PR08MB8277:EE_|AM7EUR03FT059:EE_|AS8PR08MB8971:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ba17354-6704-4a4a-ebcc-08db3c0f0332 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 561EV+R1vowAJDjEPcng/ziVpjd9a8unzBhVPpL9JH8FjjNuKrJHmuJwxFKRlVxVXfKTBXa936xVke8QlQUAMSZOPYanxntnyP+RN5NxYX55XQF+oI8TI6zQZhNo24C4YnIi34TPp1w8ueHPoYbbBWWe9ANghXa0aSmX8WdAm5DGWlQh04YrZ8bsCAxKD0idmgfjnFgCReIWSDfHyGQoygH9FfvQqfMcKxO0Mo7OPzcBxg2R4SjS1bq4Y43NiL1mdq9LHEXiIHMuX8OU0deJMuAcsVZ17BcUFzc+kmFLQCURcLo9/7DR/kGZt75R1oRSdBS9bUtdqBn60i2ENwevwP8bHfGK7r5XXo+gQOSFhEh3jszTf9eTWIU2LTC1ZFEi4w6vrVfIwr9L2js2nivvB/LbF4iuwb/j154hWc7fGgDzRBrojWMYMP7Tr2tjsQpBF3ia9B0SmFL8Ih9ZRDYwEErzGRLR8N8Xcapw3HCGRFuWK82mOGZ7y90d2aaozCXIil1Bdbptc9hnFTekVk8qIPrOvDjXoPo0vmfsYkOv9sgsjOaeXOhB4mxdi7qreSjgCTklFxo78i6WuCse8zJ33Y6mqbfI4R1deynzPvdjkPM4/0t7c09GBLPaz4CccU47bYw0SBdhZ8ugtdOHbQ6ViaqUokCpEPgcF3SPT/n+h9GQajF1BjpsZ5seh6qXz2DQrc78cSalPKCX603ZTMO3Re1Y8tPPkqGYqIxwpcTbbIk= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(136003)(346002)(376002)(396003)(451199021)(36840700001)(46966006)(40470700004)(36860700001)(478600001)(54906003)(47076005)(2616005)(26005)(1076003)(7696005)(6666004)(81166007)(356005)(82740400003)(41300700001)(316002)(6916009)(4326008)(70206006)(186003)(336012)(426003)(83380400001)(70586007)(2906002)(5660300002)(44832011)(36756003)(82310400005)(40460700003)(86362001)(40480700001)(8676002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8277 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1702c199-5ac4-4aa2-b6f9-08db3c0efd98 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GtVIbbuaJLdP7zyIU54XyxccAcDzo0ctZq/Q3VzJk22DibwI/kgbcp2ROnQDSS617OC+/GXp0x49d6ZzpJTuXP2iG5yKxNjS0mYO1GnhbA8aCJP229HYcAcJqB9SitdLMx1XcjGLmRKIcdD5jfTzlWVD+3uVlrMa3dB7Mjot8LMc9JvBHlaAgNuldPK1VGK5JOpDbzpbOZOtDEkzmwfbqgx+gn+K2kJXAUGDiitlEgRYc6SzK80twjDqHkH2SbePhRNJDfBdEYMSq73z6UwfORLs03ClVUsT+ArwQxKjWevYlzNw7ABoOXTmXheEUIxNxzu2E7IDOpONpzAY/Td6gOfoR6E7z57Ouq+5hso5aVw6C8udJBuM6wO7Mckl/PDjOyp+iOkHUPbsqRwb5HrU4DdOhirRj548xoXrFEedVIt+PLvm86arUz/N5Zyy7WKtCO3+xe0EOkDiehxgBGkQ1i/g/U4UVSjfhH1XtpsJ/ZxionOttMsbjcOSQuzn51aqz0g5OJCOVgCUhv3d8g+nMVa/T3r2LMKd/0vvFqlTFCofS7wX89yBse2XnA098xCiqCixmFG/NdFmR0Wjb4Hpevxn/31ei4atIobkJxOjTuI4rjgSfMb/AmSgrSXkFdZwp+PkV6IRiRmA0aetjh/Y4kHdCyvhX7mjLDUwt6uEXyqwXR151QOW5r+efYGZbRUG6noZXzMBpQJ415CzuENK8g== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(346002)(376002)(451199021)(40470700004)(36840700001)(46966006)(36756003)(82310400005)(86362001)(316002)(41300700001)(7696005)(6916009)(8676002)(54906003)(70586007)(4326008)(70206006)(478600001)(8936002)(5660300002)(36860700001)(81166007)(40480700001)(44832011)(47076005)(82740400003)(2906002)(186003)(1076003)(26005)(426003)(83380400001)(336012)(6666004)(2616005)(107886003)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:37.8277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ba17354-6704-4a4a-ebcc-08db3c0f0332 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8971 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040543_138343_FFCF7FBE X-CRM114-Status: UNSURE ( 9.44 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Features PIE and TCR2 introduce new registers, update the trap requirements for these features. Signed-off-by: Joey Gouly Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Reviewed-by: Mark Brown Reviewed-by: Catalin Marinas --- Documentation/arm64/booting.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/arm64/booting.rst b/Documentation/arm64/booting.rst index ffeccdd6bdac..babbf36f0ce2 100644 --- a/Documentation/arm64/booting.rst +++ b/Documentation/arm64/booting.rst @@ -379,6 +379,32 @@ Before jumping into the kernel, the following conditions must be met: - SMCR_EL2.EZT0 (bit 30) must be initialised to 0b1. + For CPUs with the Extended Translation Control Register feature (FEAT_TCR2): + + - If EL3 is present: + + - SCR_EL3.TCR2En (bit 43) must be initialised to 0b1. + + - If the kernel is entered at EL1 and EL2 is present: + + - HCRX_EL2.TCR2En (bit 14) must be initialised to 0b1. + + For CPUs with the Stage 1 Permission Indirection Extension feature (FEAT_S1PIE): + + - If EL3 is present: + + - SCR_EL3.PIEn (bit 45) must be initialised to 0b1. + + - If the kernel is entered at EL1 and EL2 is present: + + - HFGRTR_EL2.nPIR_EL1 (bit 58) must be initialised to 0b1. + + - HFGWTR_EL2.nPIR_EL1 (bit 58) must be initialised to 0b1. + + - HFGRTR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + + - HFGRWR_EL2.nPIRE0_EL1 (bit 57) must be initialised to 0b1. + The requirements described above for CPU mode, caches, MMUs, architected timers, coherency and system registers apply to all CPUs. All CPUs must enter the kernel in the same exception level. Where the values documented From patchwork Thu Apr 13 11:05:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joey Gouly X-Patchwork-Id: 13210148 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 9E91DC77B6C for ; Thu, 13 Apr 2023 11:07: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=UkoItwbva6+MV82NMXb6s3kL0I7mD5VtkwypNkKFjlE=; b=OWHLwszVnkPSM6 dwkLjyTy9nrrdM3ySiJoLZf/Wre3G9Jhyxr1hERrChatoNCl0wgT0cZLp7MRl//hT+VIoxM6oXj6d LOR8LVBhDKdYhtOljaA67w0jMYrtMCmMQsuAbEQaOo5RNUmlJgrR74WpHv1GHMt7R57HK5VdWRXNp u3nDaYWJO/7/5phI2IThZl9ufCi60254zWWaRBOXOy8VFwBwdk1xsv0UDhHoGlf7y38JjhvJE80mY BNnIR1qpAKudriAD1jRmaFq1c2DOsk+OLbSNi2NyLXhOHAaJNIeyt0j7Omoecgn7eUxQxOeCPfLSw I/xJBmZaEWhdRS3t4u/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmumo-005z5F-0j; Thu, 13 Apr 2023 11:06:42 +0000 Received: from mail-vi1eur05on2061b.outbound.protection.outlook.com ([2a01:111:f400:7d00::61b] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmulz-005yQp-26 for linux-arm-kernel@lists.infradead.org; Thu, 13 Apr 2023 11:05:53 +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=sWHukgSFUab2CA2zEGTG/oD57a/wnjXZVCIrS6s84Nk=; b=zb/mGJVIFw1I2f5wLzbwCcQaFUpNbLI1gX0GrCwRYoauLy+WwmaIt+BKtEjeU4c+vBamZzXxOHFhI4e/CnLns7yWGXYdbY9mt8OF836LhUnwGKm2piZE3d9QhmbFPBplsY2yQlPhaZNvYwSi3wvm4AjgqZajLZ/FlgDw7BbbTVY= Received: from DB8PR09CA0031.eurprd09.prod.outlook.com (2603:10a6:10:a0::44) by AS1PR08MB7515.eurprd08.prod.outlook.com (2603:10a6:20b:482::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:43 +0000 Received: from DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:a0:cafe::33) by DB8PR09CA0031.outlook.office365.com (2603:10a6:10:a0::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT006.mail.protection.outlook.com (100.127.142.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Thu, 13 Apr 2023 11:05:43 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Thu, 13 Apr 2023 11:05:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e1a69836d29d85fa X-CR-MTA-TID: 64aa7808 Received: from 9de39633b086.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D266822C-4A3A-428F-AE9D-F38CC940E9C6.1; Thu, 13 Apr 2023 11:05:36 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 9de39633b086.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 13 Apr 2023 11:05:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M604+nutulIu7a7wPz3yLGbe6mGWMXtZ5d1EEWT765Q83tCYlkr5pY9IeIOrcur1/YoWfvjY0HMIsNJwcnTQJgiaC1pWGZtluHXZiV18IgX3AKXQwhtRw0Y3/JRZJFayJgWlmpRubsFKDd21QskVO71wAMmBEp/DucDi6pICsAm9nbYnRqDJ4xQYZJNQr1ZqExoHawDDu5W9OARyiQ+XUrE/v5rkgXp1hjGDwiOxw2PZXRq38GWAfklxJxqITe8j4p9f26yqhJP9UDX/kEEqjLeVPuiAV/fwyC/FkbshTOJ5DWDvqKkdKqzHcrYQCIB93N5FuMRTA5IPPgK1XaIlkA== 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=sWHukgSFUab2CA2zEGTG/oD57a/wnjXZVCIrS6s84Nk=; b=VpCZljGjDVfB5aBz8JrgFgA//YDvFXDA6m6GCXat7+4sn/mQpYToVq3VdjxdvH+twAgw9KBo+bWMt2v7OU5XLoe+uHxP8PGyD93xaD/JZTEhBrfdYfpuSVdB1SLfYqse5JVWG1Qb5mLNs25u+gia8IYaJIyBvt1/iqSXj/YRg4WjOasoVJxAz1AlTieYQaZUkqzKKNLXDGph/8hO9yLVeWNJ5BBxrpGh9RogdP2BHVh8NVqVz7nPX4xpIn2IXlFsfeLngrLVmSLvc1bsU/mXE85dVXaZXwwS4awDh6c+a89aiM4qS42X+baI7cnvXI5dvYgi0VBGRaalV1lRmDpLDw== 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=sWHukgSFUab2CA2zEGTG/oD57a/wnjXZVCIrS6s84Nk=; b=zb/mGJVIFw1I2f5wLzbwCcQaFUpNbLI1gX0GrCwRYoauLy+WwmaIt+BKtEjeU4c+vBamZzXxOHFhI4e/CnLns7yWGXYdbY9mt8OF836LhUnwGKm2piZE3d9QhmbFPBplsY2yQlPhaZNvYwSi3wvm4AjgqZajLZ/FlgDw7BbbTVY= Received: from AS9PR06CA0424.eurprd06.prod.outlook.com (2603:10a6:20b:49e::8) by AM0PR08MB5347.eurprd08.prod.outlook.com (2603:10a6:208:17f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30; Thu, 13 Apr 2023 11:05:29 +0000 Received: from AM7EUR03FT045.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49e:cafe::3f) by AS9PR06CA0424.outlook.office365.com (2603:10a6:20b:49e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT045.mail.protection.outlook.com (100.127.140.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6298.31 via Frontend Transport; Thu, 13 Apr 2023 11:05:29 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Thu, 13 Apr 2023 11:05:22 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Thu, 13 Apr 2023 11:05:21 +0000 From: Joey Gouly To: CC: , , , , , , , , , , Subject: [PATCH v2 19/19] KVM: selftests: get-reg-list: add Permission Indirection registers Date: Thu, 13 Apr 2023 12:05:13 +0100 Message-ID: <20230413110513.243326-20-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230413110513.243326-1-joey.gouly@arm.com> References: <20230413110513.243326-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT045:EE_|AM0PR08MB5347:EE_|DBAEUR03FT006:EE_|AS1PR08MB7515:EE_ X-MS-Office365-Filtering-Correlation-Id: e8c0ab3b-2b50-4814-125a-08db3c0f0665 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: 04PPaVBN6oFeZSZxMCVmMDW18OnTi3v10/eQTb/lOufHLF58vHBON81Cl4yVJrX2Y9Xtdn1ZlYr3z/nE2uIXzSD2BLGCfI8KxHc6P8Pm4Ed3QdXkbw7MWkc33kZM/PFkny0aG6raO2i0FZ+mOHFblFXi2On3yPzrQ9J3OanD8e7IMYt3QmbVhbr1PsWVYuycz4sDWAHw3Z7VQGg/AYNA3mTEsi9V+YESdWNoVWba9HR4T1HZ1E6hyiY539PtQph9ylciBigCvAUDNLCCl/NAaSGeEcCl4lg7uk3ydP0XZdzVWOEO2QHFnoVNMn/pbdYhkILEl3tPKvIwqiM6mKDS9hOVDxp01f/TiBN9cJvEXJuh4g4/AgxCF85rsmNBPakljbdFvxzGlIq89cC5p/u8gNg+SK5TzJug6rCjSeFYMTBuk5emJlPvbrLuy1nk4TAVEIcxyFiqSUGLfr4H7OgnEmh5kO7lkX3L/o+FZDmte1Pko37xWmoPUrWkf2joHfUUtaYTFnlpstPCK0arI8n6xWtkgnNFhNgdhyy2DC/xLnIdNJNsvqTwpdcd+k/HpBaeC5I1ChTlLDJFRESrt/UCaRSYyaJrB630m0NOSRKjhCKhzYJ2aMeZie+dmkEkNch//bAvA1DKXXiDYoT3guo43jiDwp5wYzEWYLGwGJ5WzliqttmTOhQ9NRRnWN4iHuSFf+ORizT6be+yydfGfxgpzATr6vMLXj2ygzTlJDz3Dk0= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(336012)(426003)(83380400001)(7696005)(47076005)(41300700001)(44832011)(86362001)(8936002)(40480700001)(36756003)(2906002)(186003)(6666004)(26005)(1076003)(82310400005)(5660300002)(40460700003)(2616005)(8676002)(478600001)(70586007)(4326008)(70206006)(6916009)(316002)(82740400003)(54906003)(356005)(81166007)(36860700001)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5347 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 60ddb017-3459-456e-b100-08db3c0efdf5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /39po4DOsqYq0elXbehqesEbtIXOH4oH+QgpNsLhKEWHGenqAQjfVxzz1mveRNLMmzzb1tIECIRjqxDTj6/KYQG2FaU1EF8UG6vtj17VsF3b8SwE1s4ZhX8l6v7lCfKcqtmnnLI+RiexlwQpMs+OOTaD6kI5uLd3Kj8gFryLdw5sI4rpKjxbzyr6/jvoodPeOXtHWN+PqFYcVOPUjbnx/WTt/1B7zRGw0P6b/TzQjttMwSGZ6fqpDzSKFoVHVMHLyoerT7VOSgs0uDtA62qfRm5Sd+kE37cIHXFIEhIwm/yjE7EuQtmQomP+4piw+9xfiSVDgkBbZtIlWnZZOm4IirJabb/AHrAOPx/PhzDGJMfknZSwynvaRg9yMWijWpTHGC5NTo1MyGDPxyZTtO0Ie3t1pi8gifSrvdy5FHH7PG7sRjP6Hm43Jr8yFTbiRxemks4rgJDsq7m7bH3lEgNRljahgf3BtgKDdKCFGwf8jv0F7ggjWc3lxfUomp134SwwWYDECWUzbnabalumajXRiTLVksAV3ASXZQvfSzRf5GiCklJT9bSe4DuMDfYt3HKYhVXXZUSsNxyU+UMaeCf5ubrpgQSMaz1lF3z3Ivg7FINTmxDfLcaSt5Cqh8xvK0vQXHYGIReLxEq4AtDZsvbqZ1Fqxs4VZF/GjUyRiKkR8mgzT0l/IaBDaH07DKn4VEhipzw3UCk6u23Gv/sePbDWNA== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(6666004)(7696005)(40460700003)(6916009)(70206006)(70586007)(4326008)(36756003)(2906002)(44832011)(86362001)(81166007)(82740400003)(41300700001)(5660300002)(82310400005)(8676002)(8936002)(316002)(478600001)(40480700001)(54906003)(1076003)(26005)(336012)(426003)(36860700001)(2616005)(186003)(107886003)(47076005)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 11:05:43.2207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8c0ab3b-2b50-4814-125a-08db3c0f0665 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: DBAEUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7515 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230413_040551_708285_62DF40A4 X-CRM114-Status: GOOD ( 10.54 ) 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 registers: - ID_AA64MMFR3_EL1 - TCR2_EL1 - PIRE0_EL1 - PIR_EL1 Signed-off-by: Joey Gouly Cc: Marc Zyngier Cc: Oliver Upton Cc: Mark Brown Acked-by: Catalin Marinas --- tools/testing/selftests/kvm/aarch64/get-reg-list.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c index d287dd2cac0a..3731b8183b40 100644 --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c @@ -832,7 +832,7 @@ static __u64 base_regs[] = { ARM64_SYS_REG(3, 0, 0, 7, 0), /* ID_AA64MMFR0_EL1 */ ARM64_SYS_REG(3, 0, 0, 7, 1), /* ID_AA64MMFR1_EL1 */ ARM64_SYS_REG(3, 0, 0, 7, 2), /* ID_AA64MMFR2_EL1 */ - ARM64_SYS_REG(3, 0, 0, 7, 3), + ARM64_SYS_REG(3, 0, 0, 7, 3), /* ID_AA64MMFR3_EL1 */ ARM64_SYS_REG(3, 0, 0, 7, 4), ARM64_SYS_REG(3, 0, 0, 7, 5), ARM64_SYS_REG(3, 0, 0, 7, 6), @@ -843,12 +843,15 @@ static __u64 base_regs[] = { ARM64_SYS_REG(3, 0, 2, 0, 0), /* TTBR0_EL1 */ ARM64_SYS_REG(3, 0, 2, 0, 1), /* TTBR1_EL1 */ ARM64_SYS_REG(3, 0, 2, 0, 2), /* TCR_EL1 */ + ARM64_SYS_REG(3, 0, 2, 0, 3), /* TCR2_EL1 */ ARM64_SYS_REG(3, 0, 5, 1, 0), /* AFSR0_EL1 */ ARM64_SYS_REG(3, 0, 5, 1, 1), /* AFSR1_EL1 */ ARM64_SYS_REG(3, 0, 5, 2, 0), /* ESR_EL1 */ ARM64_SYS_REG(3, 0, 6, 0, 0), /* FAR_EL1 */ ARM64_SYS_REG(3, 0, 7, 4, 0), /* PAR_EL1 */ ARM64_SYS_REG(3, 0, 10, 2, 0), /* MAIR_EL1 */ + ARM64_SYS_REG(3, 0, 10, 2, 2), /* PIRE0_EL1 */ + ARM64_SYS_REG(3, 0, 10, 2, 3), /* PIR_EL1 */ ARM64_SYS_REG(3, 0, 10, 3, 0), /* AMAIR_EL1 */ ARM64_SYS_REG(3, 0, 12, 0, 0), /* VBAR_EL1 */ ARM64_SYS_REG(3, 0, 12, 1, 1), /* DISR_EL1 */