From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50055.outbound.protection.outlook.com [40.107.5.55]) by sourceware.org (Postfix) with ESMTPS id 724E33858292 for ; Tue, 5 Jul 2022 13:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 724E33858292 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=O/j0o10FE/IB+t4M5M/442+90hqoOlA3fTGBHtic3ezA9THJMLV6aRN3qhUkePzq30ZXWXdLjlTlMLLLTsU1HoMIzpjcuBBmp/3dTUS5Sn3GQfTPgMLU9IdtWaU+cfzn3KH2xOzwIC9qqnmUtm7gunU+sauIf1QDE1v17YQR5dvyJXNQsbeor3Zz9YSW2Iiox4/yx0zrbv5RwrbCefI635cACfIz6Xa2UDj803Xe7BJRKJI7oWT4k5IoTmqYpkkhmQXGLvONRN28p2RsnDx+CMwQ9sZYdp4NNOJ9UoVefIANMlUSbPoEBG19xrxU3bfdeBSs21/J1rooBLmZLv1pew== 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=eaUp3zKkktWv0S0P6ncrdK4HgTAmC6HWgBKhnNwavr4=; b=MLgt32NE5ItUvccZcpXaBYCBS89mSx7G+o6Qn3bjMbbVzPbagYA76lTOmFpWlDzNSWDG41HViTkNhOmIb2jkoraXXAD9pnsu7Gkg5q8wfgiRuXfD1Oxn7PgQ2TXSP8t0kn0RDAh/yeEkeG05jPY9hEtN6NGQ0E1cEITcb6ddY77e6g1hbNx+Y2xp2gDUToYeIjv2gnufmecS7tgaHMv9/sacYfouxjZuMaKioNOi++dU+j2gVSBgUjyaFBFxunDAX9HA7op2KfuN0an9HGE/c+VXK+rSIc6Gi2h004ZK+uvVzjfNSBisplY1kN8KUGLWtOOT3sRDXzW4pp67DCahhw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.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]) 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=eaUp3zKkktWv0S0P6ncrdK4HgTAmC6HWgBKhnNwavr4=; b=dMioKvKD35zQBkV+mADVCW07cAjW88a0+ktusA8VJkGF9QMA1boDiybPt2XN4N9V/JKOXrd8i8JdisYv2tO89zTQsO4IXK4DzTDDxJubG3V77FPD7tJPTOaPXx/A+0BfzqIHxmrpa6HkXEvtS6kLX6pnRZj2DJ8OXJdlJe/GxkE= Received: from AM6PR01CA0068.eurprd01.prod.exchangelabs.com (2603:10a6:20b:e0::45) by AM0PR08MB5314.eurprd08.prod.outlook.com (2603:10a6:208:184::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Tue, 5 Jul 2022 13:58:39 +0000 Received: from VE1EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:e0:cafe::9) by AM6PR01CA0068.outlook.office365.com (2603:10a6:20b:e0::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Tue, 5 Jul 2022 13:58:39 +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 VE1EUR03FT049.mail.protection.outlook.com (10.152.19.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14 via Frontend Transport; Tue, 5 Jul 2022 13:58:39 +0000 Received: ("Tessian outbound 3c5325c30453:v121"); Tue, 05 Jul 2022 13:58:38 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 46a10caad543ab4d X-CR-MTA-TID: 64aa7808 Received: from 76720e0bfa9c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3D1CF712-8ADF-497F-8B5A-E6F4C41F75F7.1; Tue, 05 Jul 2022 13:58:31 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 76720e0bfa9c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Jul 2022 13:58:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ICKED/iusmoVB/iimCAEXygs5hoiPSbl1I9SesfuZlALmdjGpVaozbcyQVbxt2mfb8KTKKwjTkHsHCa8GU2tOViUlsH6KeXwE4uuSTorSD62y/Ym6Bo0reeUKl421Tylw4rHD2imqIzf2mQ+knte2U3ckdzdOv6YX8ELbtdL3lQMlg78C8MlT2j3f0hqGSA9e5APDavAYYlbWEH+ZNuM5mUg0N7WGrQMY5FuP/PhPNSo2v/ZWBo82Bwt4w4ZYyTY1FSAYw+p0fRY9GyPh+ufbld/ABjqZoVVlmgKz85ZN2dz3YHVqlDTztrbYOMPBvrOVlW0MzJtMrj7Da0e7ySj8Q== 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=eaUp3zKkktWv0S0P6ncrdK4HgTAmC6HWgBKhnNwavr4=; b=GgTJKF+V1uQXWBfOTlErVMyuJnCzvNmTpx9UDYig4amugWuOR6ik2zlVQEIwlHgOgtvx2zQxbnN2bQkhGu4WPBBfMDf36sBquzd5pki2/40COW0Y0n91Fqs5RiqbHuH/LVQ7zkdYXI+7E3fCllKukSA9c+ZAqonyHFH7aoug4RnaBLK/wNen6l9wrwOGSZ1xECbvBCeDgvnZ4KCRZr2wYjQZAmYGLf7GOg1aJy5y2WK5gdDzRPe2PS6/TBLxSxSdT32MHdSfGgdIt/rmJybbjsorS8BluqBezh4PTh4QFmiEGiDlUpBoRT1S4SYTP7/WH5z9SEpGJmQ62mX7hZCdcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.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=eaUp3zKkktWv0S0P6ncrdK4HgTAmC6HWgBKhnNwavr4=; b=dMioKvKD35zQBkV+mADVCW07cAjW88a0+ktusA8VJkGF9QMA1boDiybPt2XN4N9V/JKOXrd8i8JdisYv2tO89zTQsO4IXK4DzTDDxJubG3V77FPD7tJPTOaPXx/A+0BfzqIHxmrpa6HkXEvtS6kLX6pnRZj2DJ8OXJdlJe/GxkE= Received: from AM6P194CA0045.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::22) by AM5PR0801MB1953.eurprd08.prod.outlook.com (2603:10a6:203:49::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Tue, 5 Jul 2022 13:58:29 +0000 Received: from VE1EUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::57) by AM6P194CA0045.outlook.office365.com (2603:10a6:209:84::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Tue, 5 Jul 2022 13:58:29 +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 VE1EUR03FT032.mail.protection.outlook.com (10.152.18.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5395.14 via Frontend Transport; Tue, 5 Jul 2022 13:58:28 +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.9; Tue, 5 Jul 2022 13:58:23 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Tue, 5 Jul 2022 13:58:23 +0000 From: Victor Do Nascimento To: Subject: [PATCH 0/8] Implement assembly cortex-M PACBTI functionality Date: Tue, 5 Jul 2022 14:58:10 +0100 Message-ID: <20220705135818.50088-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 502b2e42-9566-4654-cb46-08da5e8e7668 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1953:EE_|VE1EUR03FT049:EE_|AM0PR08MB5314:EE_ 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: zRiZNgVyKr6drjTlkxBaKkk9QzJY6Il3p3WcIudJUhUd8kNDZnWjOSmgC5Ykze2ypvYAAymYt5kU/loJm4hIIyLNGIABhns09UrzxkMom/PJiAJ0fE7Jd+ejeXXaW5mnNmKODptuR7ZpDSpwxZELH4Za/Okd/kbfGJeBNBBsw0swIil+mmwVnF8mtAISWrXUrK/AhXe6HIHjrN29xTXKKUODCjbjpCQ/uq9oOC4SFKuFsDldU6qSvyxG0mubHv0kiqyC/UNoOuTkmFiN8T0CH6RezXNR2QHbmGXFQw3D8OGA3O+dIBwYjlNroEJ/cZ+stEiKJiTRhMwNWZcgGTsYqlNgVJ6lTmBTGdpBEgyNMNTneViBShxbHCI0xKZFB6QqhsYcZezPioQr0Vk4KlkZ0ma61k5wkV1ZQzIrssyUWaaA6Fgp7MJQx+d4d0BuJpBOUyog91GKiVzvYlgiYYIdrxxUs66vctBreYlGMHK8UHLlP06RDg3X5QnkbunGE1F9Vf9BQDDuH1SILFIuUFOsOhnMevuuwTUmY84eVFMHAdMRsI7NQHxcMYyLRSNtbb/U7KdbRKqdcIXLaD4ixdSMSajMT70Lo51MVHNxx2kpsiJh2b17tXDF2U3uYy7q6QmN2EoXYzkLIJSlYR9MKzz/pAbqxLU4nnDmr2oiGpgfh5ER15bEMbLpOX+W4tUOoV9M9Mf70Kk6PwoGbMjpAp1XkWaVsYP4E1pbtE8IyP3WWxnA+ZwAfdy2/54kH9g1scppGRAZKjqdXOo8sK13MDsYy3gUAOCeb1wwc4XaESTP48T+3wHEGSoIZ0HULf3acgdwnbkdmejFJMyjTImt8VPrFQYKEI1es3e+GzzayiE7eEyZjD0M6lH5DvIm3Ppb42rDTrf+J+DY5n0SlSQexMvo+1xsA4isk198HtKe2WrMR/Q= 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:(13230016)(4636009)(376002)(346002)(136003)(396003)(39860400002)(36840700001)(40470700004)(46966006)(2616005)(47076005)(186003)(81166007)(82740400003)(1076003)(83380400001)(426003)(8936002)(5660300002)(36860700001)(356005)(70586007)(336012)(40480700001)(19627235002)(82310400005)(36756003)(2906002)(26005)(7696005)(8676002)(41300700001)(4326008)(6666004)(86362001)(316002)(70206006)(478600001)(40460700003)(6916009)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1953 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a6f0fb28-2aea-4251-b902-08da5e8e7048 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xnNMJIBFUbuGydeSqoS1Fm0hIS8D1NhdeRSIPupe3X4CyL+E9/ap5K6yT4FQm4PsItvAOGPJi1+T6bEMKH5CdaLikUoMy97cZEzXUw696UL5uKG4wPSDiF0RqBQaZHLZAVD0T6P0KDKYd/nxVkjGZaKWAR+V0yEzzKKXcSITqIc2sERT71LyUKt3TM8cEry4Uk1M260XD6KWSTbLhDHwm2gw6gnpIR7h5A1Wzs94OlMOomCmFwjpatr76R7vKSJKsadliV6GIdGZi51NHC0/pne7f0V0S0u/nhOeOIhJLNzQud6cNAzs1aLX91LwvpkENKOLsn0AOvkpSApYX2GZn13vs4xCPdmV7BLvxJw/0Xp8Uhz3wT6dfNFu3nEpOzV8XZ8OpBRhImBHEeDFA8k45WF4DOv9O1jtsd8w0z8DHbIe4/smM6RwSakSm6oGL6DgbK5KFR+XZfR4a7Ba5oTy6v/JSx+A24hY3nfavt3pIfA/baQESBtH7BDnq0LrBB7/MOwl+ZJnRm7t/1dAG1IspigLNZH5ZDnbxW8g9vawEb8PrlaevAvOAqICeOl27OjdiEGx4NlgEG15+8eqsa9GjnPpqDG516GqDdDoQLHeMjtNqglcCmAvWJx+DSunQ/1XaMw4MNwtMnzYy1koHYQhu7UdqEhFcpzAIK4HyroaY194BCwhMrQWy3QknUoIJ3Irp9cCSQ7noS+nEVcnDAibUpRGnym7aSmSdgMlY+IXKHoYJc8yJBswmRLaJkaTG6bOQGzvrC95dY+bagyy19p3d41lBoOYXCLH1yNl949aej02jxlJNgTKFqW9OJ1ks08kCXUBRYw096+o6dNXctJ2DawEPJPst2sIjncBj77ty/KmmCEk5oyefq+C3rj3Uknx9Uc1gaGiBtKnGSPwqT0hlg== 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:(13230016)(4636009)(346002)(376002)(39860400002)(396003)(136003)(36840700001)(40470700004)(46966006)(6916009)(19627235002)(316002)(26005)(41300700001)(7696005)(6666004)(478600001)(40460700003)(82310400005)(40480700001)(2906002)(70586007)(70206006)(4326008)(8676002)(5660300002)(8936002)(36860700001)(86362001)(36756003)(82740400003)(81166007)(47076005)(426003)(186003)(1076003)(83380400001)(336012)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2022 13:58:39.0199 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 502b2e42-9566-4654-cb46-08da5e8e7668 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: VE1EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5314 X-Spam-Status: No, score=-6.4 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, T_SCC_BODY_TEXT_LINE, 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 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2022 13:58:44 -0000 This patch series modifies hand-written assembly files for Arm targets, conditionally enabling branch target identification as well as address return signature and verification based on Armv8.1-M Pointer Authentication [1] using ACLE feature test macros at compile-time [2]. Function prologues/epilogues reflect gcc compilation behaviour when gcc invoked with the following flags: "-march=armv8.1-m.main -mbranch-protection=pac-ret+leaf+bti -mthumb -mfloat-abi=soft -fasynchronous-unwind-tables -g -O2 -S" Regression tested on arm-none-eabi with and without MVE extension and for Newlib and Newlib-nano. [1] [2] Victor Do Nascimento (8): newlib: libc: define M-profile PACBTI-enablement macros newlib: libc: strcmp M-profile PACBTI-enablement newlib: libc: strlen M-profile PACBTI-enablement newlib: libc: memchr M-profile PACBTI-enablement newlib: libc: memcpy M-profile PACBTI-enablement newlib: libc: setjmp/longjmp M-profile PACBTI-enablement newlib: libc: aeabi_memmove M-profile PACBTI-enablement newlib: libc: aeabi_memset M-profile PACBTI-enablement .../libc/machine/arm/aeabi_memmove-thumb2.S | 42 ++++++++++- newlib/libc/machine/arm/aeabi_memset-thumb2.S | 45 +++++++++++- newlib/libc/machine/arm/memchr.S | 49 +++++++++++-- newlib/libc/machine/arm/memcpy-armv7m.S | 73 +++++++++++++++++-- newlib/libc/machine/arm/pacbti.h | 58 +++++++++++++++ newlib/libc/machine/arm/setjmp.S | 32 +++++++- newlib/libc/machine/arm/strcmp-arm-tiny.S | 7 +- newlib/libc/machine/arm/strcmp-armv7.S | 45 +++++++++--- newlib/libc/machine/arm/strcmp-armv7m.S | 36 +++++++-- newlib/libc/machine/arm/strlen-armv7.S | 52 ++++++++++++- newlib/libc/machine/arm/strlen-stub.c | 9 +++ newlib/libc/machine/arm/strlen-thumb2-Os.S | 13 +++- 12 files changed, 417 insertions(+), 44 deletions(-) create mode 100644 newlib/libc/machine/arm/pacbti.h -- 2.36.1