From patchwork Fri Mar 10 17:36: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: 13169841 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 CBD38C64EC4 for ; Fri, 10 Mar 2023 17:39:22 +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: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:In-Reply-To:References: List-Owner; bh=y8JQYjHqMFiDJ08hekZc3dpMmhJ9SO6+wudYN9Zskbk=; b=ngWZxBXDviouSJ N+F3YKN8uBCPq/GinJ47g80FcZAYDsx2MCNx/Y0kK+WgUBHYVAdLCTmx8yRL+oWEvVEO50tTBbxV9 hoAVXlYzAfjbyas5j/29ubabQ1MOZrmdzvEmVq+aeccI80RUgzKeHM4mqaOluVf/TfUJHUmCUGVrP jg4+TipPp7igl9GsQIXMwqbe2DSoxJ6d7XDd0P04+ByPa+vQhTm5j0K4llfA4PrdL1HPDexlqf1kX J/q9krhBt5WYdt0XW+UCaanUVabQPhUJ8oAc96efu/Pt0ktaw1RG1VXuKUNp14kxVqOJUr4GMSg1D ZItSMiRfilNj6cyZb3Kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paggd-00FaZ8-Cr; Fri, 10 Mar 2023 17:37:47 +0000 Received: from mail-dbaeur03on2060e.outbound.protection.outlook.com ([2a01:111:f400:fe1a::60e] helo=EUR03-DBA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paggN-00FaNb-83 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 17:37:35 +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=eAHnu8tPKBQi/SYG6YtVAatT6b3FdWYkIgJle9GCbLQ=; b=iMD8jh4qRwFQZg3trTFjPTp9TgMvyR9EdcthEW9BbWrEWPqvIOZI2an6KFLolbzEHHQ9roy3vbFwVGzn/HNUCZ/YbaiCMtxjYlV/SXodnQtHmI6FKwz/ApoBt6RsJGtec3TRkpbZSftYcs4Gwr3ijWpbOOiwxP3LN5MpW0lIxhY= Received: from DUZPR01CA0080.eurprd01.prod.exchangelabs.com (2603:10a6:10:46a::9) by PAXPR08MB7468.eurprd08.prod.outlook.com (2603:10a6:102:2b6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 17:37:23 +0000 Received: from DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:46a:cafe::dd) by DUZPR01CA0080.outlook.office365.com (2603:10a6:10:46a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 17:37:23 +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 DBAEUR03FT050.mail.protection.outlook.com (100.127.142.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.21 via Frontend Transport; Fri, 10 Mar 2023 17:37:23 +0000 Received: ("Tessian outbound b29c0599cbc9:v135"); Fri, 10 Mar 2023 17:37:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 21839e4be04e1996 X-CR-MTA-TID: 64aa7808 Received: from fbb0a4eb5c3e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id A297C9EE-A0F7-402B-80AB-EC663896A2E1.1; Fri, 10 Mar 2023 17:37:16 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fbb0a4eb5c3e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Mar 2023 17:37:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gjn/paU8+2tOBVCY71Rea7FfaSgSwtFX6ZarpJOBOdQXjIXJU30WQ5werGJ0Z6QYRYUbmqa14GzXGiC+Z39ODWC49Z7FsP1ZygxcFKIi6+oQbOjZCGw5925wWi5s18aFFNmYAW9uAHyXa2Tsqs6ZTV5OtbKRDNKyny44vO/5asSMOR2XJaMcqqWsLAGEHAuH/8ff3+jSixpZ5RE0ymbsG6VZIGy+0uYAan7ocxV5NkaTxEMukKeO127boQcSPuOA/UDl/Rx1yTCHGa7TjmKglm/44bNqZ7zSh1vGRA3ku8qbD5Q2vmH6CY+kBLXN5FpAt47IhpbClhwfHzQQXeTuMQ== 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=eAHnu8tPKBQi/SYG6YtVAatT6b3FdWYkIgJle9GCbLQ=; b=kQcHeJi+PtvHNfvgIlf6hXxsjSNOp3yq9gV60x1zZaLdJIgIDHW1Y0bLDUJKUF6wzJld+b8JfWP5j0m7nW9a9wA47v0JziwuqTks+TkR9rkumnVOU/ztREtuz+JEGwmOoQ2iZkR7jpmOLZ0QaxNGpSOTA/CWNUSC2kkZ0ojISJoiWfJMNfxvDHVecCNaETf1T1X/3DIy7W7Vp1tNVKO/yUe059rWcfFXIVWqkmgEh0bfDZtelRz+gUTLc7JXmc08/v1ROxipdesXEG9rkuOr1TVdksxoa7OCdueb5l9iZRyde+Ph4+WCP0TV513YrrC2EOjsmVyMPwaYuxlY0KpJuA== 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=eAHnu8tPKBQi/SYG6YtVAatT6b3FdWYkIgJle9GCbLQ=; b=iMD8jh4qRwFQZg3trTFjPTp9TgMvyR9EdcthEW9BbWrEWPqvIOZI2an6KFLolbzEHHQ9roy3vbFwVGzn/HNUCZ/YbaiCMtxjYlV/SXodnQtHmI6FKwz/ApoBt6RsJGtec3TRkpbZSftYcs4Gwr3ijWpbOOiwxP3LN5MpW0lIxhY= Received: from DU2PR04CA0026.eurprd04.prod.outlook.com (2603:10a6:10:3b::31) by DU0PR08MB8496.eurprd08.prod.outlook.com (2603:10a6:10:403::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 17:37:14 +0000 Received: from DBAEUR03FT042.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3b:cafe::99) by DU2PR04CA0026.outlook.office365.com (2603:10a6:10:3b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 17:37:14 +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 DBAEUR03FT042.mail.protection.outlook.com (100.127.142.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.20 via Frontend Transport; Fri, 10 Mar 2023 17:37:14 +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; Fri, 10 Mar 2023 17:37: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; Fri, 10 Mar 2023 17:37:14 +0000 From: Joey Gouly To: , Mark Rutland CC: , Joey Gouly Subject: [PATCH v1 1/2] aarch64: enable access to TCR2_ELx Date: Fri, 10 Mar 2023 17:36:56 +0000 Message-ID: <20230310173657.57228-1-joey.gouly@arm.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT042:EE_|DU0PR08MB8496:EE_|DBAEUR03FT050:EE_|PAXPR08MB7468:EE_ X-MS-Office365-Filtering-Correlation-Id: 026f2863-1991-4ee1-f0ae-08db218e1ba0 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: +byVmP1iKC8g07b+f1Ijun78sxcoI+cSpR8PwqcDwQB4NdFtAx8VfIBsZQtA4hkFEDEQJEN7LULJhav/Z1FPgvg8GJRaDIDfCmddq/Z9t2t/kLdUILBcZeEpqaGTRVvLSp+cqzW2N5DV/lt8LM2FOUWoUu7X/GNruBV1IsaHzAv7CD0r21RubbghSep02iztsvp6POgNI70E3CR7FB8lqv4zPeIY8tvVCCD8+ZIJEFcJ8w1GFIjFgqzrusUBPEqmjDDhhHF73Vk2WmrT/+odU0tgo7dtzm06lDTSkEJT8zmxxelrTH3PvJcJShae00FmjNXMMxCz79tlCMEQNcl+dH54XrCH8QoUsKgZk5UnI1QLRzXOeGmd2COM/TfJphmYhq58yBFnItEDJixk5xJQk3LSb/W2tyxgMZZbw5Y7k34Kozyz+DlK3aoKDt8Jyov0sZPJ6reUn8fbQXfrcvK19ZlhuVJUCEIRKnGxNYcLut12EkwcWgaZJbQJcrjxuo7gJAsm9eVA6TXjMjK+QdiI13PHtjSlxCjIGBFMjXIHmUJZgrq5T9hM9zUtYXzIL5fayaF1B0CLA2RCcWLwooQMK1mC0sgBCwhwOvG9GoeMzF+fzEZxWGrGGNHqcyhnMxZnUCvFNzBJfrU7GF+nCoAcEKhVJ3LNn+K749hO43Pj4qZEziIi3vaSQtFdKzpqAc03oVmKxJ0iw4DUGLD+OGtNcEDt5/C3wdtHIUc7DhghLYs= X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199018)(36840700001)(46966006)(40470700004)(82310400005)(82740400003)(36860700001)(83380400001)(426003)(47076005)(36756003)(6636002)(40480700001)(110136005)(478600001)(54906003)(81166007)(316002)(356005)(336012)(8936002)(40460700003)(41300700001)(7696005)(2616005)(6666004)(26005)(186003)(1076003)(5660300002)(44832011)(70586007)(8676002)(2906002)(86362001)(4326008)(70206006)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8496 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 51e76fcf-0ef3-4816-524a-08db218e167e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y1kcZOBahE4WMOh4bbKjswFZyhqdKhpY4pVCmpmQVTycz4TQHmNV93ou1lCByXr1OgaDoxz851kBKi9pKW7nxUao5BFZLMuvqROogxgY22A9GjtHQI8LrcaC9gEQe6eVlhUtwjWDzE8kIKAUmuKW4+tb6ODIyQK9N64i9JbJwDsxBuMuU9KFWLg8lV+rIL1Bv4IXvIIjFsBp/QhWd0F2V4VY5b3ix29ZxgD/UmcaR9Hcan1pP1m8/XsOaInzPBN2ljweUH5NZTI1qK4HJF5873dt+950Zty+ztByHxoAD69DmvvsOVURxYSPKcDPLC6xZNvdzDmVZYy0uP3vcj0HxDqhue8WhAjlddMk9rrDaud65HcmlDW+FHgaXMScAyme4ihGNxiQF8eRtSCi3t/OPfkCMahNbUZMyEau/u269VeCURyBabEn/jZup3RinPB9TU/ktsQDSiqDVvNeJarQAGi83F43syT/Dv+RcphlAYJsxxEBEXZiMp98F9aZ6W9G1hVhswa6ZyXusIrKZqSLul5Rg/Va3QmavWYbMub/dEunHP1M+CB/0UNe2KA+yorrUw4AViwkMTjTJB9izaKpawdU92omMj2auzKKbgEY54ZAW3Cqbf9MtLullfPr4OOFLQ8Nysn1Gzu4TJdPzVTZ73Y2cskImgv89i/0XCBw5sJ782fu32XAEDEeDyKMviIF3Uvj6tp/vTLk8s1xRGbP5Q== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199018)(36840700001)(46966006)(40470700004)(41300700001)(82740400003)(7696005)(36860700001)(186003)(36756003)(478600001)(54906003)(110136005)(316002)(81166007)(6636002)(86362001)(82310400005)(1076003)(26005)(47076005)(83380400001)(40460700003)(6666004)(336012)(2616005)(426003)(44832011)(5660300002)(70206006)(40480700001)(8936002)(2906002)(70586007)(8676002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 17:37:23.5661 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 026f2863-1991-4ee1-f0ae-08db218e1ba0 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: DBAEUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7468 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_093731_596024_1FC61071 X-CRM114-Status: UNSURE ( 8.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Allow access the TCR2_ELx register which provides extended translation controls similar to TCR_ELx. Signed-off-by: Joey Gouly --- arch/aarch64/include/asm/cpu.h | 5 +++++ arch/aarch64/init.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h index 89a8f78..3686e08 100644 --- a/arch/aarch64/include/asm/cpu.h +++ b/arch/aarch64/include/asm/cpu.h @@ -51,6 +51,7 @@ #define SCR_EL3_TME BIT(34) #define SCR_EL3_HXEn BIT(38) #define SCR_EL3_EnTP2 BIT(41) +#define SCR_EL3_TCR2EN BIT(43) #define HCR_EL2_RES1 BIT(1) @@ -73,6 +74,8 @@ #define ID_AA64MMFR1_EL1_HCX BITS(43, 40) +#define ID_AA64MMFR3_EL1_TCRX BITS(4, 0) + #define ID_AA64PFR1_EL1_MTE BITS(11, 8) #define ID_AA64PFR1_EL1_SME BITS(27, 24) #define ID_AA64PFR0_EL1_SVE BITS(35, 32) @@ -122,6 +125,8 @@ #define ID_AA64ISAR2_EL1 s3_0_c0_c6_2 +#define ID_AA64MMFR3_EL1 s3_0_c0_c7_3 + #define SCTLR_EL1_CP15BEN (1 << 5) #ifdef KERNEL_32 diff --git a/arch/aarch64/init.c b/arch/aarch64/init.c index 471e234..f004e41 100644 --- a/arch/aarch64/init.c +++ b/arch/aarch64/init.c @@ -64,6 +64,9 @@ void cpu_init_el3(void) if (mrs_field(ID_AA64MMFR1_EL1, HCX)) scr |= SCR_EL3_HXEn; + if (mrs_field(ID_AA64MMFR3_EL1, TCRX)) + scr |= SCR_EL3_TCR2EN; + if (mrs_field(ID_AA64PFR1_EL1, MTE) >= 2) scr |= SCR_EL3_ATA;