From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.21272.1594652065168043736 for ; Mon, 13 Jul 2020 07:54:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ha4biPtV; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594652064; 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=KpYrK+Hn82GXl4ZpUCWqGoFcY3AZr0P3vnsYi2s9PNI=; b=ha4biPtVp231rr6rlM7B0LN9nP87e8Tv1BgAb4uvvifKDNg8e9lswQfvDfqHpEBO8Qj0l/ f4lqurj34PAfiMQI4y0Xymf8hnDDOldaVlSAnWNqvhFJko4JbOtmbny/tPfogBT4p3sTUU HTERA51L/91Veq63Jt2ZZhBEmdPXkjY= 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-168-mIpvV5p9NHa7Xlq2lTjcNg-1; Mon, 13 Jul 2020 10:54:22 -0400 X-MC-Unique: mIpvV5p9NHa7Xlq2lTjcNg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 100D7801E6A; Mon, 13 Jul 2020 14:54:14 +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 0CF6078A52; Mon, 13 Jul 2020 14:54:12 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 2/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrSetVariableMtrr() To: devel@edk2.groups.io, ray.ni@intel.com Cc: Eric Dong , Rahul Kumar References: <20200713081236.1284-1-ray.ni@intel.com> <20200713081236.1284-3-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: Date: Mon, 13 Jul 2020 16:54:12 +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-3-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: > 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 (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 cfe3c0ab59..0bc69e235c 100644 > --- a/UefiCpuPkg/Include/Library/MtrrLib.h > +++ b/UefiCpuPkg/Include/Library/MtrrLib.h > @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( > ); > > > -/** > - 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 > > diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > index f4a10edc87..8b54f2c03b 100644 > --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c > @@ -2558,35 +2558,6 @@ MtrrSetVariableMtrrWorker ( > } > } > > - > -/** > - 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 > >