From patchwork Tue Jun 4 12:55:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 1943310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=nkIHHhlX; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=nkIHHhlX; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VtrFg4Srtz20PW for ; Tue, 4 Jun 2024 22:56:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7541F3882667 for ; Tue, 4 Jun 2024 12:56:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::601]) by sourceware.org (Postfix) with ESMTPS id CE31A385B510 for ; Tue, 4 Jun 2024 12:56:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE31A385B510 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 CE31A385B510 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717505774; cv=pass; b=Nq77KetKE9YPAVnxRqDwXcKMqq0Ekmtc70JVEc2M4STrxOZ3i2NeLx5OCYjsbm0vsvOiFuKZ0yhmLqVhMKOA8yG7/RyMnjUiZXWeESkTL7leD/J9XnOhxmfLbuKx8M9MedDgG/kmVzMhr79+qBTZHMDIJGcu43UK6pnIM37gcf8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1717505774; c=relaxed/simple; bh=Bkm16xi4WeseEXVTowWZTR7YPFcDHHHHKNuUhuggaQk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=h7nc+Ze9/iG6Yd4SbSZ+09Off8BKXrwM9+s9jRmljbG6xtKMJNUD/vXYsPm+effh99ys/nHKOQVKnQ+cPe1W1mvo1UaN7mafSdXwb2XtTLHOLtUaaA0+xfL36iZg50zsD8IBOjM1Di7aPpp0Qcvpm8grnZ36SlkXv4FScQhKLJ8= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=TToSNA+lDCYYqFGI36Xc9FE2nbo8HjocnvnxMIaxrdKhOEXQcl3uEQazYE02EzCVbGpmddaB0DKhh33uc9XW4Kk6sNwg+lSK1v/3y95cuAo5ooj6h0C3YjZqdL2uVJ4AFzKYC1Wj5tPIOX/MlvFyhCBYuhbiZZwko+pdPb98x0EV1d+luZHrv6WSQYsLtzmZ8fLlj6SsX8W8rj3s2TFkq8zkfgGSCcS20Ki63WDxMNFTrceeCM+jVaoI/pNrw20euEe36ec2Kb4Qiz8vvMxK2XWsEnpvKF3+B7na/AatoLkogKSFAUbX6+tDIs/YgIPLIX0nbyD0uPRnBEhRrEsSWA== 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=t4hCYxzk9g/EPup6zV94JJO6bjnmliPQzoMN3PPd0+k=; b=dsin1jofPR3v3A6r230UOTaI9z/Jj1f44AHeY9AqiaYaS/CdZR4M/KuVKvG4qqzSM8oscdpPznrwIid1IdjUuifvypnxvvRu81Uvq7PevX0XZTP8uR+pZRfO8iRUs3feGMws0C9jrPZV0aWiM6cN+85OZQL1K3uo6Mi0qLm7/E1xVnuPaawGDa8HD9ktYehk9X9wJN1cK2u70IT5xnLglYv8mIAZuF8VgxBs/EQOjyXP5g4cpKbohcbECHuymkuHhITPZwiUm3OwYuCrqF3YCtRPJuW/yD0SnMEHvreOtwIWyMNwUey6TwCpeArxtoi4kx2V4tboN2aVVq3aAmGBvw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.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=arm.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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t4hCYxzk9g/EPup6zV94JJO6bjnmliPQzoMN3PPd0+k=; b=nkIHHhlXbRWPAQx1VOJV9uDwHoTMB0JMByvfCD9sdt1nzncDPMErQEIH+PTwc9Z/opntkphwoYVuYeA9j1HiPUnRC+OMKjiX4+ersu/YPPSuy7ZVuRBmyE6+TgOYXSZTrEhIJtN/UhscHWgC4ICESU+SlX2JqcZh6sF7PkFZCyY= Received: from DB9PR05CA0024.eurprd05.prod.outlook.com (2603:10a6:10:1da::29) by VI1PR08MB9983.eurprd08.prod.outlook.com (2603:10a6:800:1c8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Tue, 4 Jun 2024 12:56:07 +0000 Received: from DB1PEPF000509EB.eurprd03.prod.outlook.com (2603:10a6:10:1da:cafe::51) by DB9PR05CA0024.outlook.office365.com (2603:10a6:10:1da::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Tue, 4 Jun 2024 12:56:07 +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=arm.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 DB1PEPF000509EB.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Tue, 4 Jun 2024 12:56:06 +0000 Received: ("Tessian outbound d79ebeff6a2c:v327"); Tue, 04 Jun 2024 12:56:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f889cac0ec2cbc9d X-CR-MTA-TID: 64aa7808 Received: from ef20cf386930.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4FC4F195-4C0A-4BCB-826B-D58F63E310D1.1; Tue, 04 Jun 2024 12:55:59 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ef20cf386930.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 04 Jun 2024 12:55:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mRJZmqvv70XS36GPxUJLeP9cQJ7rMcqpnr63f7qbqVjhVIw1Up3dOyfSXkzNFjZkuMKAyyt/1u9MQEVGEQVIlnA2fM0vriw4iMowdJSMiCMf3rzp+mkCC2q1MapKGT+eH/T0F+9t9RUAE/ODH8Zv8ZP/dFXBVhiRv9LPVPOk7AVU045JrU6xHmluNKiSbqmfHq8pUUUISsx7J+tYpROY2sKNXaa/97s58qp6HPLVQOUEmU7QDjpQuN4z25EOQwAlS6kxfVW94hWLlzBALRT6mwbjnV0m4lUcgutQgw9tN3yaEidaOq80VlBmwCJ/CQKVu18DkAa4qPNcqT7cNVrbUg== 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=t4hCYxzk9g/EPup6zV94JJO6bjnmliPQzoMN3PPd0+k=; b=XPNZTqfu/Vz6K35+LLyvCrdoyu33Lcr33/U9me6KFBhSOmVRHucH97R2lW2FLQEJMeGBQ9f7qnSnO0zTsCDJflnkIB/gMFJyFyUbs4qWxu8cCN8aU2HCDp9K/mo7S27l3q//bV+jGfaKuFYaPL28US3jGgA4Ig42M2x8z2tbv7fd9ODQskw0IPhvIE4Uy1m42cMP1L5VP1057v2zCvgWqIfzaLgfk417goA8kAZ8eIv2HG2rtxgixJYNrldL4hQx1Quho07tXtDVQdUuG+M9fS+i9lWiL8i9vNMJWyVPVDlM1oFhZF687i2IXA4qeF127Nv2Kdu6P3PSSToNRlWEPQ== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t4hCYxzk9g/EPup6zV94JJO6bjnmliPQzoMN3PPd0+k=; b=nkIHHhlXbRWPAQx1VOJV9uDwHoTMB0JMByvfCD9sdt1nzncDPMErQEIH+PTwc9Z/opntkphwoYVuYeA9j1HiPUnRC+OMKjiX4+ersu/YPPSuy7ZVuRBmyE6+TgOYXSZTrEhIJtN/UhscHWgC4ICESU+SlX2JqcZh6sF7PkFZCyY= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AS2PR08MB8782.eurprd08.prod.outlook.com (2603:10a6:20b:5e4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30; Tue, 4 Jun 2024 12:55:56 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d%4]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 12:55:56 +0000 From: Wilco Dijkstra To: Richard Sandiford , Richard Earnshaw CC: GCC Patches Subject: PATCH] AArch64: Fix cpu features initialization [PR115342] Thread-Topic: PATCH] AArch64: Fix cpu features initialization [PR115342] Thread-Index: AQHatn5BBJYhDbQ+bEaeCyegUuXI+A== Date: Tue, 4 Jun 2024 12:55:56 +0000 Message-ID: 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_|AS2PR08MB8782:EE_|DB1PEPF000509EB:EE_|VI1PR08MB9983:EE_ X-MS-Office365-Filtering-Correlation-Id: fe87f76b-b3d4-4f93-8be0-08dc8495b28a x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; X-Microsoft-Antispam-Message-Info-Original: =?iso-8859-1?q?1mVNJxk4P7oS2Xqar?= =?iso-8859-1?q?J7H2IvBI67wK6xwCaJpBjZwRLr6mK6Vy+Cxw4P5BuWfaO6OcoNzpKxueI1wD?= =?iso-8859-1?q?YT1qCPwUR3EjA0DJo/vwN0kYu1c3ELxNh0TD7R+rFQAX/K/xh+HTB5l1AuWw?= =?iso-8859-1?q?M0S9beYe4bgn/cKF4OZVEle+QC1GYyhAlXykUWcNsNj5/p7ht7oquh22A1jQ?= =?iso-8859-1?q?2Nszxn0BWNJQeL16GcLdUW5kUwU+7wxjzn3CU9v3DBQ6aDkVgiO0jvUaZfGi?= =?iso-8859-1?q?/4/5gk2zVsolxVXvKSTx0fsp4AYTyGjLRmTNzKkamJwUKC5m+z25z4CWAVX8?= =?iso-8859-1?q?YIZN+W3XibQ1KQRt//KPIq20ynt3JETtCt21T5LOU7rgXxYh3L1QQhDiMW9c?= =?iso-8859-1?q?5DhXkyGfl/5bAvjgl4MPPLckK0xKShMlC2kxrp1HIMJNwQ+CmOyZHqIJba00?= =?iso-8859-1?q?m6sfG0vVJSUlJGwWbsv92Ok0g5pvZL74NDTUDkXyUfW4kavfF95UwZMvuKUd?= =?iso-8859-1?q?OZZ5QxQt4f3WOk88GjIhXH+pauvDWbAXD/jObbAJ2ak81ND/gzFQuO/xXJk1?= =?iso-8859-1?q?TkdfTdxnBMc0tsGryErO4jfwbASlkIjbnnNmRUtxH/Knj/mxOF9bPN9eJI0M?= =?iso-8859-1?q?4vumbMmfWTUGqtRQJ8OBGrNJabnEVN7xN6gBqDyqgepBn0K0DFfxK17K3fOj?= =?iso-8859-1?q?R8uOuiVV3SUxGTvLOnk9RPOjgZGY6OL6CzENcVUcaUqZXyo4JAYvW39WbyMM?= =?iso-8859-1?q?c7kXjrFL2oJR2FFWye3f389DH1WkEl/s08cNniGS9oRF5iL0MLveth0a4PhX?= =?iso-8859-1?q?xuOhuL5CWo9+FG4m/bhEB9w2s4fIScuGDa/ROtDH90y0qMBCP85jTzvLyulz?= =?iso-8859-1?q?clJ+SwUroAUoAnIx1zsi2Bu7FqLZ97xCOVYIFu8PdqBX1jPx/3gYiXWnXcef?= =?iso-8859-1?q?GKVemDJKFJaMJBPZmSEu2N0JDTP0KNQJ0zgnyQ/pVhQJ3enL0oVDG66QnUSW?= =?iso-8859-1?q?WiDWJFHFYW20zAlDptYGF0QJxolCYZWuNUlyQ82u5p/f5Tq0byCYAnXo40ZB?= =?iso-8859-1?q?2ATq6doCfRogbdmlYb+M3HMNaoP4K8S6UbgksnbSmpfUMWJAhU49i5AEIcgm?= =?iso-8859-1?q?WTtC3prxxaq+G0XSETq6PmeQShsuOylv5tYWh0bzArW8Dn6RRrvTKaVFUmJm?= =?iso-8859-1?q?00z+P2/YTzprY5ON3wT4RduPNMcN/oFzdFjypn2FfYas4Ajnl1AOx4OfX8bw?= =?iso-8859-1?q?1Rq44ejrVvaKoZDawGf/UsUz+kl+SRF19+Y01u4RDxfOt19hprdcI4IIdSPa?= =?iso-8859-1?q?CpaeXc4IvqPoPbV/YjOaliinysxVZWajUFQiI4SJuEZhNTSevPGkqA9SZvgu?= =?iso-8859-1?q?UbRg2ZtN0Mq1xQSPKkn5cgihy09AysH4+LqFFLFmTqej9k7Zxo=3D?= 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)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8782 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: DB1PEPF000509EB.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 53a21e20-a8b8-4d46-18e2-08dc8495ad09 X-Microsoft-Antispam: BCL:0; ARA:13230031|35042699013|82310400017|1800799015|36860700004|376005; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?cGBBhjGlLR7uxWcY1ZsO0vbCN3?= =?iso-8859-1?q?BtAxGt/RMWyNDBiXbaoXSEUTdgwxt7iYzuSLkfQhjtVpNBT+R4v4PkIhLFg6?= =?iso-8859-1?q?8T85d8BOladsLAjNStO/4ZEeHZeHyy40ZR3SbUXR3324SYkREGtlojWi8XL5?= =?iso-8859-1?q?YUEW5Yj+G+HmXBoBZHkHUpqsFUZqJtCSjet+hXzoeCyeuiBt41Zh5dhpdxtM?= =?iso-8859-1?q?4cwXyBslA48/scV0w05MkTZNUiqXmO7owNVRQLqDyPFmR1aG1cxOv+HW4GhT?= =?iso-8859-1?q?KLVNeQD0aGrUG9p7Kx3TSLNZ2ZCe9OtW7gahE72U9Xk2iT0ODljCLzPz+XGF?= =?iso-8859-1?q?6KPi5n41rjXDPcUi3qPE3YIjQePuk9ozlxcEtD4J68P28/7Za5caNZ8wXuMO?= =?iso-8859-1?q?KqtdumvwDd3MR+4NhjAn0AE27fZwx7fzPXDiI0YNlOIQsr71XWMbuRyksaMn?= =?iso-8859-1?q?QAuGB34K4KGMUboxW1qCQHJwHWn/lSugQMMx5QneKEylQIRBTdMlpa4WoiI/?= =?iso-8859-1?q?GfgmpdVjAk+d3Vsqkx5HVZZj/RodzDWTo8sHatrb0rPb+uapIlYxLArLgho8?= =?iso-8859-1?q?GXpzQhjOLrpsmi8Noh3obAeOqQVy18T8oE7hOSAhpJ9U5BvNcIjGsZz+zBVX?= =?iso-8859-1?q?ArnMoVi1E1DC/0lSHpgPJhGpYKo5pmJI7Hg3nDOs3b8r/6VW/Cwr6XC/DMMR?= =?iso-8859-1?q?S1tunCKi6NhK23gqhAPQBO3vqcK156uqi99gFFo5KRG2wp8OG1XkG27JuIBC?= =?iso-8859-1?q?cKR/whotOGo4CupAfRMrYSmvyqEiWn8qtEpPPhaR3hkr0Sr403DVCUqA3bJY?= =?iso-8859-1?q?pmfyS9YgVUexNsriltnd7v6W6vPIYrPdAsWHUfivQuGgrczBboICXsyoo4c2?= =?iso-8859-1?q?SJeBpX+r+gGceV98oVSbzIjfRQBNcfrZKG/v0/tdBl3Wg+BKGh1SDUyQuPWU?= =?iso-8859-1?q?R67j59kfScH3kpn0WnX8ZEnlkikovMAgKk+GeXp1V3MZhkQNdwgKbkOlGL6i?= =?iso-8859-1?q?AbEjun6rEQMKzeHe+uYzmgYqbJFQx8m3loC0Cyo0s6W5vg5FGwY1M3pArbp/?= =?iso-8859-1?q?9EXzFcNc6kYUzEo7re87Ez/eGy0IkmCmBGnfXylCgYzoXOqOhq7/QHcFD+a1?= =?iso-8859-1?q?OVGqg9jRhhTdnehXTPNcvD4kLemXpDr3x74T/SmKvII3ygLWb+k+U5dE9T4p?= =?iso-8859-1?q?T6JxumtvuLqi7eRUEFB30b/An15n/3YAb/txnRZxIUrIInmw+f+NVpMxjPzj?= =?iso-8859-1?q?iwQA29yf+5DScOYdSM4okc9dgX2OkotOZKWjJRMhZ9sB0DfQgbf3cHhCfX9d?= =?iso-8859-1?q?GdjQo5N/3Cc5bope1WYzAr3COKYMr73QFWQsPXUzLR50ubFrIaYTb7A+fR4Q?= =?iso-8859-1?q?Ge0bCVOzwNcw4hzkmZ/76xd4D/AhLTqt3VOH2TICs=3D?= 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)(35042699013)(82310400017)(1800799015)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:56:06.0029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe87f76b-b3d4-4f93-8be0-08dc8495b28a 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: DB1PEPF000509EB.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB9983 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Fix CPU features initialization. Use HWCAP rather than explicit accesses to CPUID registers. Perform the initialization atomically to avoid multi- threading issues. Passes regress, OK for commit and backport? libgcc: PR target/115342 * config/aarch64/cpuinfo.c (__init_cpu_features_constructor): Use HWCAP where possible. Use atomic write for initialization. (__init_cpu_features_resolver): Use atomic load for correct initialization. (__init_cpu_features): Likewise. diff --git a/libgcc/config/aarch64/cpuinfo.c b/libgcc/config/aarch64/cpuinfo.c index 4b94fca869507145ec690c825f637abbc82a3493..544c5516133ec3a554d1222de2ea9d5e6d4c27a9 100644 --- a/libgcc/config/aarch64/cpuinfo.c +++ b/libgcc/config/aarch64/cpuinfo.c @@ -227,14 +227,22 @@ struct { #ifndef HWCAP2_SVE_EBF16 #define HWCAP2_SVE_EBF16 (1UL << 33) #endif +#ifndef HWCAP2_SME2 +#define HWCAP2_SME2 (1UL << 37) +#endif +#ifndef HWCAP2_LRCPC3 +#define HWCAP2_LRCPC3 (1UL << 46) +#endif static void -__init_cpu_features_constructor(unsigned long hwcap, - const __ifunc_arg_t *arg) { -#define setCPUFeature(F) __aarch64_cpu_features.features |= 1ULL << F +__init_cpu_features_constructor (unsigned long hwcap, + const __ifunc_arg_t *arg) +{ + unsigned long feat = 0; +#define setCPUFeature(F) feat |= 1UL << F #define getCPUFeature(id, ftr) __asm__("mrs %0, " #id : "=r"(ftr)) #define extractBits(val, start, number) \ - (val & ((1ULL << number) - 1ULL) << start) >> start + (val & ((1UL << number) - 1UL) << start) >> start unsigned long hwcap2 = 0; if (hwcap & _IFUNC_ARG_HWCAP) hwcap2 = arg->_hwcap2; @@ -244,26 +252,20 @@ __init_cpu_features_constructor(unsigned long hwcap, setCPUFeature(FEAT_PMULL); if (hwcap & HWCAP_FLAGM) setCPUFeature(FEAT_FLAGM); - if (hwcap2 & HWCAP2_FLAGM2) { - setCPUFeature(FEAT_FLAGM); + if (hwcap2 & HWCAP2_FLAGM2) setCPUFeature(FEAT_FLAGM2); - } - if (hwcap & HWCAP_SM3 && hwcap & HWCAP_SM4) + if (hwcap & HWCAP_SM4) setCPUFeature(FEAT_SM4); if (hwcap & HWCAP_ASIMDDP) setCPUFeature(FEAT_DOTPROD); if (hwcap & HWCAP_ASIMDFHM) setCPUFeature(FEAT_FP16FML); - if (hwcap & HWCAP_FPHP) { + if (hwcap & HWCAP_FPHP) setCPUFeature(FEAT_FP16); - setCPUFeature(FEAT_FP); - } if (hwcap & HWCAP_DIT) setCPUFeature(FEAT_DIT); if (hwcap & HWCAP_ASIMDRDM) setCPUFeature(FEAT_RDM); - if (hwcap & HWCAP_ILRCPC) - setCPUFeature(FEAT_RCPC2); if (hwcap & HWCAP_AES) setCPUFeature(FEAT_AES); if (hwcap & HWCAP_SHA1) @@ -277,22 +279,21 @@ __init_cpu_features_constructor(unsigned long hwcap, if (hwcap & HWCAP_SB) setCPUFeature(FEAT_SB); if (hwcap & HWCAP_SSBS) - setCPUFeature(FEAT_SSBS2); - if (hwcap2 & HWCAP2_MTE) { - setCPUFeature(FEAT_MEMTAG); - setCPUFeature(FEAT_MEMTAG2); - } - if (hwcap2 & HWCAP2_MTE3) { - setCPUFeature(FEAT_MEMTAG); - setCPUFeature(FEAT_MEMTAG2); + { + setCPUFeature(FEAT_SSBS); + setCPUFeature(FEAT_SSBS2); + } + if (hwcap2 & HWCAP2_MTE) + { + setCPUFeature(FEAT_MEMTAG); + setCPUFeature(FEAT_MEMTAG2); + } + if (hwcap2 & HWCAP2_MTE3) setCPUFeature(FEAT_MEMTAG3); - } if (hwcap2 & HWCAP2_SVEAES) setCPUFeature(FEAT_SVE_AES); - if (hwcap2 & HWCAP2_SVEPMULL) { - setCPUFeature(FEAT_SVE_AES); + if (hwcap2 & HWCAP2_SVEPMULL) setCPUFeature(FEAT_SVE_PMULL128); - } if (hwcap2 & HWCAP2_SVEBITPERM) setCPUFeature(FEAT_SVE_BITPERM); if (hwcap2 & HWCAP2_SVESHA3) @@ -329,108 +330,76 @@ __init_cpu_features_constructor(unsigned long hwcap, setCPUFeature(FEAT_WFXT); if (hwcap2 & HWCAP2_SME) setCPUFeature(FEAT_SME); + if (hwcap2 & HWCAP2_SME2) + setCPUFeature(FEAT_SME2); if (hwcap2 & HWCAP2_SME_I16I64) setCPUFeature(FEAT_SME_I64); if (hwcap2 & HWCAP2_SME_F64F64) setCPUFeature(FEAT_SME_F64); - if (hwcap & HWCAP_CPUID) { - unsigned long ftr; - getCPUFeature(ID_AA64PFR1_EL1, ftr); - /* ID_AA64PFR1_EL1.MTE >= 0b0001 */ - if (extractBits(ftr, 8, 4) >= 0x1) - setCPUFeature(FEAT_MEMTAG); - /* ID_AA64PFR1_EL1.SSBS == 0b0001 */ - if (extractBits(ftr, 4, 4) == 0x1) - setCPUFeature(FEAT_SSBS); - /* ID_AA64PFR1_EL1.SME == 0b0010 */ - if (extractBits(ftr, 24, 4) == 0x2) - setCPUFeature(FEAT_SME2); - getCPUFeature(ID_AA64PFR0_EL1, ftr); - /* ID_AA64PFR0_EL1.FP != 0b1111 */ - if (extractBits(ftr, 16, 4) != 0xF) { - setCPUFeature(FEAT_FP); - /* ID_AA64PFR0_EL1.AdvSIMD has the same value as ID_AA64PFR0_EL1.FP */ - setCPUFeature(FEAT_SIMD); - } - /* ID_AA64PFR0_EL1.SVE != 0b0000 */ - if (extractBits(ftr, 32, 4) != 0x0) { - /* get ID_AA64ZFR0_EL1, that name supported if sve enabled only */ - getCPUFeature(S3_0_C0_C4_4, ftr); - /* ID_AA64ZFR0_EL1.SVEver == 0b0000 */ - if (extractBits(ftr, 0, 4) == 0x0) - setCPUFeature(FEAT_SVE); - /* ID_AA64ZFR0_EL1.SVEver == 0b0001 */ - if (extractBits(ftr, 0, 4) == 0x1) - setCPUFeature(FEAT_SVE2); - /* ID_AA64ZFR0_EL1.BF16 != 0b0000 */ - if (extractBits(ftr, 20, 4) != 0x0) - setCPUFeature(FEAT_SVE_BF16); + if (hwcap & HWCAP_CPUID) + { + unsigned long ftr; + + getCPUFeature(ID_AA64ISAR1_EL1, ftr); + /* ID_AA64ISAR1_EL1.SPECRES >= 0b0001 */ + if (extractBits(ftr, 40, 4) >= 0x1) + setCPUFeature(FEAT_PREDRES); + /* ID_AA64ISAR1_EL1.LS64 >= 0b0001 */ + if (extractBits(ftr, 60, 4) >= 0x1) + setCPUFeature(FEAT_LS64); + /* ID_AA64ISAR1_EL1.LS64 >= 0b0010 */ + if (extractBits(ftr, 60, 4) >= 0x2) + setCPUFeature(FEAT_LS64_V); + /* ID_AA64ISAR1_EL1.LS64 >= 0b0011 */ + if (extractBits(ftr, 60, 4) >= 0x3) + setCPUFeature(FEAT_LS64_ACCDATA); } - getCPUFeature(ID_AA64ISAR0_EL1, ftr); - /* ID_AA64ISAR0_EL1.SHA3 != 0b0000 */ - if (extractBits(ftr, 32, 4) != 0x0) - setCPUFeature(FEAT_SHA3); - getCPUFeature(ID_AA64ISAR1_EL1, ftr); - /* ID_AA64ISAR1_EL1.DPB >= 0b0001 */ - if (extractBits(ftr, 0, 4) >= 0x1) - setCPUFeature(FEAT_DPB); - /* ID_AA64ISAR1_EL1.LRCPC != 0b0000 */ - if (extractBits(ftr, 20, 4) != 0x0) - setCPUFeature(FEAT_RCPC); - /* ID_AA64ISAR1_EL1.LRCPC == 0b0011 */ - if (extractBits(ftr, 20, 4) == 0x3) - setCPUFeature(FEAT_RCPC3); - /* ID_AA64ISAR1_EL1.SPECRES == 0b0001 */ - if (extractBits(ftr, 40, 4) == 0x2) - setCPUFeature(FEAT_PREDRES); - /* ID_AA64ISAR1_EL1.BF16 != 0b0000 */ - if (extractBits(ftr, 44, 4) != 0x0) - setCPUFeature(FEAT_BF16); - /* ID_AA64ISAR1_EL1.LS64 >= 0b0001 */ - if (extractBits(ftr, 60, 4) >= 0x1) - setCPUFeature(FEAT_LS64); - /* ID_AA64ISAR1_EL1.LS64 >= 0b0010 */ - if (extractBits(ftr, 60, 4) >= 0x2) - setCPUFeature(FEAT_LS64_V); - /* ID_AA64ISAR1_EL1.LS64 >= 0b0011 */ - if (extractBits(ftr, 60, 4) >= 0x3) - setCPUFeature(FEAT_LS64_ACCDATA); - } else { - /* Set some features in case of no CPUID support. */ - if (hwcap & (HWCAP_FP | HWCAP_FPHP)) { + + if (hwcap & HWCAP_FP) + { setCPUFeature(FEAT_FP); /* FP and AdvSIMD fields have the same value. */ setCPUFeature(FEAT_SIMD); } - if (hwcap & HWCAP_DCPOP || hwcap2 & HWCAP2_DCPODP) - setCPUFeature(FEAT_DPB); - if (hwcap & HWCAP_LRCPC || hwcap & HWCAP_ILRCPC) - setCPUFeature(FEAT_RCPC); - if (hwcap2 & HWCAP2_BF16 || hwcap2 & HWCAP2_EBF16) - setCPUFeature(FEAT_BF16); - if (hwcap2 & HWCAP2_SVEBF16) - setCPUFeature(FEAT_SVE_BF16); - if (hwcap2 & HWCAP2_SVE2 && hwcap & HWCAP_SVE) - setCPUFeature(FEAT_SVE2); - if (hwcap & HWCAP_SHA3) - setCPUFeature(FEAT_SHA3); - } + if (hwcap & HWCAP_DCPOP) + setCPUFeature(FEAT_DPB); + if (hwcap & HWCAP_LRCPC) + setCPUFeature(FEAT_RCPC); + if (hwcap & HWCAP_ILRCPC) + setCPUFeature(FEAT_RCPC2); + if (hwcap2 & HWCAP2_LRCPC3) + setCPUFeature(FEAT_RCPC3); + if (hwcap2 & HWCAP2_BF16) + setCPUFeature(FEAT_BF16); + if (hwcap2 & HWCAP2_SVEBF16) + setCPUFeature(FEAT_SVE_BF16); + if (hwcap & HWCAP_SVE) + setCPUFeature(FEAT_SVE); + if (hwcap2 & HWCAP2_SVE2) + setCPUFeature(FEAT_SVE2); + if (hwcap & HWCAP_SHA3) + setCPUFeature(FEAT_SHA3); setCPUFeature(FEAT_INIT); + + __atomic_store_n (&__aarch64_cpu_features.features, feat, __ATOMIC_RELAXED); } void -__init_cpu_features_resolver(unsigned long hwcap, const __ifunc_arg_t *arg) { - if (__aarch64_cpu_features.features) +__init_cpu_features_resolver(unsigned long hwcap, const __ifunc_arg_t *arg) +{ + if (__atomic_load_n (&__aarch64_cpu_features.features, __ATOMIC_RELAXED)) return; __init_cpu_features_constructor(hwcap, arg); } void __attribute__ ((constructor)) -__init_cpu_features(void) { +__init_cpu_features(void) +{ unsigned long hwcap; unsigned long hwcap2; + /* CPU features already initialized. */ - if (__aarch64_cpu_features.features) + if (__atomic_load_n (&__aarch64_cpu_features.features, __ATOMIC_RELAXED)) return; hwcap = getauxval(AT_HWCAP); hwcap2 = getauxval(AT_HWCAP2);