]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/CpuS3DataDxe: do not allocate useless register tables
authorLaszlo Ersek <lersek@redhat.com>
Tue, 19 Jan 2021 15:54:40 +0000 (16:54 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Wed, 20 Jan 2021 18:20:14 +0000 (18:20 +0000)
commit339371ef78eb3a6f2e9848f8b058379de5e87d39
tree38bfa37c7b4c2b207875d0a3f546247e91452b40
parent38ee7bafa72f58982f99ac6f61eef160f80bad69
OvmfPkg/CpuS3DataDxe: do not allocate useless register tables

CpuS3DataDxe allocates the "RegisterTable" and "PreSmmInitRegisterTable"
arrays in ACPI_CPU_DATA just so every processor in the system can have its
own empty register table, matched by APIC ID. This has never been useful
in practice.

Given commit e992cc3f4859 ("UefiCpuPkg PiSmmCpuDxeSmm: Reduce SMRAM
consumption in CpuS3.c", 2021-01-11), simply leave both
"AcpiCpuData->RegisterTable" and "AcpiCpuData->PreSmmInitRegisterTable"
initialized to the zero address. This simplifies the driver, and saves
both normal RAM (boot services data type memory) and -- in PiSmmCpuDxeSmm
-- SMRAM.

(This simplification backs out a good chunk of commit 1158fc8e2c7b
("OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug", 2020-03-04).
But CpuS3DataDxe still differs between UefiCpuPkg and OvmfPkg, due to the
latter supporting CPU hotplug; thus, we can't remove OvmfPkg/CpuS3DataDxe
altogether.)

Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3159
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Message-Id: <20210119155440.2262-5-lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
OvmfPkg/CpuS3DataDxe/CpuS3Data.c
OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf