From nobody Fri May 17 11:59:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112050+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112050+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1701715694; cv=none; d=zohomail.com; s=zohoarc; b=B6TE4b+zih4CTkEQ7QlTDDWOyFFawDN2eHCQjsEMU0xKU/exfZWn/STwzAIiOpzy9PDDqXkGpJ4J2LtB5mN25FX2pv+VjifbdYz+cQO+M1CycjqcuJMIOwXgSCf4fyYjH1uUNigkE/nB+RhJA43SwJMVF7lPWz2okO9NoDmnzDI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701715694; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=0sNykaUE0X+G7hQfSI2Fo9Ks/3v3pxmVi1F+PjYrn2o=; b=JXxA0jPYyiJf4n2NnPfty2mUQTWkGJ0qjWKIRgJFG8mSW4BwHbvXOruaqZ5Jsaz93HJUuispRcY8lEfENtkxdAvM+dNWEr5quL4g9lxHuvk5kZIUbmzzUEltcx+mmNS95pfd47Arr6FHomHs6R77ZspGeFze4ATJqEKfAsXf6x4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112050+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1701715694257664.8225471820458; Mon, 4 Dec 2023 10:48:14 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Yknldcc/ZYl0E7z79vVGICdmBDq1nzBk8VxbtfiZaIM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1701715693; v=1; b=GQh3VNL+r40+D6g+QOWIgTgTVXPWp2Z56WcczB7rCVYFL7pGtmPEKeMGZYe3ikBpeU6iVD07 jzZqwUdPOqBl8iat+t5gEuPJhtdnY0eeHd/4vXoVFNGxB+FdKjwHXREguV6vvSiFvh8u63M08CN u0Hj6kSz1oEqrci8ztK5X/ag= X-Received: by 127.0.0.2 with SMTP id 9C4jYY1788612xRXYX1kxdxg; Mon, 04 Dec 2023 10:48:13 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.77545.1701715692760815282 for ; Mon, 04 Dec 2023 10:48:13 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="378808708" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="378808708" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 10:48:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="914534223" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="914534223" X-Received: from nldesimo-desk.amr.corp.intel.com ([10.241.240.67]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 10:48:10 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Ray Ni , Michael D Kinney Subject: [edk2-devel] [PATCH v2] PcAtChipsetPkg: Fix AcpiTimerLib incompatibility with XhciDxe Date: Mon, 4 Dec 2023 10:47:51 -0800 Message-Id: <20231204184751.348-2-nathaniel.l.desimone@intel.com> In-Reply-To: <20231204184751.348-1-nathaniel.l.desimone@intel.com> References: <20231204184751.348-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: ZKclgAflgPYkfQbBk5dKZZ28x1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1701715696509100005 Content-Type: text/plain; charset="utf-8" The DXE & MM standalone variant of AcpiTimerLib defines a global named mPerformanceCounterFrequency. A global with an identical name is also present in MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c Since XhciDxe has a dependency on TimerLib, this can cause link errors due to the same symbol being defined twice if the platform DSC chooses to use AcpiTimerLib as the TimerLib implementation for any given platform. To resolve this, I have changed made the definition of mPerformanceCounterFrequency to static and renamed it to mAcpiTimerLibTscFrequency. Since this variable is not used outside of the DxeStandaloneMmAcpiTimerLib.c compilation unit, there is no reason to have it exported as a global. Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Nate DeSimone Reviewed-by: Ray Ni --- .../AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLi= b.c b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c index 16ac48938f..ccceb8a649 100644 --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c @@ -1,7 +1,7 @@ /** @file ACPI Timer implements one instance of Timer Library. =20 - Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2013 - 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -11,6 +11,11 @@ #include #include =20 +// +// Cached performance counter frequency +// +static UINT64 mAcpiTimerLibTscFrequency =3D 0; + extern GUID mFrequencyHobGuid; =20 /** @@ -48,11 +53,6 @@ InternalCalculateTscFrequency ( VOID ); =20 -// -// Cached performance counter frequency -// -UINT64 mPerformanceCounterFrequency =3D 0; - /** Internal function to retrieves the 64-bit frequency in Hz. =20 @@ -66,7 +66,7 @@ InternalGetPerformanceCounterFrequency ( VOID ) { - return mPerformanceCounterFrequency; + return mAcpiTimerLibTscFrequency; } =20 /** @@ -92,9 +92,9 @@ CommonAcpiTimerLibConstructor ( // GuidHob =3D GetFirstGuidHob (&mFrequencyHobGuid); if (GuidHob !=3D NULL) { - mPerformanceCounterFrequency =3D *(UINT64 *)GET_GUID_HOB_DATA (GuidHob= ); + mAcpiTimerLibTscFrequency =3D *(UINT64 *)GET_GUID_HOB_DATA (GuidHob); } else { - mPerformanceCounterFrequency =3D InternalCalculateTscFrequency (); + mAcpiTimerLibTscFrequency =3D InternalCalculateTscFrequency (); } =20 return EFI_SUCCESS; --=20 2.39.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112050): https://edk2.groups.io/g/devel/message/112050 Mute This Topic: https://groups.io/mt/102976788/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-