From patchwork Fri Oct 8 12:17:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 46001 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 2CED73857C5F for ; Fri, 8 Oct 2021 12:18:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2CED73857C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1633695508; bh=QtR4QXKUN4PSPtr3JQ1UPxhSDfuX8e5E12ENnbC2Sr0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=N6eNTyxdiauQ/4+C9PaEXcV/F6ikOsigCO/65hazpaKe8VxSDQwKmKhJXMzNRKxoW aSQxT2raLUUh/9dDXuhbUwL5fXfHO3kIDaSe9JhpV94PX9SHVW6CyHSSKWUDA9j7o/ qX7tS7d8NQC5jDQne3Al4SECIKWC0G1yZ9rECc+0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2051.outbound.protection.outlook.com [40.107.22.51]) by sourceware.org (Postfix) with ESMTPS id 74A173857C76 for ; Fri, 8 Oct 2021 12:17:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74A173857C76 Received: from AM5PR0601CA0055.eurprd06.prod.outlook.com (2603:10a6:206::20) by AM6PR08MB3384.eurprd08.prod.outlook.com (2603:10a6:20b:4a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Fri, 8 Oct 2021 12:17:37 +0000 Received: from AM5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:0:cafe::ca) by AM5PR0601CA0055.outlook.office365.com (2603:10a6:206::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 12:17:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; 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 AM5EUR03FT058.mail.protection.outlook.com (10.152.17.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Fri, 8 Oct 2021 12:17:36 +0000 Received: ("Tessian outbound 16951d3c485e:v103"); Fri, 08 Oct 2021 12:17:36 +0000 X-CR-MTA-TID: 64aa7808 Received: from f0af66ef1e46.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6871E242-6BE1-4ACE-A28B-98F5860E5CD5.1; Fri, 08 Oct 2021 12:17:30 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f0af66ef1e46.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Oct 2021 12:17:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoVJOLt165+5oj0QoTSixhPIDNhz6C6UnZdmlabdrFFZb5jf1E3WOROqHFLk9TJlhG5DJ/zuiuSB37qDq/cOU6zJY5QlWhRlwHcVeCZjyXwIidaaoA06hp5fdMqga8jAAjfkSOgISlBh5OJputBMBEoVvKhLpQ+9qiie4Jnn7BkQ1HCy9L/HWQPMNE5ucP8ODzoB7EeJWg9oCAIEldKdXZbuMZvGou2l+j2T3eGSoCXBnndFHbCpIjGW7fma9P1T8upPrbOQaEizUQ013zz2K3J9Pfc3fKUn6bZMnZGLlncjiX8NF7keMrE5GiCCdYYJ7MWk4rryXVjfY+Ve82oL6g== 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=QtR4QXKUN4PSPtr3JQ1UPxhSDfuX8e5E12ENnbC2Sr0=; b=QYi4lPPBvuJ5MdZNpzBPkWluq/c1bICpz/nUetdaAPrQdsWfPb6Hy7spNZIlmYukrVm9UMwMAwiLQ41Q7zX5iUjUJD8i3B8smvEWx+kZst74BR46ZgtZAn2hOat28VtcOBRkTXDv4Oc6XL+DQWx4i31htMAxc8J+d5NFu1yxop+f48B8i7bp3CHD6rk0fXS2OV7Iy3eDxtvEdTW4QhQrDu7lTND/CcjmfwYlNPpbFC4FrfPtezUyhC3v1rK0oIXqeBfrXbI7hEYgCY3pCTIFYHVSYKIjVPxmUbL0g21L90EbqBM4A0di91P0ZNnHEOIr5HfiVpLR7AN3AAO3t0kfAA== 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 AM5PR0801MB1844.eurprd08.prod.outlook.com (2603:10a6:203:39::22) by AM5PR0801MB1906.eurprd08.prod.outlook.com (2603:10a6:203:48::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19; Fri, 8 Oct 2021 12:17:28 +0000 Received: from AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::4cab:e095:5105:b6ec]) by AM5PR0801MB1844.eurprd08.prod.outlook.com ([fe80::4cab:e095:5105:b6ec%9]) with mapi id 15.20.4566.022; Fri, 8 Oct 2021 12:17:27 +0000 To: "gcc-patches@gcc.gnu.org" Subject: [Patch 1/7, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti. Thread-Topic: [Patch 1/7, Arm, GCC] Add Armv8.1-M Mainline target feature +pacbti. Thread-Index: Ade8OyCVlqmWWdKARPe4O850r7omiw== Date: Fri, 8 Oct 2021 12:17:27 +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: 9A505FDBF08B4D4BAB5AC10FD491C044.0 x-checkrecipientchecked: true Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 9351593b-9ed1-4bd8-c813-08d98a559d65 x-ms-traffictypediagnostic: AM5PR0801MB1906:|AM6PR08MB3384: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: d+dovtPtNbE58fSO5H2scIDA6UVd1bKR5x8snmutvWq1SoG7ICstQ+Ru824kFMJ3KcQdnZrlc1+jlyD8k3JWkkMd4R+HkQk+5E5TB7ak1b3q0yFAoCctX+F364wAbW0QuhYbhZimy/Gnalw3ZoFLjYmApbm/q5rsf2OVMptEwb8Fzdq0ytTrtOnqn+NetkFm+eF012DD0/kKqNiVtG0Bhf9kw0p5F+lnr6X1RSrJzrZU67UzgOv/NExa1ODjkrx5hlSV0gKxpGFn33uN1+NKN+zrTPd3a0TNahQDbtP4svtts3lnIXHEiOm2TANWmW7HOXWHWNFk6Ax0kdeqNIFKaHcwFHK0VYjTStTKdhYhVWtsaYadaRYKaP1MDu1VxDStmG16lKd+P21mQ426PNUA/4pfQCI+tc7BW08yzhJevRRCu3Nub1sdzdxsC0dQStO5B9crL2PFHFW4VTDJpJVcgBf2mlIbTAdWU4lQbZgVXlthUZ2DqOvQ0Qx0eTJZ4P8eAU9G50LOEhJ1NfPWJppAxyWmJbkIs9rrPuJWjZXehelvVTHRMKl7PWiTvbg60eirRGGfHovsH/yBAHn3fI2oZRvHxZZA6VWWeXNmsv4p5RnDVLYxwBg6Q63ztVBrvRmqaAgxr9H1SrALzSjCcDRuQJeMueAmuHCvj3BX0Uyw93yPxLD3dvp21QnGHHp63QOq/BWFatxXROBHP907wGmcsw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR0801MB1844.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(6916009)(52536014)(33656002)(71200400001)(8676002)(122000001)(4744005)(26005)(38100700002)(5660300002)(9686003)(38070700005)(86362001)(55016002)(316002)(508600001)(66446008)(64756008)(66476007)(7696005)(8936002)(2906002)(186003)(66556008)(6506007)(99936003)(76116006)(66946007)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1906 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c2f7875f-b1b8-4757-aab7-08d98a559830 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EoRbWXvm9UArr7KvDvwl1b3y0359iDzH0nvXTrGCTU9PagxS0SdPPBx6gu3UtjzybYhCIhzexyMO5oIThpa+JLo48edgSt94LpKvHu1Jvo0UFRd3QLBDus6eEGiaG8AxhtH2R1+V9SbEID/kv87uauo9rRuZPM83NlYn7bIJHQsgdsBfkJAF5J/Wl5qnveKywm9et78OFX1JEAZkhwznWCSEPu2/nNaHDGbQq4dA9TdU8O7j99p7gYdD+2ZU7TPmQj8UucuNzxNzQqZOFHTCWhPLtGXh2hBC/zl5WbAM25AEFlCNyQH38yd2vM4J51mnmBJOpcp+t31tC1ErpIHSTKF2nmtkEl8j0U4VweiPOlVAc0Jxxv80Ifb99gEv6pwWQBKX1x3G2PVXsyQd3VLqbAGIieUN3Q9M+9pjpIGxTLwBpZLPVlT25mzuNw8mKgQz5NGroCtAbR30H9d93TILJmcxa/Fs7dDeVDf7qHnLiErzWGJNw87M0oJ3nhm5LVWfnRSkDiKmo9MKMAkpVcr/5dqqv94ugsCb0yrWLbWflH5WKt4cd8PLgaKbZOUdFrNK+2zBbkHaHvriazXci88p5+BAf+RbVNf0nWMH7dQ5GW66w6W7kSL1OxHiunmUVmRmpwIKAujuDH1EECUMnXNeurSVgZYm8pj495fENNpUuXmMogSu6e3W/bL1gRLgJMieTAB0ExXGLP8QvddnbsrhnA== 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)(336012)(99936003)(356005)(52536014)(186003)(83380400001)(70206006)(26005)(21480400003)(86362001)(70586007)(81166007)(6916009)(47076005)(8936002)(82310400003)(55016002)(5660300002)(316002)(33656002)(7696005)(2906002)(36860700001)(8676002)(235185007)(6506007)(9686003)(508600001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2021 12:17:36.6562 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9351593b-9ed1-4bd8-c813-08d98a559d65 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: AM5EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3384 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, 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" 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. 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