summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/build/build.py
diff options
context:
space:
mode:
authorHao A Wu <hao.a.wu@intel.com>2020-01-17 12:44:59 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-01-19 04:10:43 +0000
commit18fcb3759888ef2415a9fefe1fffb7f8b9b9211d (patch)
treeb77aab4a492405d227fd74c1b6aff620f26a6e9d /BaseTools/Source/Python/build/build.py
parent2ed845b3c3cd4dd9f4b0b3cf259ad5f92e28cb6c (diff)
downloadedk2-18fcb3759888ef2415a9fefe1fffb7f8b9b9211d.tar.gz
edk2-18fcb3759888ef2415a9fefe1fffb7f8b9b9211d.tar.bz2
edk2-18fcb3759888ef2415a9fefe1fffb7f8b9b9211d.zip
UefiCpuPkg/MpInitLib: Fix possible uninitialized 'InitFlag' field
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2474 Previous commit d786a17232: UefiCpuPkg/MpInitLib: Reduce the size when loading microcode patches Removed the below assignments for the 'InitFlag' field of CPU_MP_DATA structure in function MpInitLibInitialize() when APs are waken up to do some initialize sync: CpuMpData->InitFlag = ApInitReconfig; ... CpuMpData->InitFlag = ApInitDone; The above commit mistakenly assumed the 'InitFlag' field will have a value of 'ApInitDone' when the APs have been successfully waken up before. And since there is no explicit comparision for the 'InitFlag' field with the 'ApInitReconfig' value. The commit removed those assignments. However, under some cases (e.g. when variable OldCpuMpData is not NULL, which means function CollectProcessorCount() will not be called), removing the above assignments will left the 'InitFlag' field being uninitialized with a value of 0, which is a invalid value for the type of 'InitFlag' (AP_INIT_STATE). It may potentially cause the WakeUpAP() function to run some unnecessary codes when the APs have been successfully waken up before: if (CpuMpData->WakeUpByInitSipiSipi || CpuMpData->InitFlag != ApInitDone) { ResetVectorRequired = TRUE; AllocateResetVector (CpuMpData); FillExchangeInfoData (CpuMpData); SaveLocalApicTimerSetting (CpuMpData); } This commit will address the above-mentioned issue. Test done: * OS boot on a real platform with multi processors Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.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> Acked-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'BaseTools/Source/Python/build/build.py')
0 files changed, 0 insertions, 0 deletions