From patchwork Thu Apr 28 09:37:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Corallo X-Patchwork-Id: 53295 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF8DA3858C2C for ; Thu, 28 Apr 2022 09:39:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF8DA3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1651138753; bh=sk349i9HXVDccGqZeR1irFStqWCazzH0YyIdbaOgeI0=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=WBlQs9bDklywmuzDYQZ50t075/co3+pQq1KlKcumv3DO3GDDwOA+DIyrluyJPMhZ8 hMhJIweDOoMEeeWmVGcXEl9cgFoVs6fQHQNmo2H4pCr/QZeSCQtfSqI7aFVvaEwkQl eD5GaWe5IaMTHKXtvnA7z6HSt2VikuhrALHAUuOw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70077.outbound.protection.outlook.com [40.107.7.77]) by sourceware.org (Postfix) with ESMTPS id 23A583857340 for ; Thu, 28 Apr 2022 09:37:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 23A583857340 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=FLCY2vOeVrdRWrPiEYz+tilucdvFPvbnHwVIspFzotkXcVGdF2bms3XuLw8wD+eDK8901HWYU9i0RGBYfI2xMKg9LXHLlQRw2V6TV+o2GYSxmFcNFUNBbhhI96pDe3S9TcKyDYNIms15lSwv9YH0nGzkkKPDF59aPMBoJ4kyPytNerqa8nr20JXIlFVzkSs0Pn3bdD6QDHOrmaP1niG2Y9tuM4SH4dn73JUVDxj5jJDV1lUaTeoeJDH9eJ9R4/PVZAW1jEsJEgyBs4BHpmMRncgCuIXX41cvf7h5xQ1fSYZEtnUdVL85n9ARMx7qSM7YU4gAmjXYA+5p9+NAc/pzNw== ARC-Message-Signature: i=2; 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=sk349i9HXVDccGqZeR1irFStqWCazzH0YyIdbaOgeI0=; b=KDbYXxCl3gfBkxkACbiER9ZEaItxQsSYTnbUpFbrh0MpjmIslLlhmIvorSvFLSB+u08ylfAnuu755tHlRnsrwZoOEE2zSEebVCL0bjMq/PtkWpYPvruXHc4LYCrfooBmpBts3rMFjuSYyLQMATf+nTQkSRf8piwhpBoSLOicRK1ZX5t5MN3YHRY3+nfKZMUAkyqaNkmDaAFmespFZSEquztZE7o2xdpBEriY2U09bHqR/by1RvMcUSuQC7NZAaQuQnhWvdDqSeUFAAnX0fsIdbPKPOlI9ga9UaPNoLFESpOzi/R3EA+8FwvPrfSybczwwIpQZpLsY1hVo+5T1kyM8Q== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS8PR04CA0193.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::18) by GV2PR08MB8049.eurprd08.prod.outlook.com (2603:10a6:150:ae::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Thu, 28 Apr 2022 09:37:44 +0000 Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f3:cafe::ca) by AS8PR04CA0193.outlook.office365.com (2603:10a6:20b:2f3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13 via Frontend Transport; Thu, 28 Apr 2022 09:37:44 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 09:37:44 +0000 Received: ("Tessian outbound ac9bb5dd84f6:v118"); Thu, 28 Apr 2022 09:37:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 24bb9454f73dfeea X-CR-MTA-TID: 64aa7808 Received: from e52920fe424c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2404DB90-5392-4833-BADE-E664AFEEB489.1; Thu, 28 Apr 2022 09:37:37 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e52920fe424c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 28 Apr 2022 09:37:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ITdUUGYV1V3pRKUPKDywo7xBUtuGEoTX9UJABnyc9RAXIC2Z7ESuBRFuBJIWxm4ZJnxG0m7o78DKEnRvyCT5uZ5MzNhlwee9hQjFuuetH1/QFrJVfRNkJDGhhXYR/r/eEoN0ssO7IQlM6g1jqPzbzPeHfB7w0mf6MaN94DINh1LwRPIe8FQ8/YF57QA6QRz6Lecixiw+9VLKVM77yJsjej+csLq8kFi0e8a9TOdjfNYG45SeMFLeJaSJydrJwMmzGrtosWqbVZyLqpN0XXLdePoFvTPDml9LGtNFDP0NI/zfdv45rH0gmBccQlbutT1fUVaE657jNQdJyqbut67tkA== 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=sk349i9HXVDccGqZeR1irFStqWCazzH0YyIdbaOgeI0=; b=kK40Z9PrNeHoqBwW8eDI4s0bwpyaylVCaPdVDltkYZZMGz5mdct9QLuWhT8tTqMixyipUsBegF2tt3kIRl5sK20zo8mbMlxOYXqfUj8WnMhFMiL7UzrHqiXFmIVLC7cW8cGBmY9D3WCuo3X1P2ShlZT9Yg1h7ZMCr4Ig+xPDpIO7f9G4IlucejsJsCF+rzy+UaZT51idBTEQjXDQML8tsv9Uek22wxp8C0OS1Jtct5ZRGz9JeB1ELvBdYxjPFmfmPa9WzrPVPHOFf4oZBKpvI6XKUaMcre69Yd5EeA9CcKcS4wVp+9WBC92Exn4zgiMdaNeiqA1C96dtvXFr1imOcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.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 Received: from AS8P251CA0002.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::15) by AM0PR08MB5490.eurprd08.prod.outlook.com (2603:10a6:208:184::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.13; Thu, 28 Apr 2022 09:37:35 +0000 Received: from AM5EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2f2:cafe::2a) by AS8P251CA0002.outlook.office365.com (2603:10a6:20b:2f2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.14 via Frontend Transport; Thu, 28 Apr 2022 09:37:35 +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; Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT032.mail.protection.outlook.com (10.152.16.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5206.12 via Frontend Transport; Thu, 28 Apr 2022 09:37:35 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.2308.27; Thu, 28 Apr 2022 09:37:35 +0000 Received: from e124257 (10.34.101.64) by mail.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.2308.27 via Frontend Transport; Thu, 28 Apr 2022 09:37:35 +0000 To: Andrea Corallo via Gcc-patches Subject: [PATCH 2/12] arm: Add Armv8.1-M Mainline target feature +pacbti References: Date: Thu, 28 Apr 2022 11:37:32 +0200 In-Reply-To: (Andrea Corallo via Gcc-patches's message of "Thu, 28 Apr 2022 10:39:31 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 8eceace7-9a79-41de-ac4b-08da28fabf89 X-MS-TrafficTypeDiagnostic: AM0PR08MB5490:EE_|VE1EUR03FT047:EE_|GV2PR08MB8049:EE_ X-Microsoft-Antispam-PRVS: 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: YdA9934nb7QhZ54A0b2UGGAz/fCgGBh/d0sfP8G1aWuCMWSUmj8huCIVAg+wdmXC1bzUJyX+wGV2conVAGg9eWkW3SJYslPWKXYRR8agRPhUdbXs0YmAytZ2tHiNSXIRfOVuheRN+FrYMqBmQSpDvqkJXc9vK2E6BNwUk/MU70KgOlm2hRezrXseZ3AUW1W0K+wqpCV6Nm5uorR4zZEsOzgkoVHErVPLfb/XgtSYjzsAE3IiP23/e5hJzPtlxLk5jQBuuaaZc/iX7VDKvynHiJLYDVc/r+Cd2nbFd7jCU1HLRJGkkMBhw7tU7QiSQ2ZIkLnrYwWq8TbBjbtU0RIj3zGIiZL0WaTqVZ1zmtiaejoy1+pNAb66KK72mi/2VnkqoNL6qG2bn0g3+9If7lRNG7NOPFqEXGozQiO5GknccKuECR7lHfVsVB75GBpqR/Zcmpp+kZvUJpve7GYx4/EGnwFNMxpUfhSg9rFGzmWP8Q24HLgJwsOZrE9xd5wE1vJqNP0rkDynssSuNzs7eoDYN+PSo1K/jRyAwf0A1rhGcd79Ey5HLknkFfy8UNGf+wnkwLVGOFfNaTAImMOYRYmmL7246x6K4xoztzBXCceSpfaaQDRNjKX49lNgOWw0aUy55lDFac37RbLwZaADZGHy6nVN6fjU04OBCyIilSrbvmy9/PyTqW9XMiw6A5I0gM8OimRg2Cd1OWQu25I6DJ+82Fxb8CPcpSTdFsPdyUXAK4tUWWUO939oZi58SoK6FecOduR+hFDKz1UD1iAQcKDrvbj4pMn+bP2Pzxx+hBCLHOk= 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:(13230001)(4636009)(36840700001)(40470700004)(46966006)(40460700003)(508600001)(82310400005)(2616005)(86362001)(47076005)(426003)(336012)(26005)(33964004)(356005)(81166007)(6666004)(36860700001)(186003)(316002)(70206006)(44832011)(2906002)(36756003)(235185007)(5660300002)(8936002)(70586007)(54906003)(83380400001)(6916009)(4326008)(8676002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5490 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0056f682-2398-4abf-7331-08da28faba0e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GurqmHEwR7ErAB1DHRVXifs/6qdY90sChmd0kGvwqR1wX1lkFL0CGlcJbdBmG7d0uXyw8GOE6SkSyC8iUnlQuoWbgcxtEShLAEd9YdH+AZ2Hab8l+JSB75aAV+hX5YK08ndaUwQI0R8QYQvvfgjAmdh4job7P+hYDI5SpjPyXa6IaxYjaLM6HSelUF670cHBhWTSon/HmdyjyK0T+U5Md7IfMfvbICeHHK7cTgSwcD4WNhNIGKRn2B272QPOjW7oXLlj8z6JjyumLbOEKEyyX0NfgTT/LFcoRxmRWYi2yUtQ36mZR0097kb7Hp0GwHziZk9K4Sun6mzTqFM1astqvsmWzvzaOpEhNGRqexKr6ba+cmKhimKr37bFSNAhfZzYFfaGBIbLGRIm8FtqxC4hCd3o1j/u++ztof8E6Wmb8GS2E1nUij41z7cs6W+czUBjTkNZgoQMbEK4xJQZ3KmGCoHSiLH9bWkhpYtna2VuJMvIGtEKvc/3eXGCn8PL8Hn2LYLpamIb86xjA2W6WMgBvtvGYHVJ4liwUQ8+dRvecdLKZkMnJ87MffbHrVVYlqK4qBYG/gCsjTicoaNDhcSHIWWKCyBazGgaZOW1cNWwGynbTqJsSef0aWr92f4kJh7RGyV1ral86/+So7SwggaCminAxvjSiwZFLakNIxjXQWlPe7tTtBZpprtNGcu5eTRQEU64S8Kog/Gdnt2xY16nGtt9nTruqt04OIHpq8z0mk0e1Jn6wyKzydTzYd0RT9vlR8rOae7Fj18Yn9qKnybr7g== 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(508600001)(5660300002)(54906003)(336012)(47076005)(36860700001)(70586007)(70206006)(4326008)(235185007)(8676002)(316002)(36756003)(8936002)(2906002)(44832011)(86362001)(426003)(82310400005)(33964004)(26005)(2616005)(6916009)(40460700003)(81166007)(83380400001)(186003)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2022 09:37:44.5346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8eceace7-9a79-41de-ac4b-08da28fabf89 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: VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8049 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrea Corallo via Gcc-patches From: Andrea Corallo Reply-To: Andrea Corallo Cc: Richard Earnshaw , nd Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This patch adds the -march feature +pacbti to Armv8.1-M Mainline. This feature enables pointer signing and authentication instructions on M-class architectures. Pre-approved here . gcc/Changelog: * config/arm/arm.h (TARGET_HAVE_PACBTI): New macro. * config/arm/arm-cpus.in (pacbti): New feature. * doc/invoke.texi (Arm Options): Document it. Co-Authored-By: Tejas Belagod diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 0d3082b569f..6c1dffe56e3 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -229,6 +229,10 @@ define feature cdecp5 define feature cdecp6 define feature cdecp7 +# M-profile control flow integrity extensions (PAC/AUT/BTI). +# Optional from Armv8.1-M Mainline. +define feature pacbti + # Feature groups. Conventionally all (or mostly) upper case. # ALL_FPU lists all the feature bits associated with the floating-point # unit; these will all be removed if the floating-point unit is disabled @@ -748,6 +752,7 @@ begin arch armv8.1-m.main option nofp remove ALL_FP option mve add MVE option mve.fp add MVE_FP + option pacbti add pacbti option cdecp0 add cdecp0 option cdecp1 add cdecp1 option cdecp2 add cdecp2 diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index f479540812a..3495ab857ea 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -335,6 +335,12 @@ emission of floating point pcs attributes. */ isa_bit_mve_float) \ && !TARGET_GENERAL_REGS_ONLY) +/* Non-zero if this target supports Armv8.1-M Mainline pointer-signing + extension. */ +#define TARGET_HAVE_PACBTI (arm_arch8_1m_main \ + && bitmap_bit_p (arm_active_target.isa, \ + isa_bit_pacbti)) + /* MVE have few common instructions as VFP, like VLDM alias VPOP, VLDR, VSTM alia VPUSH, VSTR and VMOV, VMSR and VMRS. In the same manner it updates few registers such as FPCAR, FPCCR, FPDSCR, FPSCR, MVFR0, MVFR1 and MVFR2. All diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3936aef69d0..079e34ed98c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21002,6 +21002,9 @@ Disable the floating-point extension. @item +cdecp0, +cdecp1, ... , +cdecp7 Enable the Custom Datapath Extension (CDE) on selected coprocessors according to the numbers given in the options in the range 0 to 7. + +@item +pacbti +Enable the Pointer Authentication and Branch Target Identification Extension. @end table @item armv8-m.main