From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.21247.1594652009419195098 for ; Mon, 13 Jul 2020 07:53:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GqMYUR1A; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594652008; 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=HKx/ExHwoP7K86HecchtmI+SgJgjCO1zeR5xehcsnzA=; b=GqMYUR1A7AVLxRVOf6dkDIDZ3vvDfuSdoZTNNxYOoOpCXFg6OIz5XbpyzJnCv2MZY9XmqV dfM6z//dUO5v8L+8unH3g2N8d81WuSBBab3+FktSCwbtIK9T9138GkwddZ06dCHyrEaYFj v+5s5FzeUdfohPikRgT5pt9FmaNjc9w= 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-444-rq7vaAfvNsSC4XBuAtdG8g-1; Mon, 13 Jul 2020 10:53:24 -0400 X-MC-Unique: rq7vaAfvNsSC4XBuAtdG8g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6BCF8BE1A3; Mon, 13 Jul 2020 14:53:23 +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 5208661462; Mon, 13 Jul 2020 14:53:21 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 1/3] UefiCpuPkg/MtrrLib: Remove unnecessary API MtrrGetVariableMtrr() To: devel@edk2.groups.io, ray.ni@intel.com Cc: Eric Dong , Rahul Kumar References: <20200713081236.1284-1-ray.ni@intel.com> <20200713081236.1284-2-ray.ni@intel.com> From: "Laszlo Ersek" Message-ID: <8b898913-2f93-91ed-633f-49949da88a83@redhat.com> Date: Mon, 13 Jul 2020 16:53:21 +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-2-ray.ni@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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: > 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 (1) I think we should replace "necessary" with "unnecessary" in the commit message. with that fixed: Reviewed-by: Laszlo Ersek > 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 | 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/Library/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 > > - 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 > > **/ > @@ -185,21 +185,6 @@ MtrrGetMemoryAttribute ( > ); > > > -/** > - 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 content of the variable MTRR > - > -**/ > -MTRR_VARIABLE_SETTINGS* > -EFIAPI > -MtrrGetVariableMtrr ( > - OUT MTRR_VARIABLE_SETTINGS *VariableSettings > - ); > - > - > /** > This function sets variable MTRRs > > diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/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. > > - 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 > > **/ > @@ -456,31 +456,6 @@ MtrrGetVariableMtrrWorker ( > return VariableSettings; > } > > -/** > - 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. > >