From nobody Tue May 7 11:52:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62404+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62404+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594628017; cv=none; d=zohomail.com; s=zohoarc; b=Cp+xWW5z+6dWilg1b6p2QgNc5LeLYSNZNVpSAVSP87fvFGc1mS0vhQgFmnff8Bta9IDZtnE6cFvP67cN9t/KhBE2mhPMfy+MyLcDM0mbgwwZwna7QuN1fak/cZZ+XVjUJ7wrtJBtWSrnvonf16gwkt+IXzW6a3u19FZhTEjP2FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594628017; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=CzYdutchA8ZG9YTs/kkOKz2BHiKOecM0hbbwzIOLpXY=; b=WrPh1HYebPjrYbX+q4sQxSFtUL/AfEJ6WVLWspYfn0CotkJ5ttdHt0AwiKjHx1AIEgvcfvAVr86Yp4ZZ/oIMtaV/XWgRj+tO7aab20hW+KP7retFd9SXZPrZo6iAq57KIlN8eiBGDfHP8+dr+c9g42d3Xl/lKbZZ4mlwZXMwz4g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62404+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594628017853744.887819212729; Mon, 13 Jul 2020 01:13:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id VHoaYY1788612xzOs5zwOmW6; Mon, 13 Jul 2020 01:13:37 -0700 X-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:36 -0700 IronPort-SDR: vp80YILG0ywmFPLPQ3gB00QRWMgD5P1puqJtDnribJEvDB98I4u3dqxNU0JcZkBQ7j/LjKUZ0B oHON8q8GjozQ== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136743947" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136743947" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-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:36 -0700 IronPort-SDR: yuNA+JLKBain/7JdvRP1d6nCQxbSn5OD/kc2gzChay5bPqUQpClwHelhZ5530FZTd7Yb4RikbQ hIQteQx3UZow== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="307374204" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by fmsmga004.fm.intel.com with ESMTP; 13 Jul 2020 01:13:33 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [edk2-devel] [PATCH v2 1/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() Date: Mon, 13 Jul 2020 16:12:34 +0800 Message-Id: <20200713081236.1284-2-ray.ni@intel.com> In-Reply-To: <20200713081236.1284-1-ray.ni@intel.com> References: <20200713081236.1284-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: hBzuSNzKtOnn6w1Fo8Gt0P2Jx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594628017; bh=aXSx1TkWj/kSPR4i4yL3X9kc468V7sZdkodb/tVfUGo=; h=Cc:Date:From:Reply-To:Subject:To; b=DonD9HBSif26YeSNK/l4CgC3yPMTq+R2MFV9WIb8YGGH3QZx+dFoXyxuuDu4GPDMR4O 50HAm7B2UlS6KQhvPYJYeEJxUTcd5hYShL/moNqv4Pr10SN2WjxBid4SPF4FUbhXmPCvc mTmVI4pHqTwHCV0j1iKhWzpBrHVK8GOcgRs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 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 Reviewed-by: Eric Dong Reviewed-by: Laszlo Ersek --- 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/Libr= ary/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 =20 - Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( ); =20 =20 -/** - 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 co= ntent of the variable MTRR - -**/ -MTRR_VARIABLE_SETTINGS* -EFIAPI -MtrrGetVariableMtrr ( - OUT MTRR_VARIABLE_SETTINGS *VariableSettings - ); - - /** This function sets variable MTRRs =20 diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/Mtrr= Lib/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. =20 - Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker ( return VariableSettings; } =20 -/** - 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. =20 --=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62404): https://edk2.groups.io/g/devel/message/62404 Mute This Topic: https://groups.io/mt/75472802/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 11:52:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62405+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62405+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594628018; cv=none; d=zohomail.com; s=zohoarc; b=Pn/aiB5AD5s57i56AjGSI1nQVMETXFD6ckR61mOVXWyLKA8iLtHqeyUEHckjlcDYUjBCSjvtUNTbk+2n2SdRyTAtzmXG+GC1YgvEejxuvzBOJ07N134XF33UQnAvDHr+f8tUi3IBGZAh3m34B626rBNBhGcTSYyYwT6lPmRvQko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594628018; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=iqhlibFy0ZrtW/d43mUcswyxOsn7oQGM7mZg0kfb870=; b=RFU7fFIDYSPBJu7NnOncb1EEawAgWsK5kFO48/IhLCgJZaPxXLz01374y9ZWN8NjJUS6vxYyg2oEWJteeXrRJctBRrs0f3arG8a6HLziPZRqDtTeeey7F2G274cVKKf2CFo3OLMeVgDowHcLDP/suPf7gBA+DVj9gcgRjWyK+1Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62405+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15946280187291022.4059444665053; Mon, 13 Jul 2020 01:13:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nvuoYY1788612x9Naf9tIHqS; Mon, 13 Jul 2020 01:13:38 -0700 X-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 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 X-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" X-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: [edk2-devel] [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> In-Reply-To: <20200713081236.1284-1-ray.ni@intel.com> References: <20200713081236.1284-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: pKF5A4cZUOVqDk9O90dScV49x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594628018; bh=pRYLiNzp5DgkB6xBB6irNt7aWUNeRg64NOHa4ksZ2PA=; h=Cc:Date:From:Reply-To:Subject:To; b=D+XHQqSoSZLkl8atgPEiDTlXBDX6JS16xOUmzknoWzikUBp8n3VD7M031Zqxq9LdmxD tQEsJx70sV8vlRW9pr8MjmvGb7SyBZi8X3wToRlzl9fac5qZNO2Oa5Vmy0aNZDhPXAYpD k9TrwXRrtac3q7aog+XXsiW6EMB4KDopA5E= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Eric Dong Reviewed-by: Laszlo Ersek --- 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 ( ); =20 =20 -/** - 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 =20 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 ( } } =20 - -/** - 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 =20 --=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue May 7 11:52:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62406+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62406+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594628019; cv=none; d=zohomail.com; s=zohoarc; b=QfPOPc9i89cmGTyQzViQLHBw2I7MEnUAVEhl/boZ0XjS52ACtviGCUU9N8FzNdzI4O4e6y3oAjPSgAFh0a4efq6p4Jqt6Z8uyfnTVjqGox/EzTBySnS4bL2aK+IqdLee1YIJ5GnQPEBxk0mz4d7lNKZFy7P9aumE4RwwDlFJmDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594628019; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=c2T7cK8c48GgUNYXGKcw9KZ9nKGnS7meWLEQ0PxUy1w=; b=GrD6u0MuPmXVeDCR3ZoMloxAip2oZAUrJWqEEOUS9Clf7m9JtboV1PypUZZcqI9ZNUHK34mWMvcIdE8ZNP+VXZHznbOYQAbnayFVKEfXQVJOUaRGK/MuoX4y18Y6zoTIX94lZwMl37ax1fa18IaOIP664Jjx1DY0NJ2LKk3rAVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62406+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594628019719876.3452942077186; Mon, 13 Jul 2020 01:13:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id WfdJYY1788612xydH1jUjoCj; Mon, 13 Jul 2020 01:13:39 -0700 X-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:38 -0700 IronPort-SDR: gkt0gHNvASg1Zonlddo2T//US3DYjEeqvy4+e2+etVa0fNiikWAwiGj+erqzsjdA8GzDS7VKJe dIho+Kav/4wA== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="136743957" X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="136743957" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-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:38 -0700 IronPort-SDR: fPEfaovv5DENVNMf7QCmcsb/UTl2XZTf5tUXPltT6qdeXAJliouNG+PIkakdxYWmLR89sMm4QP P02yQB9LqqWw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,346,1589266800"; d="scan'208";a="307374222" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.87]) by fmsmga004.fm.intel.com with ESMTP; 13 Jul 2020 01:13:36 -0700 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetFixedMtrr() Date: Mon, 13 Jul 2020 16:12:36 +0800 Message-Id: <20200713081236.1284-4-ray.ni@intel.com> In-Reply-To: <20200713081236.1284-1-ray.ni@intel.com> References: <20200713081236.1284-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com X-Gm-Message-State: zt3DWDxDhIeWe7pWO8PE3cOsx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594628019; bh=g6iT/124zeCsYj9WzcbUTlp2XiMIbRgTmMer/3nKc0o=; h=Cc:Date:From:Reply-To:Subject:To; b=czOPZjgQlZJwdcEgfpCPRJCwCLYeboKdPS5BmIv1WLPMxv2zG9NxynTCbmgtsOWCXRy d1WDF9BL7z27HiZSS0FiI1Xi0aYFh1g+3R8GeY1kps44lAnw9MhfIrd5ICQi+9fp0ys9Y S9EC7f3Inm59VBJWLSa94Fp4u6Okb58DI74= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" MtrrSetFixedMtrr() sets all the fixed 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 MtrrSetFixedMtrr() 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 Reviewed-by: Eric Dong Reviewed-by: Laszlo Ersek --- 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 0bc69e235c..9110787067 100644 --- a/UefiCpuPkg/Include/Library/MtrrLib.h +++ b/UefiCpuPkg/Include/Library/MtrrLib.h @@ -200,21 +200,6 @@ MtrrGetFixedMtrr ( ); =20 =20 -/** - This function sets fixed MTRRs - - @param[in] FixedSettings A buffer holding fixed MTRRs content. - - @return The pointer of FixedSettings - -**/ -MTRR_FIXED_SETTINGS* -EFIAPI -MtrrSetFixedMtrr ( - IN MTRR_FIXED_SETTINGS *FixedSettings - ); - - /** This function gets the content in all MTRRs (variable and fixed) =20 diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/Mtrr= Lib/MtrrLib.c index 8b54f2c03b..ceab7a065f 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -2580,35 +2580,6 @@ MtrrSetFixedMtrrWorker ( } =20 =20 -/** - This function sets fixed MTRRs - - @param[in] FixedSettings A buffer to hold fixed MTRRs content. - - @retval The pointer of FixedSettings - -**/ -MTRR_FIXED_SETTINGS* -EFIAPI -MtrrSetFixedMtrr ( - IN MTRR_FIXED_SETTINGS *FixedSettings - ) -{ - MTRR_CONTEXT MtrrContext; - - if (!IsMtrrSupported ()) { - return FixedSettings; - } - - MtrrLibPreMtrrChange (&MtrrContext); - MtrrSetFixedMtrrWorker (FixedSettings); - MtrrLibPostMtrrChange (&MtrrContext); - MtrrDebugPrintAllMtrrs (); - - return FixedSettings; -} - - /** This function gets the content in all MTRRs (variable and fixed) =20 --=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62406): https://edk2.groups.io/g/devel/message/62406 Mute This Topic: https://groups.io/mt/75472804/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-