[edk2-devel] [Patch] IntelSiliconPkg: FIT based shadow microcode PPI support.

Siyuan, Fu posted 1 patch 32 weeks ago
Failed in applying to current master (apply log)
.../Feature/ShadowMicrocode/ShadowMicrocodePei.c           | 4 ++++
.../Feature/ShadowMicrocode/ShadowMicrocodePei.inf         | 3 +++
Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec          | 7 +++++++
3 files changed, 14 insertions(+)

[edk2-devel] [Patch] IntelSiliconPkg: FIT based shadow microcode PPI support.

Posted by Siyuan, Fu 32 weeks ago
This patch adds a platform PEIM for FIT based shadow microcode PPI
support. A detailed design doc can be found here:
https://edk2.groups.io/g/devel/files/Designs/2020/0214/Support%20
the%202nd%20Microcode%20FV%20Flash%20Region.pdf

TEST: Tested on FIT enabled platform.
BZ: https://tianocore.acgmultimedia.com/show_bug.cgi?id=2449

Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
---
 .../Feature/ShadowMicrocode/ShadowMicrocodePei.c           | 4 ++++
 .../Feature/ShadowMicrocode/ShadowMicrocodePei.inf         | 3 +++
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec          | 7 +++++++
 3 files changed, 14 insertions(+)

diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.c b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.c
index 0ad3eeaa07..f160f59b87 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.c
@@ -248,6 +248,10 @@ ShadowMicrocodePatchByFit (
   UINTN                             TotalSize;
   UINTN                             TotalLoadSize;
 
+  if (!FeaturePcdGet (PcdCpuShadowMicrocodeByFit)) {
+    return EFI_UNSUPPORTED;
+  }
+
   FitPointer = *(UINT64 *) (UINTN) FIT_POINTER_ADDRESS;
   if ((FitPointer == 0) ||
       (FitPointer == 0xFFFFFFFFFFFFFFFF) ||
diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.inf b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.inf
index 27d07ac56c..fecb7c3904 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.inf
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/ShadowMicrocode/ShadowMicrocodePei.inf
@@ -39,5 +39,8 @@
   gEdkiiMicrocodeShadowInfoHobGuid
   gEdkiiMicrocodeStorageTypeFlashGuid
 
+[Pcd]
+  gIntelSiliconPkgTokenSpaceGuid.PcdCpuShadowMicrocodeByFit
+
 [Depex]
   TRUE
diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index 2d8e40f0b8..ad093928b7 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -64,6 +64,13 @@
   # Include/Protocol/PlatformDeviceSecurityPolicy.h
   gEdkiiDeviceSecurityPolicyProtocolGuid = {0x7ea41a99, 0x5e32, 0x4c97, {0x88, 0xc4, 0xd6, 0xe7, 0x46, 0x84, 0x9, 0xd4}}
 
+[PcdsFeatureFlag]
+  ## Indicates if FIT based microcode shadowing will be enabled.<BR><BR>
+  #   TRUE  - FIT base microcode shadowing will be enabled.<BR>
+  #   FALSE - FIT base microcode shadowing will be disabled.<BR>
+  # @Prompt FIT based microcode shadowing.
+  gIntelSiliconPkgTokenSpaceGuid.PcdCpuShadowMicrocodeByFit|FALSE|BOOLEAN|0x00000006
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Error code for VTd error.<BR><BR>
   #  EDKII_ERROR_CODE_VTD_ERROR = (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x02008000<BR>
-- 
2.19.1.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54132): https://edk2.groups.io/g/devel/message/54132
Mute This Topic: https://groups.io/mt/71134364/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-