From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com []) by mx.groups.io with SMTP id smtpd.web10.15038.1594628087047979408 for ; Mon, 13 Jul 2020 01:14:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ray.ni@intel.com) IronPort-SDR: pn4otJUiSWYHNXMSE2FaSL17prhVNl13DuS7VidkQ3wMZSnS5XNjRWrfgSCX64xea64/5gpiTB R5Dlx8wuxoIw== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="148572127" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="148572127" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 01:14:48 -0700 IronPort-SDR: 1aBlJIWFqzJ6QpkMS0EfFiC/3v5YiiEA5KGapQWJ9ItmiDzFlC9Q9yjnA14VoCuyttBmOAJNz5 86iITeLpoa6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="485390646" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 13 Jul 2020 01:14:46 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 01:14:06 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 01:14:06 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.135]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.32]) with mapi id 14.03.0439.000; Mon, 13 Jul 2020 16:14:03 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "Ni, Ray" CC: "Dong, Eric" , Laszlo Ersek , "Kumar, Rahul1" Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Thread-Topic: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Thread-Index: AQHWWOmSI8gU8pJXBkG4+dEe4hZXtqkFKPLA Date: Mon, 13 Jul 2020 08:14:03 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C611B36@SHSMSX104.ccr.corp.intel.com> References: <1621402FE781DC04.13247@groups.io> In-Reply-To: <1621402FE781DC04.13247@groups.io> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please ignore this patch. I will send V2 with updated commit message. > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Monday, July 13, 2020 3:44 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Laszlo Ersek ; > Kumar, Rahul1 > Subject: [edk2-devel] [PATCH] UefiCpuPkg/MtrrLib: Remove unnecessary API > MtrrGetVariableMtrr() >=20 > MtrrGetVariableMtrr() returns all the variable MTRR settings. > But in fact MtrrGetAllMtrrs() is always used by callers to get all MTRR > settings including the fixed and variable ones. >=20 > The patch removes the necessary API MtrrGetVariableMtrr() to simplify > the MtrrLib API. >=20 > There is no code in edk2 and edk2-platforms repo that calls > MtrrGetVariableMtrr(). >=20 > Signed-off-by: Ray Ni > Cc: Eric Dong > Cc: Laszlo Ersek > Cc: Rahul Kumar > --- > UefiCpuPkg/Include/Library/MtrrLib.h | 17 +---------------- > UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 27 +-------------------------- > 2 files changed, 2 insertions(+), 42 deletions(-) >=20 > 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 >=20 > MTRR setting library >=20 >=20 >=20 > - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( > ); >=20 >=20 >=20 >=20 >=20 > -/** >=20 > - This function will get the raw value in variable MTRRs >=20 > - >=20 > - @param[out] VariableSettings A buffer to hold variable MTRRs conten= t. >=20 > - >=20 > - @return The buffer point to MTRR_VARIABLE_SETTINGS in which holds the > content of the variable MTRR >=20 > - >=20 > -**/ >=20 > -MTRR_VARIABLE_SETTINGS* >=20 > -EFIAPI >=20 > -MtrrGetVariableMtrr ( >=20 > - OUT MTRR_VARIABLE_SETTINGS *VariableSettings >=20 > - ); >=20 > - >=20 > - >=20 > /** >=20 > This function sets variable MTRRs >=20 >=20 >=20 > 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 invoke= d by BSP > only, >=20 > except for MtrrSetAllMtrrs() which is used to sync BSP's MTRR settin= g to APs. >=20 >=20 >=20 > - Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker ( > return VariableSettings; >=20 > } >=20 >=20 >=20 > -/** >=20 > - This function will get the raw value in variable MTRRs >=20 > - >=20 > - @param[out] VariableSettings A buffer to hold variable MTRRs conten= t. >=20 > - >=20 > - @return The VariableSettings input pointer >=20 > - >=20 > -**/ >=20 > -MTRR_VARIABLE_SETTINGS* >=20 > -EFIAPI >=20 > -MtrrGetVariableMtrr ( >=20 > - OUT MTRR_VARIABLE_SETTINGS *VariableSettings >=20 > - ) >=20 > -{ >=20 > - if (!IsMtrrSupported ()) { >=20 > - return VariableSettings; >=20 > - } >=20 > - >=20 > - return MtrrGetVariableMtrrWorker ( >=20 > - NULL, >=20 > - GetVariableMtrrCountWorker (), >=20 > - VariableSettings >=20 > - ); >=20 > -} >=20 > - >=20 > /** >=20 > Programs fixed MTRRs registers. >=20 >=20 >=20 > -- > 2.27.0.windows.1 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#62400): https://edk2.groups.io/g/devel/message/62400 > Mute This Topic: https://groups.io/mt/75472582/1712937 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray.ni@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D