From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.615.1613597590951761219 for ; Wed, 17 Feb 2021 13:33:11 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=O9fYLiHn; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [131.107.174.202]) by linux.microsoft.com (Postfix) with ESMTPSA id 54BBD20B6C40; Wed, 17 Feb 2021 13:33:10 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 54BBD20B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1613597590; bh=z1oA4PwdywB38myw1isUMJv3yxZrrU72re5kfhEzhRQ=; h=From:To:Cc:Subject:Date:From; b=O9fYLiHnFT67UTefe6Akk5NpaRYVWe9lfZB8y5VKG/8CoWJrTkgMH0Ljyer6hz+jK 5O1tDzTszhH8gI8JJqQPQTGE4Hz7L/z812w9dsPwCuvJn95/WIkFTbpXUh0Nsu7nYN eRtRNL0gU/xyNJoCfKPRL1Mn7z+FgJnRM0ujEmto= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek , Rahul Kumar Subject: [PATCH v3 0/5] UefiCpuPkg/StandaloneMmCpuFeaturesLib: Add Standalone MM support Date: Wed, 17 Feb 2021 13:32:22 -0800 Message-Id: <20210217213227.1277-1-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3218 The present SmmCpuFeaturesLib implementation in UefiCpuPkg can be useful for IA32/X64 platforms that need a library instance for a Standalone MM environment. Much of the logic can be reused and a new INF can isolate the differences unique to Standalone MM. This patch series contains an initial set of changes for cleaning up pre-existing design issues in the library. The final two patches contain changes needed for Standalone MM support. Here's an overview of how the three library instances are organized that may be a useful reference (provided by Laszlo): Traditional, Traditional, Standalone, no STM STM no STM Entry point type DXE DXE MM Lib inst. init. basic STM basic Processor init. basic STM basic PCD access any any fixed * Traditional no STM =3D SmmCpuFeaturesLib.inf * Traditional STM =3D SmmCpuFeaturesLibStm.inf * Standalone no STM =3D StandaloneMmCpuFeaturesLib.inf V3 changes: PATCH v3 2/5 is a new patch in the series that renames the file SmmCpuFeaturesLib.c to SmmCpuFeaturesLibCommon.c to more clearly identify implementation in the file as shared between all library instances. PATCH v3 3/5 adds a new source file SmmCpuFeaturesLib.c that contains the constructor specific to the Traditional MM no STM library instance. This was previously implemented in a file built by the Standalone MM instance and while not harmful, it was not clean. PATCH v3 4/5 updates "@retval" to "@return" in the documentation for GetCpuMaxLogicalProcessorNumber() since it is not a constant return value. =20 PATCH v3 5/5 contains a commit message update to note that all instances of "PiSmm.h" in the library source files have been updated to "PiMm.h" for consistency throughout the library. V2 changes: Due to some pre-existing design issues in the library that affected a single v1 patch that add Standalone MM support, it was suggested to first address those issues and then add the new INF StandaloneMmCpuFeaturesLib.inf. To address these concerns, the following v1 patch was converted into a v2 patch series: https://edk2.groups.io/g/devel/message/71626 The first two patches in v2 primarily addressed those concerns. PATCH v2 1/4 and PATCH v2 2/4 focused on fixing pre-existing design issues. PATCH v2 3/4 and PATCH v2 4/4 focused on the changes needed to add Standalone MM support. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Michael Kubacki Michael Kubacki (5): UefiCpuPkg/SmmCpuFeaturesLib: Move multi-instance function decl to header UefiCpuPkg/SmmCpuFeaturesLib: Rename SmmCpuFeaturesLib.c UefiCpuPkg/SmmCpuFeaturesLib: Cleanup library constructors UefiCpuPkg/SmmCpuFeaturesLib: Abstract PcdCpuMaxLogicalProcessorNumber UefiCpuPkg/SmmCpuFeaturesLib: Add Standalone MM support UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmmStmSupport.c = | 2 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c = | 608 +------------------- UefiCpuPkg/Library/SmmCpuFeaturesLib/{SmmCpuFeaturesLib.c =3D> SmmCpuFea= turesLibCommon.c} | 36 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c = | 3 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c = | 26 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.c = | 50 ++ UefiCpuPkg/Library/SmmCpuFeaturesLib/TraditionalMmCpuFeaturesLib.c = | 28 + UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmmStmSupport.c = | 2 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h = | 48 ++ UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf = | 3 + UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf = | 4 +- UefiCpuPkg/Library/SmmCpuFeaturesLib/{SmmCpuFeaturesLib.inf =3D> Standal= oneMmCpuFeaturesLib.inf} | 22 +- UefiCpuPkg/UefiCpuPkg.dsc = | 1 + 13 files changed, 172 insertions(+), 661 deletions(-) copy UefiCpuPkg/Library/SmmCpuFeaturesLib/{SmmCpuFeaturesLib.c =3D> SmmC= puFeaturesLibCommon.c} (93%) create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuF= eaturesLib.c create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/TraditionalMmCpu= FeaturesLib.c create mode 100644 UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h copy UefiCpuPkg/Library/SmmCpuFeaturesLib/{SmmCpuFeaturesLib.inf =3D> St= andaloneMmCpuFeaturesLib.inf} (53%) --=20 2.28.0.windows.1