Re: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test

2020-07-24 Thread Ni, Ray
Mike, I resent V2 patch and reduced most of the global variable references. Furtherly, I added more CONST modifier to avoid test case accidently modifies the system parameter structure. I submitted a Bugzilla https://bugzilla.tianocore.org/show_bug.cgi?id=2863 to capture what you suggested

Re: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test

2020-07-23 Thread Michael D Kinney
Hi Ray, In the following Unit Test Functions, I recommend passing in mDefaultSystemParameter as the Context parameter to reduce the use of a global variables. * UnitTestIsMtrrSupported() * UnitTestGetVariableMtrrCount() * UnitTestGetFirmwareVariableMtrrCount() * UnitTestMtrrGetFixedMtrr() *

Re: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test

2020-07-17 Thread Laszlo Ersek
On 07/17/20 09:33, Ray Ni wrote: > Add host based unit tests for the MtrrLib services. > The BaseLib services AsmCpuid(), AsmReadMsr64(), and > AsmWriteMsr64() are hooked and provide simple emulation > of the CPUID leafs and MSRs required by the MtrrLib to > run as a host based unit test. > >

[edk2-devel] [PATCH] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test

2020-07-17 Thread Ni, Ray
Add host based unit tests for the MtrrLib services. The BaseLib services AsmCpuid(), AsmReadMsr64(), and AsmWriteMsr64() are hooked and provide simple emulation of the CPUID leafs and MSRs required by the MtrrLib to run as a host based unit test. Test cases are developed for each of the API. For