From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.10845.1595938184768767948 for ; Tue, 28 Jul 2020 05:09:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=W7JfVieq; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595938183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vTvdJ6i1Xn5nYMfX/i3VtwTQ7PVib75DzIVMDSI4k6E=; b=W7JfVieqe+1j6Z8D4ABYpqjPzwjln0bQzwDGupDwv7YMnSu2HqmPlOTGhgGoF5aUji3+mQ Xpe5tZr9Q3HyWLUqaXx42lagVEdrpNAJoZk7ueYK69rOqqBEAiXyEI7L2OUdgu4hPSyfNX BKiHNDG8Guo4O7wrJRf8mfaCG6/Cmzk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-WkLI5RT-OciDwtv4thBxJw-1; Tue, 28 Jul 2020 08:09:42 -0400 X-MC-Unique: WkLI5RT-OciDwtv4thBxJw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03CF8802B41; Tue, 28 Jul 2020 12:09:40 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-229.ams2.redhat.com [10.36.113.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B6C971D0E; Tue, 28 Jul 2020 12:09:37 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v4] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test To: devel@edk2.groups.io, ray.ni@intel.com Cc: Michael D Kinney , Ming Shao , Eric Dong , Sean Brogan , Bret Barkelew , Jiewen Yao References: <20200728084325.142-1-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: <88895b90-975d-499c-c7a8-48e7b0605fa1@redhat.com> Date: Tue, 28 Jul 2020 14:09:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200728084325.142-1-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 > Signed-off-by: Michael D Kinney > Signed-off-by: Ming Shao > Cc: Michael D Kinney > Cc: Eric Dong > Cc: Laszlo Ersek > Cc: Ming Shao > Cc: Sean Brogan > Cc: Bret Barkelew > Cc: Jiewen Yao > --- > .../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 Thanks Laszlo