From patchwork Mon Jan 25 12:46:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 41812 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 4855C398D051; Mon, 25 Jan 2021 12:47:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4855C398D051 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611578845; bh=wAW6gshtsbBBp1L8fdKNDC6mqVW1lAPYWEHbfHHm8m4=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=w5lWoVD8kIPP1xdn+r66MnqwusqpPk7zVnQMld8k/VCnnrMWmJLH45gGRsFwuRGH4 wcuQULUFbqsk1ZlnQskMIrfinxsb7zHVQocYJcaTKpYn4TgMQjPJoHO9JAdXcUx30o OcWJEYjMX0bCCt/9Nnufevo77QLUMKCa65pLuens= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0627.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::627]) by sourceware.org (Postfix) with ESMTPS id A9A893857800 for ; Mon, 25 Jan 2021 12:47:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9A893857800 Received: from DB6PR0601CA0030.eurprd06.prod.outlook.com (2603:10a6:4:17::16) by AM0PR08MB5122.eurprd08.prod.outlook.com (2603:10a6:208:160::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.13; Mon, 25 Jan 2021 12:47:05 +0000 Received: from DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:17:cafe::e8) by DB6PR0601CA0030.outlook.office365.com (2603:10a6:4:17::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 12:47:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.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 DB5EUR03FT043.mail.protection.outlook.com (10.152.20.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Mon, 25 Jan 2021 12:47:05 +0000 Received: ("Tessian outbound f362b81824dc:v71"); Mon, 25 Jan 2021 12:47:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b380e7a48dcc3bec X-CR-MTA-TID: 64aa7808 Received: from 4ded872b271b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D752C1BE-D5AE-48F5-B50B-A2E957D8B3FE.1; Mon, 25 Jan 2021 12:46:59 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4ded872b271b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 25 Jan 2021 12:46:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LjRhNeM48am1NjLF32msdyhd3bRQKHfje6Fvn+CWC7aDWrk4gFP53UYH25WfoL3lM5MNNK+vH+mUsD5ptfaNmmFdcKO66bls4QiRk/h9WcEx0mLkgRioJN6F3HOnxg/S+3QQXLhqzQujTpKsjXyFUuWcOC00mDUkzp09qf5r3MH9HeRdLp6lvWwAUYxkIjv5DOAcyKO2lLVsKGE0++s+6sErOvSb24z/7Q9tIdRLKD0UiAN5Oiy6ZpupRowX/S3lMommhSRjuiyae3fqt5929W/R4kf4Wae1rAfy8CaVvfyIyYK9QLqPJjKXw8MkpCxIpSq4ciJ4cwlCTJZP8/vHxQ== 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-SenderADCheck; bh=wAW6gshtsbBBp1L8fdKNDC6mqVW1lAPYWEHbfHHm8m4=; b=V8CM0q2B0hHQxGbAQSuuZUF05fBkTFmF3BRbN6qKWNc8AXtOdQS8F4Q0SyinJoxMebGmnxhkRt0lfHA3iCKAZuOY05/b5PHEMZl9xgDXsIIlJcri9B1+Z2OVRLSXb90rsLUr5MEn3WRPwRJ7rn+6R1bSOF1Rr2/vB9HJpBrJ0lfz5lRSZ2fCDBiq96pyzkHcJsQiWcMX6uxRTwjEtFkf1+e6BD/nx1Coy4K8LgmPFARwKZ3tTLBdS4ETUyiJMdgH2JOL+1MiNxdlAcu2o+j1qUe1PQ/DRyM/MbpoWeqmrntfgOEdUoklPhikihO4K1BdRgfASfBeQmvUt2NCqwrIVg== 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 Authentication-Results-Original: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=arm.com; Received: from PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) by PAXPR08MB6477.eurprd08.prod.outlook.com (2603:10a6:102:12d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.15; Mon, 25 Jan 2021 12:46:58 +0000 Received: from PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::941:f3b7:c753:21f8]) by PA4PR08MB6320.eurprd08.prod.outlook.com ([fe80::941:f3b7:c753:21f8%5]) with mapi id 15.20.3784.017; Mon, 25 Jan 2021 12:46:58 +0000 Date: Mon, 25 Jan 2021 12:46:56 +0000 To: libc-alpha@sourceware.org Subject: [PATCH v2] aarch64: Fix the list of tested IFUNC variants [BZ #26818] Message-ID: <20210125124655.GN3445@arm.com> References: <224874374ec839e932d0a7d4e3d152fb5f74b30a.1611572339.git.szabolcs.nagy@arm.com> Content-Disposition: inline In-Reply-To: <224874374ec839e932d0a7d4e3d152fb5f74b30a.1611572339.git.szabolcs.nagy@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.55] X-ClientProxiedBy: LO4P123CA0092.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::7) To PA4PR08MB6320.eurprd08.prod.outlook.com (2603:10a6:102:e5::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.55) by LO4P123CA0092.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 12:46:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9a8d3076-c898-4837-b92d-08d8c12f51b6 X-MS-TrafficTypeDiagnostic: PAXPR08MB6477:|AM0PR08MB5122: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GYuMEtzyEwPFubr1rP/C44tEyqMWHEMk2BFWR7kjlRrz1HvKvPCWW/eMAYKrSLGLxAjRIQZuqKWIyEH9ycala2VFYUqksKM6HwyvLBk1K8u8cMxE7dWe1M8oUyj1PKka1UKKBO4QUNDedWK3cHxCuu8o/PX7Z0klrWrB8U/dGXooUbC3eLrHdGjb6J4W7y2pAOasKHYNAFgN20uD7np+yu1jwGYc09zXisW9Dp51F2OLRBfO/71F0jIp7C2kR+F9pXHUzkQYmYVWzeBcVVnG0mV/KjLTG2LuLFXhTnYnzP6wfEz8UQa3V6h35ZXr2hx9PbrpzAHlBcHn1rWRKajlkjS4HEjqGtKHNC99nHa3uoCEQRVam4pv4jEU8caT6NTe2ARcd9CwLcnZ/5KERw9H3A== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR08MB6320.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(376002)(39860400002)(346002)(16526019)(26005)(186003)(52116002)(36756003)(316002)(478600001)(66946007)(7696005)(2616005)(66556008)(1076003)(8936002)(83380400001)(6916009)(66476007)(33656002)(956004)(5660300002)(2906002)(86362001)(8676002)(8886007)(55016002)(44832011); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?n2JQP+63RCTWwwkJojMgwIg0FdoteT?= =?utf-8?q?ecdFRScgILEWerZ8SbJZXm3KCOPxf95tcPjshUqrOjdiLtgE1map2ClpzBN+3ntPk?= =?utf-8?q?ROG8QykRj6sGunGBN09ukp+7sq/AM7tfMbWKyv53EhQipVMO7FkT3ABxqMKACkU7o?= =?utf-8?q?aY7jyrKW0zcrJp8SmJWXqfB/SRxs9n6O4JlBNCL89IpWdh9lVgKS0UenEoZ91ksGb?= =?utf-8?q?HUnZ3oDT/YP9CvytYTVCYUXT4UaYDZRm1vbwcEUrbSt5hpiOhPrL6jvAH688APbga?= =?utf-8?q?/qSKcOEeMDAXWjZxPXC5c1fWtJyxfedOhIWMVKFC7u2DCBiwKJ/1r6wrlRH6PIj0W?= =?utf-8?q?NUFmajeyeZSdCePSR2LHBaHyB/zEVl22vY/79KdFFqcLKURjhLqsg25palXI694dX?= =?utf-8?q?cxbKw6F+rKC4H49e1ZCmSGXPRIbaxqH5hLIWZIKlDmpYdNNCgissSRCSE+CbRZG1v?= =?utf-8?q?jn3laPNZYnmqPWEWHmyQL4iEdB5IN8Jsg3WFPCQN705ashkeOFaxuS+/WwnNr0gV5?= =?utf-8?q?Al46BcDtJ6sXYoXHfFPslZbcS5QJhvxFVzzaPvhBqsYCNzY6URuY/id8+CfpkS01p?= =?utf-8?q?S9cYqZvKTYxEy0u3XwgnwHrwkTf/7s6+Lk21wogeJNCB7x3TXDF179zJkzPDXyN9Y?= =?utf-8?q?rqOWMLIayu3GH0npmVO7fZBUXyUG0Glz1iJWqR11OKiN3Jm4yZkVIbS72TTzdHCN1?= =?utf-8?q?gVFpWBbu3EJdahWZI7N335AOU0KOnke29pwRCBiKovKOj54l+MerUtWw55r/F0Xkc?= =?utf-8?q?OTza1PxJRNirxEtPOmGQQ+IqQ7ZYMq7rprIjpkdeMdkZqU+AJ1cn6vEucALJ0iQuG?= =?utf-8?q?s14gtl6mavGB6vT371srkek5MoAkuTUVUk2llBZlySxo4RX7ta/Ne2/b6mYDbpJAL?= =?utf-8?q?3NfTrx82AYbAPCgUvpEMkiADER7WVFIW4CqVbdXLY5AmwSST3YGZXhaM4/BmgklTl?= =?utf-8?q?Q18lH6u7YyEF+PmlE4J?= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6477 Original-Authentication-Results: sourceware.org; dkim=none (message not signed) header.d=none; sourceware.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3bdfdbd3-1d45-4c01-138e-08d8c12f4d96 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HWAC8EGQ1dtb8tsZv1OGZmEb9KfliF9NFN5eKTKGuSWr6c9xA69pSZJAnM4VcdOM6nK1Eo3GXDP7nYMx6nWzo1SyhUiuCMBlSQ1MoNhLEBiZWH7LRch1S9MudfAEhus9ful/JNu62I8/98E99FSXkdSH7h/uPftOTcKJGJAr7p8yeSP/8kdMTMOIwhOdy3EsFmGlMT0Ecd+Fx3fR1j7/TdrN6fU+r9BF21S1/Aa+G4O/SW5jjnAwAYjYqiVjV3ZlNeBnjbihBeVfFeViWgcE5UrdSHtK/FS2cpAHn8QBAU+RpKvaceK0nc+FlupN9QcT7S2xuWH6MUK6kaFPkN7C4fL9oNNlhyKcmhPXsMlKV1jC72/LjgDd0eiea1RURBtxRGbdzFUZHSIroCDmAW9r/ofVdijZg+Vva3coBSc+XuT9eGFHivbYpCPCFO/yMf6qTVBiWcP0c/yh+OXnEU5SQC6L9Lj+SUJ31dQNTe/9c5DnuvcE9q6OjTgbWh2wlKFLmOSQcXHhR5dxpLqsXV703hJupGYZaBg/Sz72ZHg7CsmdcAOntmD7Kb2fxvzDv/Su6nkQFs+cMLo1ZzpOClH7uwgt5p5AU+RX51I87j2wON4= 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)(346002)(39860400002)(396003)(376002)(136003)(46966006)(8886007)(81166007)(33656002)(8936002)(82310400003)(2616005)(47076005)(82740400003)(1076003)(55016002)(70586007)(70206006)(356005)(83380400001)(316002)(478600001)(7696005)(186003)(44832011)(336012)(956004)(36756003)(86362001)(6916009)(16526019)(2906002)(26005)(5660300002)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 12:47:05.1408 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a8d3076-c898-4837-b92d-08d8c12f51b6 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: DB5EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5122 X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Szabolcs Nagy via Libc-alpha From: Szabolcs Nagy Reply-To: Szabolcs Nagy Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Some IFUNC variants are not compatible with BTI and MTE so don't set them as usable for testing and benchmarking on a BTI or MTE enabled system. As far as IFUNC selectors are concerned a system is BTI enabled if the cpu supports it and glibc was built with BTI branch protection. Most IFUNC variants are BTI compatible, but thunderx2 memcpy and memmove use a jump table with indirect jump, without a BTI j. Fixes bug 26818. --- v2: - memset variants are mte compatible, so no reason to disable them for an mte enabled system. sysdeps/aarch64/multiarch/ifunc-impl-list.c | 8 ++++---- sysdeps/aarch64/multiarch/init-arch.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sysdeps/aarch64/multiarch/ifunc-impl-list.c b/sysdeps/aarch64/multiarch/ifunc-impl-list.c index a69eae65f0..99a8c68aac 100644 --- a/sysdeps/aarch64/multiarch/ifunc-impl-list.c +++ b/sysdeps/aarch64/multiarch/ifunc-impl-list.c @@ -40,13 +40,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, /* Support sysdeps/aarch64/multiarch/memcpy.c and memmove.c. */ IFUNC_IMPL (i, name, memcpy, IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx) - IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx2) + IFUNC_IMPL_ADD (array, i, memcpy, !bti, __memcpy_thunderx2) IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_falkor) IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_simd) IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic)) IFUNC_IMPL (i, name, memmove, IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx) - IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx2) + IFUNC_IMPL_ADD (array, i, memmove, !bti, __memmove_thunderx2) IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_falkor) IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_simd) IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_generic)) @@ -58,11 +58,11 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, IFUNC_IMPL_ADD (array, i, memset, 1, __memset_kunpeng) IFUNC_IMPL_ADD (array, i, memset, 1, __memset_generic)) IFUNC_IMPL (i, name, memchr, - IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_nosimd) + IFUNC_IMPL_ADD (array, i, memchr, !mte, __memchr_nosimd) IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_generic)) IFUNC_IMPL (i, name, strlen, - IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_asimd) + IFUNC_IMPL_ADD (array, i, strlen, !mte, __strlen_asimd) IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_mte)) return i; diff --git a/sysdeps/aarch64/multiarch/init-arch.h b/sysdeps/aarch64/multiarch/init-arch.h index fce260d168..a167699e74 100644 --- a/sysdeps/aarch64/multiarch/init-arch.h +++ b/sysdeps/aarch64/multiarch/init-arch.h @@ -30,5 +30,7 @@ GLRO(dl_aarch64_cpu_features).midr_el1; \ unsigned __attribute__((unused)) zva_size = \ GLRO(dl_aarch64_cpu_features).zva_size; \ + bool __attribute__((unused)) bti = \ + HAVE_AARCH64_BTI && GLRO(dl_aarch64_cpu_features).bti; \ bool __attribute__((unused)) mte = \ MTE_ENABLED ();