From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 68960D80CA2 for ; Mon, 4 Dec 2023 18:48:15 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nUYBpltqgWWcb0IfRqZroQs82ldiF9ISXBMPxFcEsvs=; 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=iMwucTvPGNCaskRQgZ5RRqAkvV4hHZiJA68LCengDRHYhVcw5/hshfvy6q03+9t3+LCWal1g agnGNnAZ5eKa7lui1w62dZYR+qiZ1ezBGxujxmGOfQCYAtiSLy9b6FRj2vri0HkP1uxroYGaJ3E Yo9NLyn81D/jQh0eNKKrsSi4= X-Received: by 127.0.0.2 with SMTP id cVUaYY7687511xoKNfL0o7Vs; 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: h6mIJjmCg5SjqwHX6EKBcFz3x7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=iMwucTvP; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) 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 --- .../AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.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. - 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 **/ @@ -11,6 +11,11 @@ #include #include +// +// Cached performance counter frequency +// +static UINT64 mAcpiTimerLibTscFrequency = 0; + extern GUID mFrequencyHobGuid; /** @@ -48,11 +53,6 @@ InternalCalculateTscFrequency ( VOID ); -// -// Cached performance counter frequency -// -UINT64 mPerformanceCounterFrequency = 0; - /** Internal function to retrieves the 64-bit frequency in Hz. @@ -66,7 +66,7 @@ InternalGetPerformanceCounterFrequency ( VOID ) { - return mPerformanceCounterFrequency; + return mAcpiTimerLibTscFrequency; } /** @@ -92,9 +92,9 @@ CommonAcpiTimerLibConstructor ( // GuidHob = GetFirstGuidHob (&mFrequencyHobGuid); if (GuidHob != NULL) { - mPerformanceCounterFrequency = *(UINT64 *)GET_GUID_HOB_DATA (GuidHob); + mAcpiTimerLibTscFrequency = *(UINT64 *)GET_GUID_HOB_DATA (GuidHob); } else { - mPerformanceCounterFrequency = InternalCalculateTscFrequency (); + mAcpiTimerLibTscFrequency = InternalCalculateTscFrequency (); } return EFI_SUCCESS; -- 2.39.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-