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

Laszlo Ersek lersek at redhat.com
Tue Jul 28 12:09:37 UTC 2020


Hi Ray,

On 07/28/20 10:43, Ni, Ray 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.
> 
> Test cases are developed for each of the API.
> 
> For the most important APIs MtrrSetMemoryAttributesInMtrrSettings()
> and MtrrSetMemoryAttributeInMtrrSettings(), random inputs are
> generated and fed to the APIs to make sure the implementation is
> good. The test application accepts an optional parameter which
> specifies how many iterations of feeding random inputs to the two
> APIs. The overall number of test cases increases when the iteration
> increases. Default iteration is 10 when no parameter is specified.
> 
> Signed-off-by: Ray Ni <ray.ni at intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> Signed-off-by: Ming Shao <ming.shao at intel.com>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Ming Shao <ming.shao at intel.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> ---
>  .../MtrrLib/UnitTest/MtrrLibUnitTest.c        | 1139 +++++++++++++++++
>  .../MtrrLib/UnitTest/MtrrLibUnitTest.h        |  182 +++
>  .../MtrrLib/UnitTest/MtrrLibUnitTestHost.inf  |   39 +
>  UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c |  923 +++++++++++++
>  UefiCpuPkg/Test/UefiCpuPkgHostTest.dsc        |   31 +
>  UefiCpuPkg/UefiCpuPkg.ci.yaml                 |   12 +-
>  6 files changed, 2325 insertions(+), 1 deletion(-)
>  create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
>  create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.h
>  create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTestHost.inf
>  create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
>  create mode 100644 UefiCpuPkg/Test/UefiCpuPkgHostTest.dsc

I don't have comments on this patch; I've been giving my Acked-by to
confirm that I'm OK with this particular set of files being introduced /
modified under UefiCpuPkg. So I'll defer on further versions to Eric.

For this version, this one last time:

Acked-by: Laszlo Ersek <lersek at redhat.com>

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63402): https://edk2.groups.io/g/devel/message/63402
Mute This Topic: https://groups.io/mt/75840226/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list