From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.3946.1642140965419475684 for ; Thu, 13 Jan 2022 22:16:05 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=I/8y3FFr; spf=pass (domain: intel.com, ip: 134.134.136.65, 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=1642140965; x=1673676965; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6IEGu2geVQo9nZl6JEti3dKZoWey1lW7Rf+EhZ+pwWY=; b=I/8y3FFr4HRirN7Y3Y9ZHazY5M2WQjELayFNVbQQ//C3gv6cSrFNrYjP yheZtjb4bI8xx8NNRUf0c6XlJbJ/RbhVvGlPPcPwz0AXhdSTXOKVa+6B1 0aw3jZnAnV3jFp66IftuGgWtxHNnFMzbBeFQTJfJFGF7q4LE293ERihyX Xgb1328KoWgAUmDxyLGGFaVQAeywDJrrCoudgPAPTgVOmkT9xyXbYC/4L cJaElqdiUxlYS9HjL9WrF0U6/ldvhUCCUCvqxkN6O7Pe+Ib9HK4AloHFi nwP+AOVkhEeRHiLp18j3RGcgy/imKhfiN8pwCWODvQNFjNhLuvswmw28l Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10226"; a="244146199" X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="244146199" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 22:15:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,287,1635231600"; d="scan'208";a="491391051" Received: from shwdesfp01.ccr.corp.intel.com ([10.239.158.158]) by orsmga002.jf.intel.com with ESMTP; 13 Jan 2022 22:15:29 -0800 From: "Zhiguang Liu" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Maurice Ma , Benjamin You Subject: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default. Date: Fri, 14 Jan 2022 14:15:18 +0800 Message-Id: <20220114061518.503-1-zhiguang.liu@intel.com> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter. This is recommended way to get the time, and also how BaseCpuTimerLib works However, some CPU doesn't support this feature, so disable it by default. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Zhiguang Liu --- UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 3d08edfe31..65c1bd610e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -111,6 +111,11 @@ 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 +=0D [BuildOptions]=0D *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES= =0D GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG=0D @@ -217,7 +222,7 @@ #=0D # Platform=0D #=0D -!if $(UNIVERSAL_PAYLOAD) =3D=3D TRUE=0D +!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE=0D TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf=0D !else=0D TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf=0D --=20 2.32.0.windows.2