]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg: Add definitions for EDKII microcode patch HOB
authorHao A Wu <hao.a.wu@intel.com>
Mon, 23 Dec 2019 02:52:14 +0000 (10:52 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 2 Jan 2020 03:10:36 +0000 (03:10 +0000)
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2430

This commit will add the definitions for EDKII microcode patch HOB.

The intention of adding this HOB is to provide a scheme to store the below
information:

A. The base address and size of the microcode patches that are being
   loaded (from flash) into memory;
B. The information of detected microcode patch for each processor within
   the system.

The producer of the HOB will be the UefiCpuPkg/MpInitLib (where the load,
detect and apply of the microcode happen). The consumer of the HOB can be
modules that want to detect/apply the microcode patch by themselves again
later during the boot flow.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Include/Guid/MicrocodePatchHob.h [new file with mode: 0644]
UefiCpuPkg/UefiCpuPkg.dec

diff --git a/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h b/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h
new file mode 100644 (file)
index 0000000..2d307fb
--- /dev/null
@@ -0,0 +1,44 @@
+/** @file\r
+  The microcode patch HOB is used to store the information of:\r
+    A. Base address and size of the loaded microcode patches data;\r
+    B. Detected microcode patch for each processor within system.\r
+\r
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef _MICROCODE_PATCH_HOB_H_\r
+#define _MICROCODE_PATCH_HOB_H_\r
+\r
+extern EFI_GUID gEdkiiMicrocodePatchHobGuid;\r
+\r
+//\r
+// The EDKII microcode patch HOB will be produced by MpInitLib and it can be\r
+// consumed by modules that want to detect/apply microcode patches.\r
+//\r
+typedef struct {\r
+  //\r
+  // The base address of the microcode patches data after being loaded into\r
+  // memory.\r
+  //\r
+  UINT64    MicrocodePatchAddress;\r
+  //\r
+  // The total size of the loaded microcode patches.\r
+  //\r
+  UINT64    MicrocodePatchRegionSize;\r
+  //\r
+  // The number of processors within the system.\r
+  //\r
+  UINT32    ProcessorCount;\r
+  //\r
+  // An array with 'ProcessorCount' elements that stores the offset (with\r
+  // regard to 'MicrocodePatchAddress') of the detected microcode patch\r
+  // (including the CPU_MICROCODE_HEADER data structure) for each processor.\r
+  // If no microcode patch is detected for certain processor, the relating\r
+  // element will be set to MAX_UINT64.\r
+  //\r
+  UINT64    ProcessorSpecificPatchOffset[0];\r
+} EDKII_MICROCODE_PATCH_HOB;\r
+\r
+#endif\r
index 797f94863157ecfd214f0212d3a0c6a13b47d9bc..45b267ac61d5cf713f9dc2a09fb3a765ff2861e3 100644 (file)
@@ -63,6 +63,9 @@
   ## Include/Guid/CpuFeaturesInitDone.h\r
   gEdkiiCpuFeaturesInitDoneGuid  = { 0xc77c3a41, 0x61ab, 0x4143, { 0x98, 0x3e, 0x33, 0x39, 0x28, 0x6, 0x28, 0xe5 }}\r
 \r
+  ## Include/Guid/MicrocodePatchHob.h\r
+  gEdkiiMicrocodePatchHobGuid    = { 0xd178f11d, 0x8716, 0x418e, { 0xa1, 0x31, 0x96, 0x7d, 0x2a, 0xc4, 0x28, 0x43 }}\r
+\r
 [Protocols]\r
   ## Include/Protocol/SmmCpuService.h\r
   gEfiSmmCpuServiceProtocolGuid  = { 0x1d202cab, 0xc8ab, 0x4d5c, { 0x94, 0xf7, 0x3c, 0xfc, 0xc0, 0xd3, 0xd3, 0x35 }}\r