]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/CpuFeature: Don't assume CpuS3DataDxe alloc RegisterTable
authorRay Ni <ray.ni@intel.com>
Tue, 19 Jan 2021 15:54:37 +0000 (16:54 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 20 Jan 2021 18:20:14 +0000 (18:20 +0000)
commitcefad282fb31aff3e1a6dcbd368cbbffc3fce900
treec4837ee28e1d01b3f6634d036371abcbecd36438
parente843a21e23ea605502f55ff2dbeeaf814d2aef9e
UefiCpuPkg/CpuFeature: Don't assume CpuS3DataDxe alloc RegisterTable

There are lots of fields in ACPI_CPU_DATA structure while only
followings are accessed by CpuFeature infra:
* NumberOfCpus
* PreSmmInitRegisterTable // pointer
* RegisterTable  // pointer
* CpuStatus
* ApLocation  // pointer

So it's possible that an implementation of CpuS3DataDxe doesn't
allocate memory for PreSmmInitRegisterTable/RegisterTable/ApLocation.

This patch handles the case when CpuS3DataDxe doesn't allocate
memory for PreSmmInitRegisterTable/RegisterTable.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3159
Signed-off-by: Ray Ni <ray.ni@intel.com>
[lersek@redhat.com: update CC list, add BZ reference, add my S-o-b]
[lersek@redhat.com: deal with RegisterTable and PreSmmInitRegisterTable
 being zero independently of each other; replacing the ASSERT()]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20210119155440.2262-2-lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
UefiCpuPkg/Library/RegisterCpuFeaturesLib/RegisterCpuFeaturesLib.c