summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/MpInitLib/MpLib.h
diff options
context:
space:
mode:
authorHao A Wu <hao.a.wu@intel.com>2019-12-19 14:33:44 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-01-02 03:10:36 +0000
commitd786a1723203e91c92615c58d217e35b0d894004 (patch)
treeff4cd3da64c27099693db35a5faa67c8d6eb0c1c /UefiCpuPkg/Library/MpInitLib/MpLib.h
parent999463c865d3768a8432a89508096ae6a43873a5 (diff)
downloadedk2-d786a1723203e91c92615c58d217e35b0d894004.tar.gz
UefiCpuPkg/MpInitLib: Reduce the size when loading microcode patches
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2429 This commit will attempt to reduce the copy size when loading the microcode patches data from flash into memory. Such optimization is done by a pre-process of the microcode patch headers (on flash). A microcode patch will be loaded into memory only when the below 3 criteria are met: A. With a microcode patch header (which means the data is not padding data between microcode patches); B. The 'ProcessorSignature' & 'ProcessorFlags' fields in the header match at least one processor within system; C. If the Extended Signature Table exists in a microcode patch, the 'ProcessorSignature' & 'ProcessorFlag' fields in the table entries match at least one processor within system. Criterion B and C will require all the processors to be woken up once to collect their CPUID and Platform ID information. Hence, this commit will move the copy, detect and apply of microcode patch on BSP and APs after all the processors have been woken up. 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: Eric Dong <eric.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'UefiCpuPkg/Library/MpInitLib/MpLib.h')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/MpLib.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h
index 4440dc2701..56b0df664a 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.h
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h
@@ -44,6 +44,20 @@
#define CPU_SWITCH_STATE_LOADED 2
//
+// Default maximum number of entries to store the microcode patches information
+//
+#define DEFAULT_MAX_MICROCODE_PATCH_NUM 8
+
+//
+// Data structure for microcode patch information
+//
+typedef struct {
+ UINTN Address;
+ UINTN Size;
+ UINTN AlignedSize;
+} MICROCODE_PATCH_INFO;
+
+//
// CPU exchange information for switch BSP
//
typedef struct {
@@ -576,6 +590,16 @@ MicrocodeDetect (
);
/**
+ Load the required microcode patches data into memory.
+
+ @param[in, out] CpuMpData The pointer to CPU MP Data structure.
+**/
+VOID
+LoadMicrocodePatch (
+ IN OUT CPU_MP_DATA *CpuMpData
+ );
+
+/**
Detect whether Mwait-monitor feature is supported.
@retval TRUE Mwait-monitor feature is supported.