From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060.outbound.protection.outlook.com [40.107.20.60]) by sourceware.org (Postfix) with ESMTPS id C3BA0383B6CD for ; Tue, 6 Dec 2022 15:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3BA0383B6CD Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com 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=G84Ut0TnvUMFXMKNIOoBxU+bYnYejaI/pgN6U0siRtw=; b=3+rkJ7pFEnWvPQlqfsBawL/st041c70070v9JuHEJKSmPHRb0NCNqJxpQTK2gOqczyai6O6zBojqauDS8vmrCBpSBxJnOvHqjijb7U3GF4ibtnH9uI5zqF47NIA1eavATfJ9NdNinUS79iQ3JynkqsOUBQcaK1Xw6ydRQeorAY4= Received: from DB7PR05CA0018.eurprd05.prod.outlook.com (2603:10a6:10:36::31) by GV2PR08MB8051.eurprd08.prod.outlook.com (2603:10a6:150:79::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.11; Tue, 6 Dec 2022 15:47:08 +0000 Received: from DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:36:cafe::a5) by DB7PR05CA0018.outlook.office365.com (2603:10a6:10:36::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8 via Frontend Transport; Tue, 6 Dec 2022 15:47:08 +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 DBAEUR03FT046.mail.protection.outlook.com (100.127.142.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.14 via Frontend Transport; Tue, 6 Dec 2022 15:47:08 +0000 Received: ("Tessian outbound 0800d254cb3b:v130"); Tue, 06 Dec 2022 15:47:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 86abb55b9ea691fb X-CR-MTA-TID: 64aa7808 Received: from e1c28b6e0cf3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6141C09A-F959-452B-A159-EF6A4AEB4C09.1; Tue, 06 Dec 2022 15:47:01 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e1c28b6e0cf3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 06 Dec 2022 15:47:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eGPpDSHIYw3GC00g8w/H9xEWSAMtYUFIl/of8nfwLcdQQ1Gof78ea2HtHENYBpm1O3v87Y0/BBX/s1NF/8YxDPZRxpRrpi2/3KlvQZNLlQ4eKL6ut1aCevgu7w4zxlgPqCkihb71P4QfOxEi0NQiR1NBwkcbR0uZ8n+dVTY6F1yOQWlKGDDLaIRYcUOGC7LEtaVwbP+va+xEEucTdER4kJHK6bp0PGmeVyLa1Nux200YUDewwjQEUKwmuxRzB+MjJZy0wc26nE3NUgWM4Oasy5PhuAmQZJTnhMCOgH5ewwLlJ4tGBB4px8ewuFJfT1ZxMPlOWJ4qixgdk6fgSpACLQ== 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=G84Ut0TnvUMFXMKNIOoBxU+bYnYejaI/pgN6U0siRtw=; b=KXcrhlrLm5IvHUJy/HqYAK1FgWka5I4krtQ8bwwePAjVFXCxNTlZzfMXDl6uirw0xt6GiXCVUYuu6d2FrdTSHyoEWGnt7tPS6fEVwAPTCkcdoFGJ8bEj2nZfqMaGCECrIqw3exiXy8ufrK/FEl3DsoT7iJQ7zMOszMgq63UbfoT91atmmiWeV+yFcX4rCYghQFqlTxWHti7rgFop2vPqdHWEhdteOuVSh+pLlUgYB/BoUuLMVUzXkNefn2+AWTUI2l6QjI3LvrL02ews32CD0mfxyMdpsRk18S34HXNm/RN4GgZCSN8hivNlw4r11Rwaia1heGIA0EK1lzCjPLk9+g== 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 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=G84Ut0TnvUMFXMKNIOoBxU+bYnYejaI/pgN6U0siRtw=; b=3+rkJ7pFEnWvPQlqfsBawL/st041c70070v9JuHEJKSmPHRb0NCNqJxpQTK2gOqczyai6O6zBojqauDS8vmrCBpSBxJnOvHqjijb7U3GF4ibtnH9uI5zqF47NIA1eavATfJ9NdNinUS79iQ3JynkqsOUBQcaK1Xw6ydRQeorAY4= Received: from FR3P281CA0037.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::21) by GV2PR08MB9374.eurprd08.prod.outlook.com (2603:10a6:150:d0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.13; Tue, 6 Dec 2022 15:46:59 +0000 Received: from VI1EUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:4a:cafe::40) by FR3P281CA0037.outlook.office365.com (2603:10a6:d10:4a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5901.8 via Frontend Transport; Tue, 6 Dec 2022 15:46:58 +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 VI1EUR03FT004.mail.protection.outlook.com (100.127.144.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5880.14 via Frontend Transport; Tue, 6 Dec 2022 15:46:58 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.16; Tue, 6 Dec 2022 15:46:52 +0000 Received: from e124257 (10.34.105.24) 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.2507.16 via Frontend Transport; Tue, 6 Dec 2022 15:46:51 +0000 From: Andrea Corallo To: Richard Earnshaw CC: Andrea Corallo via Gcc-patches , "Richard Earnshaw" , nd Subject: Re: [PATCH 10/15 V4] arm: Implement cortex-M return signing address codegen Date: Tue, 6 Dec 2022 16:46:51 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: VI1EUR03FT004:EE_|GV2PR08MB9374:EE_|DBAEUR03FT046:EE_|GV2PR08MB8051:EE_ X-MS-Office365-Filtering-Correlation-Id: a1946b8e-9631-48ff-df0f-08dad7a121c5 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: 2lB77HkPbLh1XslELOzgEx9lfkpDxrYVTB6QblxVm6iH3GS1PapP61rVPt+CBKP0zMFJpRT4A0mAkZK3h/hVlm2/tMK2VBEctYYZ7aZcTF2Xomw0S+b2TBszGGZQ2IdJ6nzmVmm6oHc0GZzZeMD4rseDG6/oEIhYr+OmveLXMV7zgezjbafpwTh5ihfXEPT5Py+9Q7L9jRo8ynCgpY1h6G1s5farYcPjv2ICRQYlZEizqy2QJepGSlNYF7foWQGCo3UL/RwT/b8bg6/YKiAQYdceHRHaUrMTKbiud4uF7Xcz1HGFkhar3+cimDJxP9+7jdwaI1K+ShIcS+wUxxslr3iIu4czjqp7KR7zZ2P/962CVbsj0i8wLgB5fY3biAV/0APhESP0zNjMuHQyN+Cl6bR0Y0upHGkdsweYG8/zXA/XHRw23l4HpGVey3WYX1/gFD2nEOUcnFThfJJmZei14wHgeWnN+Y+j/CH4muymiBZC8msOi1IfQiIVpIhnePGZCfi3CBXy1HQUwVUCRNVF3C5ihgXuq49j2LgrM9MPUJVxYt5JUwdEk68B1Yn7IMIckVblLFFuocxQ9TPShTgqU2o7UWhlTd9dKJ5MVX2QWl38RVD13qRw9NJXqyUiuLyMgl7fVH0Rf/cP6l38QpN2qq1Cb0MN+LLxj8W2wvx5btkNeWGwV++Gq319bEq/fJNeCdcTQ18eFlFmOd7+8ux5mg== 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:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(46966006)(36840700001)(36860700001)(82310400005)(86362001)(356005)(82740400003)(81166007)(8676002)(54906003)(4326008)(70206006)(70586007)(6862004)(316002)(44832011)(8936002)(5660300002)(426003)(336012)(83380400001)(2906002)(2616005)(186003)(47076005)(41300700001)(40480700001)(26005)(478600001)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9374 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a31dd67e-2eea-4dbd-e114-08dad7a11bea X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M2tHeOqAFTKP9ytQh/FUwfs5ZBiRkU0VSV4sH340NVIDgkxW2MzReNoTI5V54CCXuWDhvT8Qt+wxrL1U5S7GiMA/pkDSHtr7UcU5iCTFJPxLTprvrnBxsj2ibVBkuByZagIhydXePiZYA7lsKrTkqKuhxWJpgdmDoh/N+hkzkMf9UsYpkflPW+3KZ1J9xco41wP4JGPjolmkeJ2K4f5DVLMrX6KMpo/AuAfJTzyWHHePr222LJ+Pph9JQCgAQrklEoWBPN1LKqA/96ZibBYcsi9iUITuP1BoMPhqzMD4hXtziCQKmPPZvHQO4UFYlUWj0JEnjhIUxOipHBFWsvpM8R4n19FIqPt2mNFKbt8yO5Uu2v9kcEUZ7pW2rU2awtxHKEHpYle9sX5KX7XjS6rlQNgHRWsEZ6Qki/zcSIlaF0YAhyzhQJKSNF9gADdKba533iJx2qrxFwKZtFNmfslZine/DGd/6s+cNwNyRH2lNLnf9/67LvIMPgAbTIg7Ik9W8WgqNs958MWL3zaPZ9fV4dytJL2JUbP28hO6MSR5sl8e1JUQ08Z8lpKe+qbcgq7bm4ypHxj2SSY5vTtKUfsDE+ZD5Kwear9yMwk8qIFrU/71r6/Wb9vTErmyqiVhFkHJF/Su7VsoGeFKxqs9GSzXCw+m1s7XgOC8wWqy7qwCuzePbKQabeVQZ72da+J74pWAvuWc32sx5AQ0KH1kigkiNg== 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:(13230022)(4636009)(376002)(39860400002)(396003)(136003)(346002)(451199015)(40470700004)(46966006)(36840700001)(40480700001)(82310400005)(36756003)(316002)(83380400001)(54906003)(336012)(26005)(186003)(47076005)(2906002)(86362001)(426003)(70206006)(70586007)(36860700001)(4326008)(81166007)(8676002)(478600001)(40460700003)(2616005)(41300700001)(44832011)(5660300002)(8936002)(82740400003)(6862004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2022 15:47:08.2668 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a1946b8e-9631-48ff-df0f-08dad7a121c5 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: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8051 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Richard, thanks for reviewing. Just one clarification before I complete the respin of this patch. Richard Earnshaw writes: [...] > Also, I think (out of an abundance of caution) we really need a > scheduling barrier placed before calls to gen_aut_nop() pattern is > emitted, to ensure that the scheduler never tries to move this > instruction away from the position we place it. Use gen_blockage() > for that (see TARGET_SCHED_PROLOG). Alternatively, we could make the > UNSPEC_PAC_NOP an unspec_volatile, which has the same effect (IIRC) > without needing an additional insn - if you use this approach, then > please make sure this is explained in a comment. > > +(define_insn "pacbti_nop" > + [(set (reg:SI IP_REGNUM) > + (unspec:SI [(reg:SI SP_REGNUM) (reg:SI LR_REGNUM)] > + UNSPEC_PACBTI_NOP))] > + "arm_arch8m_main" > + "pacbti\t%|ip, %|lr, %|sp" > + [(set_attr "conds" "unconditional")]) > > The additional side-effect of this being a BTI landing pad means that > we mustn't move any other instruction before it. So I think this > needs to be an unspec_volatile as well. IIUC from this we want to make all the three (UNSPEC_PAC_NOP, UNSPEC_PACBTI_NOP, UNSPEC_AUT_NOP) unspec volatile, correct? IIUC correctly the scheduler should not reorder them as we have expressed which register they consume and produce but is for double caution correct? > On the tests, they are OK as they stand, but we lack anything that > will be tested when suitable hardware is unavailable (all tests are > "dg-do run"). Can we please have some compile-only tests as well? Ack. BR Andrea