From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH v1 1/1] UefiCpuPkg: Remove PEI/DXE instances of CpuTimerLib. To: Jason Lou ,devel@edk2.groups.io From: "Jason Lou" X-Originating-Location: CN (192.55.46.56) X-Originating-Platform: Windows Chrome 89 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 01 Apr 2021 01:41:41 -0700 References: <20843.1616659080240333148@groups.io> In-Reply-To: <20843.1616659080240333148@groups.io> Message-ID: <25152.1617266501208872998@groups.io> Content-Type: multipart/alternative; boundary="TwhJy01vrI5u4DENot3y" --TwhJy01vrI5u4DENot3y Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 1. Since the time it takes to find specified GUID Extension Hob (CpuCrystal= FrequencyHob: about 2000ns) is much longer than it takes to calculate TSC frequency with CPUID (about = 450ns), I recommend using BaseCpuTimerLib instead of PeiCpuTimerLib. 2. The time it takes to get TSC frequency from global variable is shorter = than it takes to calculate TSC frequency with CPUID, but 450ns is really a short time, the impact on the = platform is very limited. In addition, in order to simplify the code, recommend using BaseCpuTimerLi= b instead of DxeCpuTimerLib. If anyone has questions or concerns, please feel free to let me know. If n= ot, I will submit code patch later, thanks. Jason Lou --TwhJy01vrI5u4DENot3y Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
1. Since the time it takes to find specified GUID Extension Hob (CpuCr= ystalFrequencyHob: about 2000ns)
is much longer than it takes to calc= ulate TSC frequency with CPUID (about 450ns), I recommend using
BaseCp= uTimerLib instead of PeiCpuTimerLib.

2. The time it takes to get= TSC frequency from global variable is shorter than it takes to calculate T= SC
frequency with CPUID, but 450ns is really a short time, the impact= on the platform is very limited.
In addition, in order to simplify the code, recommend using BaseCpuTi= merLib instead of DxeCpuTimerLib.

If anyone has questions or con= cerns, please feel free to let me know. If not, I will submit code patch la= ter,
thanks.

Jason Lou

--TwhJy01vrI5u4DENot3y--