Message ID | 20230616160036.3825473-2-joey.gouly@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 E0280EB64D8 for <linux-arm-kernel@archiver.kernel.org>; Fri, 16 Jun 2023 16:01:38 +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=YsB8fwjeqAKq5INE0W27g7vJy7xYBxw1fDoq4JUZn5I=; b=Azx/leW34JplaP o6tOCoLkS66Cx4e3uvNoBYsRK6hi+JkjER3CX7o+CHKFvB9xzdzHyG4CgO8sEXZnFYW79jzmrqRd6 xftapwR2f5xsMa3rFk6I+GFn7TFrOrqfmIPkLgDUigE8Ey0rQjFijftV6MguTFrktimqYbfw6usLy 09Ltw0wN95EmbLEwbLAJbnenJov1GETXWppbZWKIgC5GRSDAWN09f7j2DJ6PGX6JFN9U303hlIDCE W7yxKNGvxlYaBwiJlR2ufN3PQAQDcCVAqEXcApGbXQPrmj1mJEHME5puiPGu99edsbyB7HIxXp5IC YPpKH9SICNJmTqSaGLPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qABsz-0012Pk-0e; Fri, 16 Jun 2023 16:01:17 +0000 Received: from mail-vi1eur05on20627.outbound.protection.outlook.com ([2a01:111:f400:7d00::627] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qABsv-0012NX-0k for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 16:01:15 +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=Wo3MjU4xPwNuLArqgBTgRjeaCgCN4zcpYtCsGb7imyY=; b=BTj1i5j31JkNlGfcihEBmk3wKNp99nwhelc9hXPDSUI6GptQgw0rmbZcPA+9swYwfdkjtFHKlEA4cg8ExpiPI6FForl0TJLUTxJNsirvn32oc2F1Rm/X1b0H+g3qRzWrgHnEVwaFHAUtSjDL94tdrhEBXum/RNd8BmYYnLyGxsg= Received: from DUZPR01CA0194.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::19) by AM7PR08MB5397.eurprd08.prod.outlook.com (2603:10a6:20b:dd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25; Fri, 16 Jun 2023 16:01:03 +0000 Received: from DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b6:cafe::e0) by DUZPR01CA0194.outlook.office365.com (2603:10a6:10:4b6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29 via Frontend Transport; Fri, 16 Jun 2023 16:01:03 +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 DBAEUR03FT028.mail.protection.outlook.com (100.127.142.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.13 via Frontend Transport; Fri, 16 Jun 2023 16:01:03 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Fri, 16 Jun 2023 16:01:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 458b38ee56db1a71 X-CR-MTA-TID: 64aa7808 Received: from 47c05eac7c63.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 250C41C0-D94D-4587-B05A-23AE912CAB21.1; Fri, 16 Jun 2023 16:00:57 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 47c05eac7c63.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 16 Jun 2023 16:00:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SydOM8rt8tWUSi/a2n696P/NAGTeg9CZbEfyenpPqrxz7HuHW5OH8Zs/dyfe8kLiUW5wT4/oJD5oZ+Ip3Vgdmxp8RIopcGO0DJp0zzneBAjkMAQPzhHiuXbhtqx+Kj0LdylHZN/u/DtaBX9Pfmh0iXv41R9Edic4NvD1TweFsAtf6NpEthmZGzwRkiO8d8lIwcJKXfcrVEr98K6fMALLUUMat9fVZidOvfnMoWD/duOtE//vKDvtWCj/0UErz6bEXA6/VEl+Indmf2Yo8ON294oCPqLysL9ZWFa1tePLpsClXS7jTfHJ12RVtBJWef9vbOVoTDc8xPOmf4XZd1GGgw== 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=Wo3MjU4xPwNuLArqgBTgRjeaCgCN4zcpYtCsGb7imyY=; b=gaODQ5+rzjCDLirJw202eCKIDJ0n2sqy8KdVvTaUOPCuG/Dqpp8JpKo6V5UVu+sjFeAR9aLzjUt4soaIFJvSJCb86kPmVB0zICjhZaToLVj28mM97YlhL7goRpm6MI7BQSl3OWA+6J2/10ah328fSrTdABSIU6lrTa4G1pWwGGIvwleArJrnh7zy1A76Y1U/J5upqcPK0sgFkiP4dITz01TTvFP1SjZlA5d63Uo6TL0wiyIZxR7i15Sywnd9bejHIpTGGB0DTWnSkfgv2fg1iRm5p/zzO4MAVm7ZHfsu/ZiZsxC7aSTU9hrAwAIwTpz48af6hnDP7v45XS4XEeDOzg== 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=Wo3MjU4xPwNuLArqgBTgRjeaCgCN4zcpYtCsGb7imyY=; b=BTj1i5j31JkNlGfcihEBmk3wKNp99nwhelc9hXPDSUI6GptQgw0rmbZcPA+9swYwfdkjtFHKlEA4cg8ExpiPI6FForl0TJLUTxJNsirvn32oc2F1Rm/X1b0H+g3qRzWrgHnEVwaFHAUtSjDL94tdrhEBXum/RNd8BmYYnLyGxsg= Received: from DB8P191CA0013.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::23) by DB8PR08MB5451.eurprd08.prod.outlook.com (2603:10a6:10:113::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.29; Fri, 16 Jun 2023 16:00:57 +0000 Received: from DBAEUR03FT065.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:130:cafe::81) by DB8P191CA0013.outlook.office365.com (2603:10a6:10:130::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.25 via Frontend Transport; Fri, 16 Jun 2023 16:00:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT065.mail.protection.outlook.com (100.127.142.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6477.29 via Frontend Transport; Fri, 16 Jun 2023 16:00:55 +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.23; Fri, 16 Jun 2023 16:00:53 +0000 Received: from e124191.cambridge.arm.com (10.1.197.45) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 16 Jun 2023 16:00:53 +0000 From: Joey Gouly <joey.gouly@arm.com> To: <linux-arm-kernel@lists.infradead.org>, Mark Rutland <mark.rutland@arm.com> CC: <nd@arm.com>, Joey Gouly <joey.gouly@arm.com> Subject: [PATCH v2 2/2] aarch64: enable Permission Indirection Extension Date: Fri, 16 Jun 2023 17:00:36 +0100 Message-ID: <20230616160036.3825473-2-joey.gouly@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230616160036.3825473-1-joey.gouly@arm.com> References: <20230616160036.3825473-1-joey.gouly@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT065:EE_|DB8PR08MB5451:EE_|DBAEUR03FT028:EE_|AM7PR08MB5397:EE_ X-MS-Office365-Filtering-Correlation-Id: 86bbf7e7-7328-4088-23d9-08db6e82e314 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: ObpcbmWuaDzvyd1sSfZN1Zz0FLxO3DdAFWL4G2X8lkTmAXHuGaP0xqj7fnUVCUfFOBr9J4k2m5KBXfFy7jpuMmu8nsqcOdmPBh9K6aqmhvblxSEwUKCR684XR+U+sIJancvYshISr6kbMcf2X8JTAGqOZyOOdpa9XDcfykTB5QY/fC0PQRX5glkbfF+FCoYWwQNBs0HnJhpVO9FJul7paCstbeJ5pxo0oOHVJTn+rwQiZ0D1PL/S2MO6K/xsaE2pl+J77dV9YXBTjSVlSTgHseMWsXBHTbaKNW7Ya1xzaV3hA+IV46VBnYIV2Y08NsEgopxKgQsWsa5pJgUuZFgmNJ8GDk/Daw394BF7BDsjjRBGcQSKa+K/60tuMfQnbylLhm3EQwp34Z1YONBRXPuN+WTJgVZJ2XoxzY8NLRqe0y/P40Ru6KgAto8sWErZgpN+9PFo2w6+RYnquhTXnyi1wIch6zMG/OS9Y3G+tcO0ZIZHySElkZ0scPRC03iqaekMRYF9SHR8SXognCkUwIvFAW9LzdROZXsxzHyD8nUxN1NHpT11fv18rYd/8UigfegvTNI7MO2StUHNRToKL2tS7cBVuLKO7Oh8A0SkibtPZgc9pkwh+9po4wZIG67j/vDB0ikFHCmt7o+5EQUHjVkNbjigemSa+l/4Kj4ukfXNNeuKkyxrDtqpytwElYHP6H4icEGULG/WVxOWd3n8kKH8o9hMyyv3ntm0S2FCiIb3KTY5CbeHbkn/GxLHDmpPTikpN4PU1vRFMom5/4NwW40r2A== 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)(346002)(136003)(376002)(396003)(451199021)(46966006)(40470700004)(36840700001)(86362001)(82310400005)(36756003)(40460700003)(40480700001)(2906002)(26005)(44832011)(1076003)(5660300002)(186003)(36860700001)(426003)(336012)(47076005)(2616005)(83380400001)(70586007)(478600001)(54906003)(110136005)(70206006)(8676002)(8936002)(41300700001)(6666004)(4326008)(6636002)(7696005)(316002)(82740400003)(356005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5451 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4fe33f3b-6763-4cb7-81be-08db6e82de26 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FFimVY5xv7ilA+FHp+Hv0wLl5NddxjmE1eByuTCUIsXMjqFvYBsDalSZKS+FcnKesdc41WqZPeb0atE+/aMFOSBM2sAqnAJRrOgGYOebRDyBUQvqsKvO4NDd/aXfAI+21P/U3OeO+e3god1Swe6oAQDylEBPqLA/7J3y2GXQiiI6KAl/Og9YrTaG03k6YNbAjbGH/ZSKYK3ROfxiPtfX/mqF9s+KGXiHK/QRcN2j3c8iN6uXkwVCwgdQ79yJk1lnODFYnjfD9KwLFjX+aLPbpYBMkBwAwM76CPAlr0M16GXSF+bPwOE6N1LxUR0MOCbMxJhhsWJ6O1Xe8ARtWpk3Xpub5tX6bgemwqNvORzWgNW4GphEiaXk7SndvdcAutNBZbJP0rG2Td3U442ObJ0pbo7MANS+uyOd6RCuu1cv1na5frVtvj4tTxwQtxdBEFZOouHpgWHuyFi4GxOriiAs13mD5JYtt8rrh2gJVF/gRhALkboTjZN0Y8FgwZ/nwZRyUECEhhKpTBJQrR4iMRoRx+MQ/HDr8RMRWcoB9xxpyFUaVBa121sl5eBTYiBcQtA7GuJks3uqT2upMhBQ6yi/6OTthOI7P4IHjR2oAIoqwc5gZczcjWbNMQ9H6uWhIdGq3DbvOQfowiYtZ+0b0Kuh46QjWErWfcoR1yxQBoK+R+grMCG13uuau1gLUMXGyFsGEKVl+BFlp+wiAEi7aLU/zKjgApyeosXaSzuVnSrnWeSCj6pHe0ieJq8FX2LcEA4J 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)(39850400004)(376002)(346002)(136003)(451199021)(36840700001)(46966006)(40470700004)(44832011)(86362001)(4326008)(70586007)(6636002)(2906002)(316002)(70206006)(41300700001)(110136005)(8936002)(8676002)(5660300002)(54906003)(40480700001)(82310400005)(81166007)(478600001)(7696005)(6666004)(82740400003)(40460700003)(83380400001)(47076005)(186003)(36756003)(1076003)(426003)(26005)(2616005)(336012)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2023 16:01:03.7608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86bbf7e7-7328-4088-23d9-08db6e82e314 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: DBAEUR03FT028.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5397 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_090113_277042_ECC69793 X-CRM114-Status: GOOD ( 10.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
[v2,1/2] aarch64: enable access to TCR2_ELx
|
expand
|
diff --git a/arch/aarch64/include/asm/cpu.h b/arch/aarch64/include/asm/cpu.h index 0213d53..d1f8fd9 100644 --- a/arch/aarch64/include/asm/cpu.h +++ b/arch/aarch64/include/asm/cpu.h @@ -55,6 +55,7 @@ #define SCR_EL3_HXEn BIT(38) #define SCR_EL3_EnTP2 BIT(41) #define SCR_EL3_TCR2EN BIT(43) +#define SCR_EL3_PIEN BIT(45) #define HCR_EL2_RES1 BIT(1) @@ -78,6 +79,10 @@ #define ID_AA64MMFR1_EL1_HCX BITS(43, 40) #define ID_AA64MMFR3_EL1_TCRX BITS(4, 0) +#define ID_AA64MMFR3_EL1_S1PIE BITS(11, 8) +#define ID_AA64MMFR3_EL1_S2PIE BITS(15, 12) +#define ID_AA64MMFR3_EL1_S1POE BITS(19, 16) +#define ID_AA64MMFR3_EL1_S2POE BITS(23, 20) #define ID_AA64PFR1_EL1_MTE BITS(11, 8) #define ID_AA64PFR1_EL1_SME BITS(27, 24) diff --git a/arch/aarch64/init.c b/arch/aarch64/init.c index e09e050..c4e91e4 100644 --- a/arch/aarch64/init.c +++ b/arch/aarch64/init.c @@ -42,6 +42,16 @@ static inline bool cpu_has_pauth(void) (mrs(ID_AA64ISAR2_EL1) & isar2_pauth); } +static inline bool cpu_has_permission_indirection(void) +{ + const unsigned long mask = ID_AA64MMFR3_EL1_S1PIE | + ID_AA64MMFR3_EL1_S2PIE | + ID_AA64MMFR3_EL1_S1POE | + ID_AA64MMFR3_EL1_S2POE; + + return mrs(ID_AA64MMFR3_EL1) & mask; +} + void cpu_init_el3(void) { unsigned long scr = SCR_EL3_RES1 | SCR_EL3_NS | SCR_EL3_HCE; @@ -70,6 +80,9 @@ void cpu_init_el3(void) msr(TCR2_EL1, 0); } + if (cpu_has_permission_indirection()) + scr |= SCR_EL3_PIEN; + if (mrs_field(ID_AA64PFR1_EL1, MTE) >= 2) scr |= SCR_EL3_ATA;
Allow lower ELs to access the registers associated with the Permission Indirection Extension. Signed-off-by: Joey Gouly <joey.gouly@arm.com> --- arch/aarch64/include/asm/cpu.h | 5 +++++ arch/aarch64/init.c | 13 +++++++++++++ 2 files changed, 18 insertions(+)