]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c
UefiCpuPkg: Cpu feature data stored in memory may be migrated
authorLou, Yun <Yun.Lou@intel.com>
Thu, 30 Sep 2021 06:26:24 +0000 (14:26 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 20 Oct 2021 06:43:42 +0000 (06:43 +0000)
commit37a33f02aa1ab89f392da7d06ec3578fda1b6182
treee66023ad92a9f05a134ddc441de8d8c2a1341838
parent90246a6d9f6fda3536d042d02867123caabe3aaa
UefiCpuPkg: Cpu feature data stored in memory may be migrated

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3634

The memory allocated through "PeiAllocatePool" is located in HOB, and
in DXE phase, the HOB will be migrated to a different location.
After the migration, the data stored in the HOB stays the same, but the
address of pointer to the memory(such as the pointers in ACPI_CPU_DATA
structure) changes, which may cause "PiSmmCpuDxeSmm" driver can't find
the memory(the pointers in ACPI_CPU_DATA structure) that allocated in
"PeiRegisterCpuFeaturesLib", so use "PeiAllocatePages" to allocate
memory instead.

Signed-off-by: Jason Lou <yun.lou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c