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