From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.4085.1642583821757757700 for ; Wed, 19 Jan 2022 01:17:02 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jeRvWxwi; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: zhiguang.liu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642583821; x=1674119821; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RyaRwTZ1COvI28nRIdGCeG2SdpqptErcocv7NkEoVFw=; b=jeRvWxwiia9XEQiM5alBf13E9M6f8GSdvKGfNzghMfiCqdQDY1hHSy8k Dr40YTDN7nooVW5zNmj1bwJUNPEHPKfYAg6wB4Y5n2GrodNcsqlDjnohj 7yEkTL2nPC9VrwZaXJvjpQRj6st5Qh6TA4sBobn920OjMmW8ZXtzkw6q6 9Beph+w2C676FIuMiU5njmXTl/J4EPkPkDcxgrvPisoVY1tN8pmFJCNnh YR3mPMnqaYtuGZBej3tgXtzp9mBVRI0mX7bBGgbKdwnaZ/zzvtqyuB340 fuSriXk9XMD+CnrPicGIy8AYWVtgyC8tFV2hNOIYj3bnKr3hvOvmPcEui w==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="305754508" X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="305754508" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 01:17:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="518101733" Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.158]) by orsmga007.jf.intel.com with ESMTP; 19 Jan 2022 01:16:59 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You Subject: [PATCH] UefiPayloadPkg: Use BaseCpuTimerLib for Universal Payload by default Date: Wed, 19 Jan 2022 17:16:46 +0800 Message-Id: <20220119091646.130-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Current, a macro CPU_TIMER_LIB_ENABLE is added to determine which timerlib is used. BaseCpuTimerLib.inf is a better way and only fit for recent CPU. Meanwhile, Universal Payload are only aimed to work with recent CPU. Therefore, for Universal Payload, use the BaseCpuTimerLib by default Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Zhiguang Liu --- UefiPayloadPkg/UefiPayloadPkg.dsc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 65c1bd610e..1ce96a51c1 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -111,10 +111,10 @@ DEFINE SERIAL_DRIVER_ENABLE =3D TRUE=0D DEFINE PERFORMANCE_MEASUREMENT_ENABLE =3D FALSE=0D =0D - # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Coun= ter.=0D - # This is recommended way to get the time, and also how BaseCpuTimerLib = works.=0D - # However, some CPU doesn't support this feature, so disable it by defau= lt.=0D - DEFINE CPU_TIMER_LIB_ENABLE =3D FALSE=0D + # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Coun= ter Frequence.=0D + # This is how BaseCpuTimerLib works, and a recommended way to get Freque= nce, so set the default value as TRUE.=0D + # Note: for emulation platform such as QEMU, this may not work and shoul= d set it as FALSE=0D + DEFINE CPU_TIMER_LIB_ENABLE =3D TRUE=0D =0D [BuildOptions]=0D *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES= =0D @@ -222,7 +222,7 @@ #=0D # Platform=0D #=0D -!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE=0D +!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE && $(UNIVERSAL_PAYLOAD) =3D=3D TRU= E=0D TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf=0D !else=0D TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf=0D --=20 2.32.0.windows.2