]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg: Remove alignment check when calculate microcode size.
authorSiyuan Fu <siyuan.fu@intel.com>
Fri, 3 Jan 2020 07:11:51 +0000 (15:11 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 8 Jan 2020 00:47:43 +0000 (00:47 +0000)
commit08a475df10b75f84cdeb9b11e38f8eee9b5c048d
treeeb015ab0633acc483d0e81ced8563af4ee2a3564
parent70911f1f4aee0366b6122f2b90d367ec0f066beb
UefiCpuPkg: Remove alignment check when calculate microcode size.

This patch removes the unnecessary alignment check on microcode patch
TotalSize introduced by commit d786a172. The TotalSize has already been
checked with 1K alignment and MAX_ADDRESS in previous code as below:

    if ( (UINTN)MicrocodeEntryPoint > (MAX_ADDRESS - TotalSize) ||
         ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd ||
         (DataSize & 0x3) != 0 ||
         (TotalSize & (SIZE_1KB - 1)) != 0 ||
         TotalSize < DataSize
       ) {

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Siyuan Fu <siyuan.fu@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/MpInitLib/Microcode.c
UefiCpuPkg/Library/MpInitLib/MpLib.h