From patchwork Thu Oct 28 11:41:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 46740 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 4EEB63858410 for ; Thu, 28 Oct 2021 11:43:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EEB63858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635421420; bh=XVHoefkTB+i+/S/o1Px7nKteOc7WWUAlGFVkYrjAwKI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=GTwTwjwXcBwmeOaB8qOlfuIksOO2yB+q4edLzOOC88bCMT64wcDwgsHMr4x8zSkbP dTbQXNYlsgSlcb8pGQGPrUUOB20niOw4oIsD132t3WeccDhFnjsvRUoUxViK/SORLH H9XP20oO54RvW0TKZlendYg+mvH/KhFfbad899j0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150050.outbound.protection.outlook.com [40.107.15.50]) by sourceware.org (Postfix) with ESMTPS id 9A2193857C6F for ; Thu, 28 Oct 2021 11:42:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A2193857C6F Received: from DB6PR1001CA0005.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:b7::15) by DB8PR08MB5001.eurprd08.prod.outlook.com (2603:10a6:10:e3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Thu, 28 Oct 2021 11:42:07 +0000 Received: from DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:b7:cafe::bf) by DB6PR1001CA0005.outlook.office365.com (2603:10a6:4:b7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Thu, 28 Oct 2021 11:42:07 +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 DB5EUR03FT056.mail.protection.outlook.com (10.152.21.124) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Thu, 28 Oct 2021 11:42:07 +0000 Received: ("Tessian outbound c71e1a752bff:v108"); Thu, 28 Oct 2021 11:42:07 +0000 X-CR-MTA-TID: 64aa7808 Received: from fc69481cf55a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D3EA3F75-83BA-44BA-AC3B-38B61D4644B1.1; Thu, 28 Oct 2021 11:41:56 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id fc69481cf55a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 28 Oct 2021 11:41:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UeMH0f7c+SgiOUYF62/N4P79avDqXrqtxTsDrBjDjHXAJUAJfAnI3p/ui9LRtxedLx7BWT/oGPsh2vd94BK4XZ0n13QXVTObI41o2REGHmemHPy+8VyOsPK/1x30lRQHRfTEYMOJeisMSSTtpNZ+ojoKZJiT6SF5DEUF282bhV8yl5KPcL/wZxUwffuDVpNsKCvsx1Zft6H2HIfoI4TbawEt/IrEM6S/2vXdkW/7cy6plHlKFdszMoHjAs039NW+F59psr8ZaiqGbNSNw6iaTA4fR+1k1hmmjzBvm/KkpxkuZ5HuqcZlIgpD7o4ybsU7jVajBnuU1Gq/a1buwJzMUg== 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=XVHoefkTB+i+/S/o1Px7nKteOc7WWUAlGFVkYrjAwKI=; b=S8nOsVlJYZ4nn/jCWjrCxkFwAj+U7srXG5GuQHJrheNbv8lIMWKN69P7zD8geOiGO0zN9NiN0W5VW2CKn+sZvJy5a0DfzSzzUkd7pXUq1/hHn5wiXP0IEoP82qudF83TxBoa/K6F8t1SKkSU3kaTPEmbrbwYSI72woXgMUVdj5oSDGyvx9ckhidJvGrvx4Vh+8h4tE4Hq6srBMcfkoYkl2PysR09oVaDcV9x9u0AgrGBPDgB+4SIH2zyJH7fds9eFBLrMTaj//7V0rTDOhUi1XAKwx5sXhwKWV/GzwPXv8elQILvXPK68vUUSXEtSl+iBW/uLftX91Ut9dn3K6F0EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Received: from PAXPR08MB7075.eurprd08.prod.outlook.com (2603:10a6:102:201::15) by PAXPR08MB7123.eurprd08.prod.outlook.com (2603:10a6:102:206::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Thu, 28 Oct 2021 11:41:53 +0000 Received: from PAXPR08MB7075.eurprd08.prod.outlook.com ([fe80::9c7f:ad76:ac66:26f2]) by PAXPR08MB7075.eurprd08.prod.outlook.com ([fe80::9c7f:ad76:ac66:26f2%9]) with mapi id 15.20.4628.020; Thu, 28 Oct 2021 11:41:53 +0000 To: Richard Earnshaw , "gcc-patches@gcc.gnu.org" Subject: [Patch 2/8, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti. [Was RE: [Patch 1/7, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti.] Thread-Topic: [Patch 2/8, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti. [Was RE: [Patch 1/7, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti.] Thread-Index: AdfL676lIMUySIDYSt+hS2nb4v5SGQ== Date: Thu, 28 Oct 2021 11:41:53 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ts-tracking-id: DA024D552C264C4DA206DCF720774614.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 3a51fed7-9b98-4f24-205c-08d99a07f88b x-ms-traffictypediagnostic: PAXPR08MB7123:|DB8PR08MB5001: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: dIKWb+XkiBFGIn6r9Ot81DJfS10EwCvvkGD4vMsoes5fjEdHlMrROaBHZcnB8AMTyalFMzy2NtK4BcYpW4FF1T7RWZK9qA+/yhCiugSgI6MxmKl2Xsqy/MtsdRkfEsS6vnolSksZMuE6tehckeN4FgMCK1SRDYdk5bxehq8Rg8e/y7Ti976MfnONvtrLDSHXsnALt9KQuk3XStIs0h/yVtYnImud/j6HxBr9hNZKhwiYGL652cDfdRSsW7Z0aDOd4cf4vD3j4KVAi/IyqZlLB61B7WQDPEG4SBlMHrkjEI7sSCiOWeXzWXLDIO46X0qUm3CLTyb+ftaTIJaSqgqSZ0zuPLLmsiXHrKcqN2hbtQ2igk8nd62LrfJJrBGmBFlp1MDtxOuste2ClDkZfRyGsy8MePWufjcu2DabWxYWbceBJHGFXv3u8Ng95N8pZ2jGWQ3bz2/rpoJVNNGG6V/pTeK4ONJ+l0flhiBwhEKpwVHykEEeCSKlxX1egPaQ1CtHy27JlsDMrJyYa8dRHUXwTxfaqNZCfT82FN2h5hD9dzmIEACF3oqQ16yqJuVt6J1y83k2g9qR/KRZN9sO9T/UL0aPXI9W/2lisHRitOKYLuU1ie/EDkMpVliF8OXUpa6MbWoD74EBht/tJ6xrQ5MLHVu1Ha4ky89rgl31wRH1AvL2nbQPef5qCQ0pP+r5RcnZwEAqeT1n1r2nZ70FhF4WGg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB7075.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(2906002)(71200400001)(33656002)(7696005)(83380400001)(38070700005)(99936003)(4001150100001)(66946007)(6506007)(9686003)(76116006)(38100700002)(53546011)(26005)(55016002)(52536014)(508600001)(186003)(110136005)(122000001)(316002)(66446008)(66556008)(8936002)(64756008)(66476007)(5660300002)(8676002)(86362001); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB7123 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: fe46daed-2150-4b6a-e5ab-08d99a07f018 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2KSNYpjgaO/lZyueAGZgoirV3ASuPnIZ6wvHnY8qBQeZyjZS/xWKWaR2tPO79Ox8YrKApRvaGL9aFJs/bFPxdhPXvznyLzigPQdJ8yt9fP2iLvR8UFxMQ8wfRVdnCGX1fMYfHoGVtk/oKjj9SSKtkS0IDOZOiL73kmYq6eh/a9DZYLmmmc5EytHsbdo3QI0qXIY6qRyfr5bxc2SrrHfE8856WUjcQJhkGykdlaaRTRs2080PL3IEJet4LQjfPQCCUiTlrDCBTI5ASSavNyqSrka5+IVrKtRHGZgCDphVNVKuNobS2j9mbDIUdx5ibk4qKmqiBUUOHL6oQBAwlKpvh5Ee+IMQdtLlx1P/tvS2OCTQJv7RD5mp/Ff0GtNx3cbkzrnWTTKMvgDsoed5yl7YklS1cZApWQpoyrNRTwedcXdffT/rHZp/NntpdVlZC6BKeNv8MHqZO6IakYQR5eDUqrrS51jDoQ41EDyY/+z19k6tdtMmPPCxnTB+2HyecuMEC4RLuTrJn/B+OW8ii/PiHksVrTADQ7RNauCgFg7UBahqNLsWJLhwGCPaEHi1T231CG0ccGAyFEmcrEOUEmBp8pMtpxdv9GVBjaY5ipbz+mXS6fpuSTiivTYpMCC0iRTPyeAVNMJ3DppTyCPApjocy2q5i+GI7fo1XX9bTk4ZF5p5vHXIJetW+IWeh1yVoDg22mSTqxZJCj6iX2hBr+nMug== 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:(4636009)(36840700001)(46966006)(508600001)(21480400003)(36860700001)(82310400003)(8936002)(33964004)(4001150100001)(7696005)(53546011)(235185007)(336012)(316002)(83380400001)(70206006)(70586007)(5660300002)(99936003)(110136005)(33656002)(86362001)(26005)(8676002)(2906002)(356005)(47076005)(9686003)(52536014)(55016002)(6506007)(186003)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2021 11:42:07.4871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a51fed7-9b98-4f24-205c-08d99a07f88b 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: DB5EUR03FT056.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5001 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, 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: Tejas Belagod via Gcc-patches From: Tejas Belagod Reply-To: Tejas Belagod Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" > -----Original Message----- > From: Richard Earnshaw > Sent: Monday, October 11, 2021 1:29 PM > To: Tejas Belagod ; gcc-patches@gcc.gnu.org > Subject: Re: [Patch 1/7, Arm, GCC] Add Armv8.1-M Mainline target feature > +pacbti. > > On 08/10/2021 13:17, Tejas Belagod via Gcc-patches wrote: > > Hi, > > > > This patch adds the -march feature +pacbti to Armv8.1-M Mainline. > > This feature enables pointer signing and authentication instructions > > on M-class architectures. > > > > Tested on arm-none-eabi. OK for trunk? > > > > 2021-10-04 Tejas Belagod > > > > gcc/Changelog: > > > > * config/arm/arm-cpus.in: Define new feature pacbti. > > * config/arm/arm.h (TARGET_HAVE_PACBTI): New. > > > > "+pacbti" needs to be documented in invoke.texi at the appropriate place. > Thanks for the reviews. This patch adds the -march feature +pacbti to Armv8.1-M Mainline. This feature enables pointer signing and authentication instructions on M-class architectures. 2021-10-25 Tejas Belagod gcc/Changelog: * config/arm/arm-cpus.in: Define new feature pacbti. * config/arm/arm.h (TARGET_HAVE_PACBTI): New. * doc/invoke.texi: Document new feature pacbti. Tested the following configurations, OK for trunk? -mthumb/-march=armv8.1-m.main+pacbti/-mfloat-abi=soft -marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp mcmodel=small and tiny aarch64-none-linux-gnu native test and bootstrap > R. diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index d0d0d0f1c7e4176fc4aa30d82394fe938b083a59..8a0e9c79682766ee2bec3fd7ba6ed67dff69dbad 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -223,6 +223,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 @@ -741,6 +745,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 015299c15346f1bea59d70fdcb1d19545473b23b..8e6ef41f6b065217d1af3f4f1cb85b2d8fbd0dc0 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 71992b8c59749f5508a3c6a1b1792910652eac57..27df8cf5bee79c2abac8b81c1ac54f1c3e50c628 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -20469,6 +20469,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