]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/MtrrLib: Fix MtrrDebugPrintAllMtrrsWorker to avoid hang
authorRuiyu Ni <ruiyu.ni@intel.com>
Tue, 17 Oct 2017 01:46:27 +0000 (09:46 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Tue, 17 Oct 2017 02:05:36 +0000 (10:05 +0800)
commit1c29d03869355a5e9dfafb88332c139d8c5c2215
tree0cf8e424d61f4c0305218d677c70907d18d7fa7e
parente2ac374f85a1a1b8a3ecd04699a68e6dcddd5d24
UefiCpuPkg/MtrrLib: Fix MtrrDebugPrintAllMtrrsWorker to avoid hang

ARRAY_SIZE(Mtrrs->Variables.Mtrr) was used in
MtrrDebugPrintAllMtrrsWorker() to parse the MTRR registers.
Instead, the actual variable MTRR count should be used.
Otherwise, the uninitialized random data in MtrrSetting may cause
MtrrLibSetMemoryType() hang.

Steven Shi found this bug in QEMU when using Q35 chip.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Steven Shi <steven.shi@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
UefiCpuPkg/Library/MtrrLib/MtrrLib.c