From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com []) by mx.groups.io with SMTP id smtpd.web11.14795.1594628015690258850 for ; Mon, 13 Jul 2020 01:13:37 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: ray.ni@intel.com) IronPort-SDR: L9/BX64oL7KjOCVPX63iGtrmKMCEv1C+9kfEOzFRIEaVMgKCvjY7hPt1eFF+QJE8/cPDNMCKU1 03a2l7XlFIKg== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136743948" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136743948" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 01:13:37 -0700 IronPort-SDR: OwUGwrApzYlRW5/tPuGobTqXyr/drIwCSUwXWE2sQHG/gJzMrwZ3fRHgY3tNCOmuBr8fzoMNoy 7NG26GzA2CzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="307374214" Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by fmsmga004.fm.intel.com with ESMTP; 13 Jul 2020 01:13:35 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [PATCH v2 2/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetVariableMtrr() Date: Mon, 13 Jul 2020 16:12:35 +0800 Message-Id: <20200713081236.1284-3-ray.ni@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20200713081236.1284-1-ray.ni@intel.com> References: <20200713081236.1284-1-ray.ni@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Cc: Eric Dong Cc: Laszlo Ersek Cc: Rahul Kumar --- 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/Libr= ary/MtrrLib.h index cfe3c0ab59..0bc69e235c 100644 --- a/UefiCpuPkg/Include/Library/MtrrLib.h +++ b/UefiCpuPkg/Include/Library/MtrrLib.h @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( );=0D =0D =0D -/**=0D - This function sets variable MTRRs=0D -=0D - @param[in] VariableSettings A buffer to hold variable MTRRs content.= =0D -=0D - @return The pointer of VariableSettings=0D -=0D -**/=0D -MTRR_VARIABLE_SETTINGS*=0D -EFIAPI=0D -MtrrSetVariableMtrr (=0D - IN MTRR_VARIABLE_SETTINGS *VariableSettings=0D - );=0D -=0D -=0D /**=0D This function gets the content in fixed MTRRs=0D =0D diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/Mtrr= Lib/MtrrLib.c index f4a10edc87..8b54f2c03b 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker ( }=0D }=0D =0D -=0D -/**=0D - This function sets variable MTRRs=0D -=0D - @param[in] VariableSettings A buffer to hold variable MTRRs content.= =0D -=0D - @return The pointer of VariableSettings=0D -=0D -**/=0D -MTRR_VARIABLE_SETTINGS*=0D -EFIAPI=0D -MtrrSetVariableMtrr (=0D - IN MTRR_VARIABLE_SETTINGS *VariableSettings=0D - )=0D -{=0D - MTRR_CONTEXT MtrrContext;=0D -=0D - if (!IsMtrrSupported ()) {=0D - return VariableSettings;=0D - }=0D -=0D - MtrrLibPreMtrrChange (&MtrrContext);=0D - MtrrSetVariableMtrrWorker (VariableSettings);=0D - MtrrLibPostMtrrChange (&MtrrContext);=0D - MtrrDebugPrintAllMtrrs ();=0D -=0D - return VariableSettings;=0D -}=0D -=0D /**=0D Worker function setting fixed MTRRs=0D =0D --=20 2.27.0.windows.1