From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) by sourceware.org (Postfix) with ESMTPS id CB7CE3858C3A for ; Thu, 14 Mar 2024 14:42:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB7CE3858C3A 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-Filter: OpenARC Filter v1.0.0 sourceware.org CB7CE3858C3A Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.75 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710427379; cv=pass; b=j5v5RpUckreZ4N9tLKyDYnFfCFB1npAAwhrrFwZDx+QtbDxs+5ccdOPiyusGJdudb+c9lhaXBSbavSTG4yh9QkWP0LQ09phq5jJgdEWYzqeSN/TvJ0EgA+BhtkR6u9mjgu9LJVfJE6Xjn+YBtpUb+FrSkc2GTOSLFpHEu9sj70E= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710427379; c=relaxed/simple; bh=u/L2nJvSJr4pVKOf02sL2A5b1Vzl9X4sB37lNnBR7mc=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=gSrDWitppym7c+YNc1avd5vQ7bI7mJ6hEiqSRoC4oXT5dTWKs2Vwvupe6o4ccKJkpuodoy5R2ZsEeC9ZZ9Ce4EvpxkLKI10nHkjlVHvRcAoVwzTGRlPwVHvf6mnnc+OWPdPQRdBMU8DTuOXjhG1UVu174QjQtUOhq+VxYmfhVks= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=nFGRvvo+2isM888os1GFJ+DAF63yOsSOCb7geta6wyIi4ELq8Czt70QRPMua/L3tmctnoWb2Mwf0/257Gh5KGJfINRdIFiief6V6aaXA73VX6yHV+q50nEp0uYUN0LFUUB40KLmCupF/AHKzWng4IQtvfQtt19Kmu5EwNC/mKfQYXDQhj0WR3l+9++tRLYhDNRO+0ikdVsG6JzGSkKHqkt2fsQSdd5647CyX72+qUyEc+r1Vs4m9BPJRrH34NAZcvPly7vSSaR5PJixSwLApsh1aY1kD87C+xPhr32sTmFWNFVgUANEUJyExvDyS4CwpZ/DFYWbwWhyoCFlrNZGnbw== 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=u/L2nJvSJr4pVKOf02sL2A5b1Vzl9X4sB37lNnBR7mc=; b=adgUep9mHY2dS1EcDShxXl4tj7cLBXwWX7ooy6wFaMHFbdA9hIdp3LHwnfhMDL5aJqZGValv1qcI6lEh24ZjOHPuZ9C86xSprhl9F3MZ+bdqTi9tjnZ4+VXdWY/qdzTe0G0k1DMQlw5ZLu+DlxlSqSEwI6Mm2Zb6IHElEf1vCTOZu2X/R5biWqEWFffjM7U6nq5Mpsu/BDZuN8STxDB4W0b+6WUqQ/rmkKjkXAIG/rxHc95vk4jIrWDsdKLG29YrV/XKS4v8fHKn9GJ+i3T7jq4M23iiEDtnD1M6KA53R8FZiyuS+ly9d+XfJ2giAlFIP1lfKLL+WUynRmWfZ0OOXQ== 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] dkim=[1,1,header.d=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=u/L2nJvSJr4pVKOf02sL2A5b1Vzl9X4sB37lNnBR7mc=; b=Cd2/5EYuaGQgxLvh5wMOuogmD0Fa2y08lKHZB+8K7Rnc0uiJK08mu01ELXbOux/F9c1IBpt6tW+d22KcLkhbKjROKPR+MfTvnUZ4Hc9Lq2u6ePLKvq8Q4vCpnAzMoyVfpmtZkZamNVzNrENcri+YBEpCLmRDpP5+XFxS7EZQrxU= Received: from AS9PR05CA0166.eurprd05.prod.outlook.com (2603:10a6:20b:496::12) by PAVPR08MB9258.eurprd08.prod.outlook.com (2603:10a6:102:308::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21; Thu, 14 Mar 2024 14:42:51 +0000 Received: from AM1PEPF000252DF.eurprd07.prod.outlook.com (2603:10a6:20b:496:cafe::8) by AS9PR05CA0166.outlook.office365.com (2603:10a6:20b:496::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21 via Frontend Transport; Thu, 14 Mar 2024 14:42:50 +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 AM1PEPF000252DF.mail.protection.outlook.com (10.167.16.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.12 via Frontend Transport; Thu, 14 Mar 2024 14:42:50 +0000 Received: ("Tessian outbound 598157ceef91:v276"); Thu, 14 Mar 2024 14:42:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ce7d0b9428f94c31 X-CR-MTA-TID: 64aa7808 Received: from d0674f974e66.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 10C2F8FE-2693-4E23-B6F6-0634F07A3260.1; Thu, 14 Mar 2024 14:42:43 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d0674f974e66.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Mar 2024 14:42:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TVwJ2C1A972+h6nzRY3deE91btZLf+2NJu/4Bn8ca9c0AbyS/6XSjqJEnjGwTJAR0gupeLfY3NBqVpkSOJikWoobh34Vbixk/GkzLcv7gbbFtYDQZXs49tAETl8Hugoh9DCgxOu20IkULL3UQmf8G3U7lgop13vQFbSALa8ZjlYTuK1RRVGMklidB0Ob6FKGz25qpeBgdYG3hdaHwUMwFWyZorzIuUjegZ5MMTUk8Wrsz4/J7ha4jTw2pUgzXS3zcMy4q1YMWwi0fl5JJL7XP82Hk9/4EvFTPeDYPG6XcRmSk4vPFaaf3+ivwp0riRXeucLjQ9t1Sv6ng8epBWJYYg== 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=u/L2nJvSJr4pVKOf02sL2A5b1Vzl9X4sB37lNnBR7mc=; b=DuuHTLBOdig6iTXJCEXuIgTEaBT40KvnzrcgwPtA5hWmPB2zVC6nqnrnEsdEr9LRsJeZ/+g65BuQgM3ay7fxWmcDnlZKyAl7cDPaErTOLUv7f7tejNt2a7ntMuQ/11Pb/w10yc1alnrTZHu23IuZ+ioUKZ0mMZIofQhUzigtJhwJ1kK7gDNG9IKzUSiLMbkDN360vmmo5s70s/dFhHxFQYPYpyCQpagFLGpLTtWN7FrvCyRKbGcokg1a3PRUyNhyo4zhmSCAH5YQ3mScIp6UYiHR1AbyAyXk+1EN56S4C0xdjPMwyKamA/qOnEeXe1nWPJjbtdANcS/j+m1sHvOmHA== 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 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=u/L2nJvSJr4pVKOf02sL2A5b1Vzl9X4sB37lNnBR7mc=; b=Cd2/5EYuaGQgxLvh5wMOuogmD0Fa2y08lKHZB+8K7Rnc0uiJK08mu01ELXbOux/F9c1IBpt6tW+d22KcLkhbKjROKPR+MfTvnUZ4Hc9Lq2u6ePLKvq8Q4vCpnAzMoyVfpmtZkZamNVzNrENcri+YBEpCLmRDpP5+XFxS7EZQrxU= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by GV1PR08MB8426.eurprd08.prod.outlook.com (2603:10a6:150:8a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18; Thu, 14 Mar 2024 14:42:41 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::8b1b:5f28:5006:ac18]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::8b1b:5f28:5006:ac18%4]) with mapi id 15.20.7362.035; Thu, 14 Mar 2024 14:42:41 +0000 From: Wilco Dijkstra To: Florian Weimer CC: 'GNU C Library' Subject: Re: [PATCH] AArch64: Check kernel version for SVE ifuncs Thread-Topic: [PATCH] AArch64: Check kernel version for SVE ifuncs Thread-Index: AQHadVLx33HAZ4D2skuZZ4SgsA+U67E28yOngABVFvo= Date: Thu, 14 Mar 2024 14:42:41 +0000 Message-ID: References: <878r2lnpx9.fsf@oldenburg.str.redhat.com> In-Reply-To: <878r2lnpx9.fsf@oldenburg.str.redhat.com> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|GV1PR08MB8426:EE_|AM1PEPF000252DF:EE_|PAVPR08MB9258:EE_ X-MS-Office365-Filtering-Correlation-Id: a00710f4-8045-4ff0-3780-08dc4435063a 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: Tn6Acb9j27U7X1eP56U5emF08oZ+MhOXFFmtsfZAr1xudqYNbhfvZkFXBiWJys69693dwgVeRbp59c290gVt8hEJQf/AeRS5lAje8e+tGyf0ZNWmKPgwmz1MmhlbHPP7SH29efODL3MHu58Fx4t18quE7Y1RC9JiKXV4gpkISS+DfhmpQBHhOiL/n4Y3Jps1nr5gsJZCMpw0HyZZn8lEXDKhqNZr+sLGpDrJH7I8h8m8aY8FBp/7ZPpYMZh5tRLeT2Ypea6KkYz7YGCnulzgJhnKup1kFgs/veSRvWF3Np1LHqz+WLrIMTPOvz3fDjmoLYR/oNSoD8mux4HBmJdczaMxpa0LJ83YzmRGQ1LVJOpB0OYMf9HKgK2oyLFFRrI+XibUoY5XYGM8gbY1QIU6HWqLUpGiA+g8pT9b6TdgMsM1PtCkJlWaIWBVJJSNhNGoVSbN8FlZ2lxs6XVtGzhGwrYaYkGYFEdrF4FaEsi0BRsfDOG96YdPIoImmbL/iK35NOssM3Hhr4R5J3Gi7jc02RfsNlCgnnV0dpmdWkfx1Brw2lWR6WEILKtpco4qw7Bx3E42Wav/yQRLz9CbEZqE8cwtewXJNaP7+AwLIpANU7ZKQQTEhVCmnX5IsEDDAKv4SWaYS57ewsTQqb+p4yrcK2xE+aCvFwdx3huucO3+H8I= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAWPR08MB8982.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(38070700009);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8426 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: AM1PEPF000252DF.eurprd07.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a339d40d-b1f9-4243-e85a-08dc44350068 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Txv798bdz4pC16sX4yu2m4+wX952pLi2bbpGM6t0IqB7gs4kH4S23/JkUlwf8Tt3c8HnNnoFzjZGUS3sMPg/3kYZtz1Ahv8M2/3eAVPQoCppfOuCpGeX2nS9E+P9aXVBi9FnpI8l2uRG1V+/XO3Q3KM18IGRQP0ujuZ4ei/r42oJMUrjwmwG5UuamFJPjWdPgTUFwZGQ3XI/jVH6sJmEiKC+HhS4QIyiCb2vuSi3k8M7bu94UswVZFZFuCwkp4NsSgKv/QBfbmvozqnFbI6AXsQ6QOYqDAS4L3TxYRcosZ/lG/pwwqUaB9xFEi4D3s9UdS5lkd6dXH+vRQOwWqFt1gmfGkgslQCNiiaHwoKz6STqoNK8Z1v92zUB2y4Y9noJjuFUxTBu1OxkCkyv+Q1y8SZ77w1FDjdHoEGqjVTbVRcdKgdoVEnToII1jY5b+ujSM3KFanGdlIRT9h8uWDCXCETQ2V8sZg2v0Pz8uQ6tHCR7a92kqCKc6YlvQ7+EBehKQsxDM3rfSwBZHDqIqknneYewXIqynpa/O2Rc+PzKsea93bsRVGPOYG3PbceEzSfYEohqZ4yVJUyLbf7VTq/H1Z+so7usVojbkcmW1+2mK3KAOSq1xoy8FtsWpATJNlc0MiEgpCo8pTW5XtWH0PUDQ/TIJLUNicR+RaOiM/BOI8b4PXgtA3MJgWv89hrcioypSTRLwOkBMHa/QGWv2iZLXw== 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:(13230031)(1800799015)(36860700004)(82310400014)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2024 14:42:50.7576 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a00710f4-8045-4ff0-3780-08dc4435063a 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: AM1PEPF000252DF.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9258 X-Spam-Status: No, score=-4.7 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 List-Id: Hi Florian,=0A= =0A= > Given that the existing SVE users have not complained about this, is it= =0A= > really a good idea to disable SVE string functions for them?=A0 Not=0A= > everyone interleaves system calls and string functions in inner loops.=0A= =0A= People have found significant regressions when trying the SVE memcpy [1],= =0A= the kernel commit mentions 70% overhead in microbenchmarks [2].=0A= =0A= Also distros appear to use a wide range of kernel versions. I've seen the= =0A= same GLIBC version used with 5.11 kernel all the way up to 6.5 in the=0A= same version of a distro - and these are all standard installations...=0A= =0A= Hence we need some kind of workaround to deal with old kernels before=0A= adding more uses of SVE (new SVE ifuncs or backports of existing ones).=0A= =0A= > +/* Parse kernel version without calling any library functions.=0A= > +=A0=A0 Allow 2 digits for kernel version and 3 digits for major version,= =0A= > +=A0=A0 separated by '.': "kk.mmm.".=0A= > +=A0=A0 Return kernel version * 1000 + major version, or -1 on failure.= =A0 */=0A= =0A= > I think you should parse the versions you exclude because you know their= =0A= > syntax.=A0 We tried to predict the layout of future kernel version string= s=0A= > before and failed.=0A= =0A= Yes that is a good idea. So we could just scan for "k.m." format and if it = doesn't=0A= match or if uname fails, treat it like a new kernel. It's not a correctness= issue,=0A= so if someone uses a different format or blocks uname() in a container then= it's=0A= fine to assume it is a new kernel and enable the SVE ifuncs.=0A= =0A= Cheers,=0A= Wilco=0A= =0A= =0A= [1] https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1999551/comments/4= 5=0A= [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/arch/arm64/kernel/fpsimd.c?id=3D8c845e2731041f0fdf9287dea80b039b26332c9f=