From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-fw-9103.amazon.com (smtp-fw-9103.amazon.com [207.171.188.200]) by sourceware.org (Postfix) with ESMTPS id 36B553858C83 for ; Wed, 11 Jan 2023 16:48:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36B553858C83 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=amazon.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1673455680; x=1704991680; h=from:to:cc:subject:date:message-id:mime-version; bh=tHFjIxYvBm1Or9S+B3PKHMmWHKWLq/yJ2mXT7qPEgT4=; b=OpC6aY659oaQbLLObBXZoaL0E8/YISQDHlTLq8lEC2nqZy5ulaHEf0dt GqqWu4N8pPCnM6AlQ5vUlzt2IjTqFWwz3RDv8xgHM679ie582s8lErZrQ cQbVVXjlsyKNf9138sFWnvBoO54p0bFVlAbBhlbcwhBMWCQbVbHJC/9zN A=; X-IronPort-AV: E=Sophos;i="5.96,317,1665446400"; d="scan'208,217";a="1091531130" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-m6i4x-bbc6e425.us-east-1.amazon.com) ([10.25.36.214]) by smtp-border-fw-9103.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 16:44:32 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-m6i4x-bbc6e425.us-east-1.amazon.com (Postfix) with ESMTPS id 0D48B81171 for ; Wed, 11 Jan 2023 16:44:31 +0000 (UTC) Received: from EX19D001UWB003.ant.amazon.com (10.13.138.112) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 11 Jan 2023 16:44:31 +0000 Received: from EX19D044UWA004.ant.amazon.com (10.13.139.7) by EX19D001UWB003.ant.amazon.com (10.13.138.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.7; Wed, 11 Jan 2023 16:44:30 +0000 Received: from EX19D044UWA004.ant.amazon.com ([fe80::781f:7190:c095:c260]) by EX19D044UWA004.ant.amazon.com ([fe80::781f:7190:c095:c260%5]) with mapi id 15.02.1118.020; Wed, 11 Jan 2023 16:44:30 +0000 From: "Tang, Jun" To: "libc-alpha@sourceware.org" CC: "Pop, Sebastian" Subject: bug fix for hp-timing.h (aarch64) Thread-Topic: bug fix for hp-timing.h (aarch64) Thread-Index: Adkl2yuxhhuxivSvTB+TnnsYBV/4yA== Date: Wed, 11 Jan 2023 16:44:30 +0000 Message-ID: <8ae95272accb441aad774a5f10d27d57@amazon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.106.179.24] Content-Type: multipart/alternative; boundary="_000_8ae95272accb441aad774a5f10d27d57amazoncom_" MIME-Version: 1.0 X-Spam-Status: No, score=-19.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --_000_8ae95272accb441aad774a5f10d27d57amazoncom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Graviton 3 the frequency is 1050000000 and the original function hp-timi= ng.h no longer gives the correct answer. The following patch can fix the bu= g: ``` diff --git a/sysdeps/aarch64/hp-timing.h b/sysdeps/aarch64/hp-timing.h index c8469e3011..c5a1204d2c 100644 --- a/sysdeps/aarch64/hp-timing.h +++ b/sysdeps/aarch64/hp-timing.h @@ -41,7 +41,7 @@ typedef uint64_t hp_timing_t; #define HP_TIMING_DIFF(Diff, Start, End) \ ({ hp_timing_t freq; \ __asm__ __volatile__ ("mrs %0, cntfrq_el0" : "=3Dr" (freq)); \ - (Diff) =3D ((End) - (Start)) * (UINT64_C(1000000000) / freq); \ + (Diff) =3D (hp_timing_t)((End) - (Start)) * ((1000000000.0) / freq); \ }) #endif /* hp-timing.h */ ``` I have also submitted a bug report with the proposed changes at - https://sourceware.org/bugzilla/show_bug.cgi?id=3D29329 Regards, Jun --_000_8ae95272accb441aad774a5f10d27d57amazoncom_--