From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.21193.1594652103904759522 for ; Mon, 13 Jul 2020 07:55:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sm39pihk; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594652103; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QBphJ1jMtLf8SIrBFBATcwkww0VDm7wFR4aTrI9iRSM=; b=Sm39pihkOMUzv6Ej1gTG366pKaxcS7LpTZl3KGT3HKlMb2vRneIiHU/w37Ol9EGjCk+jtY b6vEqOsVu3F0SUUZqqfnO3vVcyoYGnCHQIrW0NIUDzyAjNfIjz/l2x9nBlNHjqnziIegS5 TlIs5frjxmwDeQQ9gRPSrXzIcEfQ7Os= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-ycwBxZs6MX6UUL0qZK2j8g-1; Mon, 13 Jul 2020 10:54:59 -0400 X-MC-Unique: ycwBxZs6MX6UUL0qZK2j8g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 38380100CCE0; Mon, 13 Jul 2020 14:54:58 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-183.ams2.redhat.com [10.36.114.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4842176203; Mon, 13 Jul 2020 14:54:57 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetFixedMtrr() To: devel@edk2.groups.io, ray.ni@intel.com Cc: Eric Dong , Rahul Kumar References: <20200713081236.1284-1-ray.ni@intel.com> <20200713081236.1284-4-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: <4121c7d1-e1b4-31a1-2cf9-b630db9fdf7d@redhat.com> Date: Mon, 13 Jul 2020 16:54:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200713081236.1284-4-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/13/20 10:12, Ni, Ray wrote: > 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 (1) necessary -> unnecessary Reviewed-by: Laszlo Ersek Thanks Laszlo > 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/Library/MtrrLib.h > index 0bc69e235c..9110787067 100644 > --- a/UefiCpuPkg/Include/Library/MtrrLib.h > +++ b/UefiCpuPkg/Include/Library/MtrrLib.h > @@ -200,21 +200,6 @@ MtrrGetFixedMtrr ( > ); > > > -/** > - 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) > > diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > index 8b54f2c03b..ceab7a065f 100644 > --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > @@ -2580,35 +2580,6 @@ MtrrSetFixedMtrrWorker ( > } > > > -/** > - 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) > >