From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io, zhiguang.liu@intel.com
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: Re: [edk2-devel] [PATCH 2/4] PrmPkg: Use new API to replace MtrrLibInitializeMtrrMask
Date: Thu, 8 Jun 2023 10:51:20 -0400 [thread overview]
Message-ID: <7f1600f7-1b1f-afc2-2c6e-8ada4642a0eb@linux.microsoft.com> (raw)
In-Reply-To: <20230608030629.2734-2-zhiguang.liu@intel.com>
Minor comment in code below.
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
On 6/7/2023 11:06 PM, Zhiguang Liu wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3394
>
> The function MtrrLibInitializeMtrrMask is a private function
> in MtrrLib.c from UefiCpuPkg, and it can be replace with new
> API GetMaxPlatformAddressBits.
>
> Cc: Michael Kubacki <mikuback@linux.microsoft.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> ---
> .../PrmSampleHardwareAccessModule.c | 18 ++----------------
> .../PrmSampleHardwareAccessModule.inf | 1 +
> 2 files changed, 3 insertions(+), 16 deletions(-)
>
> diff --git a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c
> index 1a1e735029..398497c3a9 100644
> --- a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c
> +++ b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.c
> @@ -13,6 +13,7 @@
> #include <Library/BaseLib.h>
> #include <Library/MtrrLib.h>
> #include <Library/UefiLib.h>
> +#include <Library/CpuLib.h>
>
> #include <Register/Intel/ArchitecturalMsr.h>
> #include <Register/Intel/Cpuid.h>
> @@ -37,21 +38,6 @@
> //
> extern CONST CHAR8 *mMtrrMemoryCacheTypeShortName[];
>
> -/**
> - Initializes the valid bits mask and valid address mask for MTRRs.
> -
> - This function initializes the valid bits mask and valid address mask for MTRRs.
> -
> - @param[out] MtrrValidBitsMask The mask for the valid bit of the MTRR
> - @param[out] MtrrValidAddressMask The valid address mask for the MTRR
> -
> -**/
> -VOID
> -MtrrLibInitializeMtrrMask (
> - OUT UINT64 *MtrrValidBitsMask,
> - OUT UINT64 *MtrrValidAddressMask
> - );
> -
> /**
> Convert variable MTRRs to a RAW MTRR_MEMORY_RANGE array.
> One MTRR_MEMORY_RANGE element is created for each MTRR setting.
> @@ -151,7 +137,7 @@ AccessAllMtrrs (
> MtrrGetAllMtrrs (&LocalMtrrs);
> Mtrrs = &LocalMtrrs;
>
> - MtrrLibInitializeMtrrMask (&MtrrValidBitsMask, &MtrrValidAddressMask);
> + GetMaxPlatformAddressBits (&MtrrValidBitsMask, &MtrrValidAddressMask);
> Ranges[0].BaseAddress = 0;
> Ranges[0].Length = MtrrValidBitsMask + 1;
> Ranges[0].Type = MtrrGetDefaultMemoryType ();
> diff --git a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.inf b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.inf
> index 46d4a88185..b15da817c1 100644
> --- a/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.inf
> +++ b/PrmPkg/Samples/PrmSampleHardwareAccessModule/PrmSampleHardwareAccessModule.inf
> @@ -34,6 +34,7 @@
> MtrrLib
> UefiDriverEntryPoint
> UefiLib
> + CpuLib
Since the library class list was already sorted, can you please sort
CpuLib within the list?
>
> [Depex]
> TRUE
next prev parent reply other threads:[~2023-06-08 14:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 3:06 [PATCH 1/4] MdePkg: Add new API GetMaxPlatformAddressBits Zhiguang Liu
2023-06-08 3:06 ` [PATCH 2/4] PrmPkg: Use new API to replace MtrrLibInitializeMtrrMask Zhiguang Liu
2023-06-08 14:51 ` Michael Kubacki [this message]
2023-06-08 3:06 ` [PATCH 3/4] UefiCpuPkg: Clean up some Mtrr code using new API Zhiguang Liu
2023-06-08 3:06 ` [PATCH 4/4] UefiCpuPkg: Init new MSR value for MtrrLib Unit Test Zhiguang Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f1600f7-1b1f-afc2-2c6e-8ada4642a0eb@linux.microsoft.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox