diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2024-06-18 09:18:44 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-06-24 17:12:48 +0000 |
commit | 4b43dac16b46a8f94a8b349764ce3efdfab64269 (patch) | |
tree | 1f73d11543facc6d52b5da98f4042f517b0fc37b /util/archive | |
parent | f78979007a744912e767c270b0a56b0547b1dbd0 (diff) |
acpi/acpi: Fix Qemu's XSDT patching code
Since Qemu doesn't provide an XSDT, coreboot adds one as separate ACPI
table. Qemu only provides the smaller ACPI 1.0 RSDP, but the XSDT can
only fit into the bigger ACPI 2.0 RSDP. Currently the exsting RSDP is
being reused, without a size check, which works fine on the first boot.
However after reboot the XSDT pointer seems to be valid, even though the
checksum isn't. Since the XSDT then isn't reserved again on reboot, the
memory it's pointing to is reused by other tables, causing the
payload/OS to see an invalid XSDT.
Instead of corrupting the smaller existing RSDP, allocate a new RSDP
structure and properly fill it with both, existing RSDT and XSDT.
In addition return the correct length of allocated ACPI tables to the
calling code. It was ommiting the size of the allocated XSDT and SSDT.
TEST: Run "qemu-system-x86_64 -M q35" and reboot the virtual machine.
With this patch applied XSDT is always valid from the OS
point of view.
Change-Id: Ie4972230c3654714f3dcbaab46a3f70152e75163
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83116
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/archive')
0 files changed, 0 insertions, 0 deletions