From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.groups.io with SMTP id smtpd.web12.36056.1613417038919130550 for ; Mon, 15 Feb 2021 11:23:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XNFnvboa; spf=pass (domain: redhat.com, ip: 63.128.21.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613417038; 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=XLXz/P1Q5joNQITdDbzbCIF4Oo6mNm6/ckIdIyArrRI=; b=XNFnvboaHH2FtonOSePBW3ueD+6e6h0feiVJbiFShvJWFjGGXFM0P2iK7zP1WONuK1rked zS/GTTuLtrAd2CahyNQsJUxqjnNGrYE7ig9fcYPQtvBJLV19FrjV9Uaqlh+rpl8hV+/hGy smsYaEUaGFQVLrThXRhVY8DUztvf58g= 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-362-KGRM3mCgOPuxeK-pYhThlw-1; Mon, 15 Feb 2021 14:23:56 -0500 X-MC-Unique: KGRM3mCgOPuxeK-pYhThlw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B92468710EC; Mon, 15 Feb 2021 19:23:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-65.ams2.redhat.com [10.36.112.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 509ED62679; Mon, 15 Feb 2021 19:23:53 +0000 (UTC) Subject: Re: [PATCH v2 1/4] UefiCpuPkg/SmmCpuFeaturesLib: Move multi-instance function decl to header To: mikuback@linux.microsoft.com, devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Rahul Kumar References: <20210213005806.2927-1-mikuback@linux.microsoft.com> <20210213005806.2927-2-mikuback@linux.microsoft.com> From: "Laszlo Ersek" Message-ID: <9f609960-01cc-a3a9-40c7-2da99e8c809e@redhat.com> Date: Mon, 15 Feb 2021 20:23:52 +0100 MIME-Version: 1.0 In-Reply-To: <20210213005806.2927-2-mikuback@linux.microsoft.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 02/13/21 01:58, mikuback@linux.microsoft.com wrote: > From: Michael Kubacki > > FinishSmmCpuFeaturesInitializeProcessor() is a multi-instance > internal library function that is currently not declared in a > header file but embedded in "SmmCpuFeaturesLib.c". > > This change cleans up the declaration moving it to a new header > file "CpuFeaturesLib.h" and removing the local declaration in > "SmmCpuFeaturesLib.c". > > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Signed-off-by: Michael Kubacki > --- > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 11 +--------- > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c | 1 + > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c | 1 + > UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h | 22 ++++++++++++++++++++ > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 1 + > UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf | 1 + > 6 files changed, 27 insertions(+), 10 deletions(-) > > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c > index 8fed18cf0e17..75bde752785a 100644 > --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c > @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > #include > #include > +#include "CpuFeaturesLib.h" > > // > // Machine Specific Registers (MSRs) > @@ -35,16 +36,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #define SMM_FEATURES_LIB_IA32_MCA_CAP 0x17D > #define SMM_CODE_ACCESS_CHK_BIT BIT58 > > -/** > - Internal worker function that is called to complete CPU initialization at the > - end of SmmCpuFeaturesInitializeProcessor(). > - > -**/ > -VOID > -FinishSmmCpuFeaturesInitializeProcessor ( > - VOID > - ); > - > // > // Set default value to assume SMRR is not supported > // > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c > index 3e63c5e27f98..c562582ccee0 100644 > --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c > @@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #include > #include > +#include "CpuFeaturesLib.h" > > /** > Internal worker function that is called to complete CPU initialization at the > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c > index f7f8afacffb5..b5aad41fdb64 100644 > --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c > @@ -21,6 +21,7 @@ > > #include > > +#include "CpuFeaturesLib.h" > #include "SmmStm.h" > > #define TXT_EVTYPE_BASE 0x400 > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h b/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h > new file mode 100644 > index 000000000000..4645bbb066c9 > --- /dev/null > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h > @@ -0,0 +1,22 @@ > +/** @file > + Internal library function definitions. > + > + Copyright (c) Microsoft Corporation. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef _CPU_FEATURES_LIB_H_ > +#define _CPU_FEATURES_LIB_H_ > + > +/** > + Internal worker function that is called to complete CPU initialization at the > + end of SmmCpuFeaturesInitializeProcessor(). > + > +**/ > +VOID > +FinishSmmCpuFeaturesInitializeProcessor ( > + VOID > + ); > + > +#endif > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf > index dd828baf69cb..a6d8467d26aa 100644 > --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf > @@ -17,6 +17,7 @@ [Defines] > CONSTRUCTOR = SmmCpuFeaturesLibConstructor > > [Sources] > + CpuFeaturesLib.h > SmmCpuFeaturesLib.c > SmmCpuFeaturesLibNoStm.c > > diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf > index 50b9cc871302..89cd252ef44e 100644 > --- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf > +++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf > @@ -18,6 +18,7 @@ [Defines] > CONSTRUCTOR = SmmCpuFeaturesLibStmConstructor > > [Sources] > + CpuFeaturesLib.h > SmmCpuFeaturesLib.c > SmmStm.c > SmmStm.h > Reviewed-by: Laszlo Ersek