From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, ray.ni@intel.com
Cc: Eric Dong <eric.dong@intel.com>, Rahul Kumar <rahul1.kumar@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 1/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr()
Date: Mon, 13 Jul 2020 16:53:21 +0200 [thread overview]
Message-ID: <8b898913-2f93-91ed-633f-49949da88a83@redhat.com> (raw)
In-Reply-To: <20200713081236.1284-2-ray.ni@intel.com>
On 07/13/20 10:12, Ni, Ray wrote:
> MtrrGetVariableMtrr() returns all the variable MTRR settings.
> But in fact MtrrGetAllMtrrs() and
> MtrrGetMemoryAttributeInVariableMtrr() are used by callers to get the
> MTRR settings. The former one returns both the fixed and variable
> MTRR settings.
>
> The patch removes the necessary API MtrrGetVariableMtrr() to simplify
(1) I think we should replace "necessary" with "unnecessary" in the
commit message.
with that fixed:
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> the MtrrLib API.
>
> There is no code in edk2 and edk2-platforms repo that calls
> MtrrGetVariableMtrr().
>
> Signed-off-by: Ray Ni <ray.ni@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> ---
> UefiCpuPkg/Include/Library/MtrrLib.h | 17 +----------------
> UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 27 +--------------------------
> 2 files changed, 2 insertions(+), 42 deletions(-)
>
> diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Library/MtrrLib.h
> index 95ffbc8bf1..cfe3c0ab59 100644
> --- a/UefiCpuPkg/Include/Library/MtrrLib.h
> +++ b/UefiCpuPkg/Include/Library/MtrrLib.h
> @@ -1,7 +1,7 @@
> /** @file
> MTRR setting library
>
> - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
> );
>
>
> -/**
> - This function will get the raw value in variable MTRRs
> -
> - @param[out] VariableSettings A buffer to hold variable MTRRs content.
> -
> - @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the content of the variable MTRR
> -
> -**/
> -MTRR_VARIABLE_SETTINGS*
> -EFIAPI
> -MtrrGetVariableMtrr (
> - OUT MTRR_VARIABLE_SETTINGS *VariableSettings
> - );
> -
> -
> /**
> This function sets variable MTRRs
>
> diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> index dfa848022b..f4a10edc87 100644
> --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> @@ -5,7 +5,7 @@
> Most of services in this library instance are suggested to be invoked by BSP only,
> except for MtrrSetAllMtrrs() which is used to sync BSP's MTRR setting to APs.
>
> - Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker (
> return VariableSettings;
> }
>
> -/**
> - This function will get the raw value in variable MTRRs
> -
> - @param[out] VariableSettings A buffer to hold variable MTRRs content.
> -
> - @return The VariableSettings input pointer
> -
> -**/
> -MTRR_VARIABLE_SETTINGS*
> -EFIAPI
> -MtrrGetVariableMtrr (
> - OUT MTRR_VARIABLE_SETTINGS *VariableSettings
> - )
> -{
> - if (!IsMtrrSupported ()) {
> - return VariableSettings;
> - }
> -
> - return MtrrGetVariableMtrrWorker (
> - NULL,
> - GetVariableMtrrCountWorker (),
> - VariableSettings
> - );
> -}
> -
> /**
> Programs fixed MTRRs registers.
>
>
next prev parent reply other threads:[~2020-07-13 14:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-13 8:12 [PATCH v2 0/3] Remove unnecessary APIs in MtrrLib Ni, Ray
2020-07-13 8:12 ` [PATCH v2 1/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Ni, Ray
2020-07-13 14:53 ` Laszlo Ersek [this message]
2020-07-14 2:15 ` [edk2-devel] " Dong, Eric
2020-07-13 8:12 ` [PATCH v2 2/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetVariableMtrr() Ni, Ray
2020-07-13 14:54 ` [edk2-devel] " Laszlo Ersek
2020-07-14 2:15 ` Dong, Eric
2020-07-13 8:12 ` [PATCH v2 3/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetFixedMtrr() Ni, Ray
2020-07-13 14:54 ` [edk2-devel] " Laszlo Ersek
2020-07-14 2:15 ` Dong, Eric
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=8b898913-2f93-91ed-633f-49949da88a83@redhat.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