]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg: Remove alignment check when calculate microcode size.
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / Microcode.c
index 3da5bfb9cf2f9a4a4293a0967b80323e6480474c..a9d06dd4099a81b1f0e557cec1cacab884c6e8b5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of loading microcode on processors.\r
 \r
-  Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -397,16 +397,7 @@ LoadMicrocodePatchWorker (
       Patches[Index].Size\r
       );\r
 \r
-    //\r
-    // Zero-fill the padding area\r
-    // Please note that AlignedSize will be no less than Size\r
-    //\r
-    ZeroMem (\r
-      Walker + Patches[Index].Size,\r
-      Patches[Index].AlignedSize - Patches[Index].Size\r
-      );\r
-\r
-    Walker += Patches[Index].AlignedSize;\r
+    Walker += Patches[Index].Size;\r
   }\r
 \r
   //\r
@@ -578,14 +569,9 @@ LoadMicrocodePatch (
       //\r
       // Store the information of this microcode patch\r
       //\r
-      if (TotalSize > ALIGN_VALUE (TotalSize, SIZE_1KB) ||\r
-          ALIGN_VALUE (TotalSize, SIZE_1KB) > MAX_UINTN - TotalLoadSize) {\r
-        goto OnExit;\r
-      }\r
-      PatchInfoBuffer[PatchCount - 1].Address     = (UINTN) MicrocodeEntryPoint;\r
-      PatchInfoBuffer[PatchCount - 1].Size        = TotalSize;\r
-      PatchInfoBuffer[PatchCount - 1].AlignedSize = ALIGN_VALUE (TotalSize, SIZE_1KB);\r
-      TotalLoadSize += PatchInfoBuffer[PatchCount - 1].AlignedSize;\r
+      PatchInfoBuffer[PatchCount - 1].Address = (UINTN) MicrocodeEntryPoint;\r
+      PatchInfoBuffer[PatchCount - 1].Size    = TotalSize;\r
+      TotalLoadSize += TotalSize;\r
     }\r
 \r
     //\r