MtrrSetVariableMtrr() sets all the variable MTRR settings.
But in fact MtrrSetAllMtrrs() is always used by callers to set all
MTRR settings including the fixed and variable ones.
The patch removes the necessary API MtrrSetVariableMtrr() to simplify
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 | 15 --------------
UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 29 ----------------------------
2 files changed, 44 deletions(-)
diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Library/MtrrLib.h
index cfe3c0ab59..0bc69e235c 100644
--- a/UefiCpuPkg/Include/Library/MtrrLib.h
+++ b/UefiCpuPkg/Include/Library/MtrrLib.h
@@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
);
-/**
- This function sets variable MTRRs
-
- @param[in] VariableSettings A buffer to hold variable MTRRs content.
-
- @return The pointer of VariableSettings
-
-**/
-MTRR_VARIABLE_SETTINGS*
-EFIAPI
-MtrrSetVariableMtrr (
- IN MTRR_VARIABLE_SETTINGS *VariableSettings
- );
-
-
/**
This function gets the content in fixed MTRRs
diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index f4a10edc87..8b54f2c03b 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker (
}
}
-
-/**
- This function sets variable MTRRs
-
- @param[in] VariableSettings A buffer to hold variable MTRRs content.
-
- @return The pointer of VariableSettings
-
-**/
-MTRR_VARIABLE_SETTINGS*
-EFIAPI
-MtrrSetVariableMtrr (
- IN MTRR_VARIABLE_SETTINGS *VariableSettings
- )
-{
- MTRR_CONTEXT MtrrContext;
-
- if (!IsMtrrSupported ()) {
- return VariableSettings;
- }
-
- MtrrLibPreMtrrChange (&MtrrContext);
- MtrrSetVariableMtrrWorker (VariableSettings);
- MtrrLibPostMtrrChange (&MtrrContext);
- MtrrDebugPrintAllMtrrs ();
-
- return VariableSettings;
-}
-
/**
Worker function setting fixed MTRRs
--
2.27.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#62405): https://edk2.groups.io/g/devel/message/62405
Mute This Topic: https://groups.io/mt/75472803/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
On 07/13/20 10:12, Ni, Ray wrote:
> MtrrSetVariableMtrr() sets all the variable MTRR settings.
> But in fact MtrrSetAllMtrrs() is always used by callers to set all
> MTRR settings including the fixed and variable ones.
>
> The patch removes the necessary API MtrrSetVariableMtrr() to simplify
(1) necessary -> unnecessary
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
> 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 | 15 --------------
> UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 29 ----------------------------
> 2 files changed, 44 deletions(-)
>
> diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Library/MtrrLib.h
> index cfe3c0ab59..0bc69e235c 100644
> --- a/UefiCpuPkg/Include/Library/MtrrLib.h
> +++ b/UefiCpuPkg/Include/Library/MtrrLib.h
> @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
> );
>
>
> -/**
> - This function sets variable MTRRs
> -
> - @param[in] VariableSettings A buffer to hold variable MTRRs content.
> -
> - @return The pointer of VariableSettings
> -
> -**/
> -MTRR_VARIABLE_SETTINGS*
> -EFIAPI
> -MtrrSetVariableMtrr (
> - IN MTRR_VARIABLE_SETTINGS *VariableSettings
> - );
> -
> -
> /**
> This function gets the content in fixed MTRRs
>
> diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> index f4a10edc87..8b54f2c03b 100644
> --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> @@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker (
> }
> }
>
> -
> -/**
> - This function sets variable MTRRs
> -
> - @param[in] VariableSettings A buffer to hold variable MTRRs content.
> -
> - @return The pointer of VariableSettings
> -
> -**/
> -MTRR_VARIABLE_SETTINGS*
> -EFIAPI
> -MtrrSetVariableMtrr (
> - IN MTRR_VARIABLE_SETTINGS *VariableSettings
> - )
> -{
> - MTRR_CONTEXT MtrrContext;
> -
> - if (!IsMtrrSupported ()) {
> - return VariableSettings;
> - }
> -
> - MtrrLibPreMtrrChange (&MtrrContext);
> - MtrrSetVariableMtrrWorker (VariableSettings);
> - MtrrLibPostMtrrChange (&MtrrContext);
> - MtrrDebugPrintAllMtrrs ();
> -
> - return VariableSettings;
> -}
> -
> /**
> Worker function setting fixed MTRRs
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#62426): https://edk2.groups.io/g/devel/message/62426
Mute This Topic: https://groups.io/mt/75472803/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Eric Dong <eric.dong@intel.com>
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
> Sent: Monday, July 13, 2020 4:13 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Laszlo Ersek <lersek@redhat.com>;
> Kumar, Rahul1 <rahul1.kumar@intel.com>
> Subject: [edk2-devel] [PATCH v2 2/3] UefiCpuPkg/MtrrLib: Remove
> unnecessary API MtrrSetVariableMtrr()
>
> MtrrSetVariableMtrr() sets all the variable MTRR settings.
> But in fact MtrrSetAllMtrrs() is always used by callers to set all
> MTRR settings including the fixed and variable ones.
>
> The patch removes the necessary API MtrrSetVariableMtrr() to simplify
> 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 | 15 --------------
> UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 29 ----------------------------
> 2 files changed, 44 deletions(-)
>
> diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h
> b/UefiCpuPkg/Include/Library/MtrrLib.h
> index cfe3c0ab59..0bc69e235c 100644
> --- a/UefiCpuPkg/Include/Library/MtrrLib.h
> +++ b/UefiCpuPkg/Include/Library/MtrrLib.h
> @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute (
> );
>
>
>
>
>
> -/**
>
> - This function sets variable MTRRs
>
> -
>
> - @param[in] VariableSettings A buffer to hold variable MTRRs content.
>
> -
>
> - @return The pointer of VariableSettings
>
> -
>
> -**/
>
> -MTRR_VARIABLE_SETTINGS*
>
> -EFIAPI
>
> -MtrrSetVariableMtrr (
>
> - IN MTRR_VARIABLE_SETTINGS *VariableSettings
>
> - );
>
> -
>
> -
>
> /**
>
> This function gets the content in fixed MTRRs
>
>
>
> diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> index f4a10edc87..8b54f2c03b 100644
> --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
> @@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker (
> }
>
> }
>
>
>
> -
>
> -/**
>
> - This function sets variable MTRRs
>
> -
>
> - @param[in] VariableSettings A buffer to hold variable MTRRs content.
>
> -
>
> - @return The pointer of VariableSettings
>
> -
>
> -**/
>
> -MTRR_VARIABLE_SETTINGS*
>
> -EFIAPI
>
> -MtrrSetVariableMtrr (
>
> - IN MTRR_VARIABLE_SETTINGS *VariableSettings
>
> - )
>
> -{
>
> - MTRR_CONTEXT MtrrContext;
>
> -
>
> - if (!IsMtrrSupported ()) {
>
> - return VariableSettings;
>
> - }
>
> -
>
> - MtrrLibPreMtrrChange (&MtrrContext);
>
> - MtrrSetVariableMtrrWorker (VariableSettings);
>
> - MtrrLibPostMtrrChange (&MtrrContext);
>
> - MtrrDebugPrintAllMtrrs ();
>
> -
>
> - return VariableSettings;
>
> -}
>
> -
>
> /**
>
> Worker function setting fixed MTRRs
>
>
>
> --
> 2.27.0.windows.1
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
>
> View/Reply Online (#62405): https://edk2.groups.io/g/devel/message/62405
> Mute This Topic: https://groups.io/mt/75472803/1768733
> Group Owner: devel+owner@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [eric.dong@intel.com]
> -=-=-=-=-=-=
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#62468): https://edk2.groups.io/g/devel/message/62468
Mute This Topic: https://groups.io/mt/75472803/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.