From nobody Mon Feb 9 15:09:31 2026 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-