The current GHES raw data maximal length isn't enough for 16 consecutive CPER errors, which will be sent to a guest with 4KiB page size on a erroneous 64KiB host page. Note those 16 CPER errors will be contained in one single error block, meaning all CPER errors should be identical in terms of type and severity and all of them should be delivered in one shot.
Increase GHES raw data maximal length from 1KiB to 4KiB so that the error block has enough storage space for 16 consecutive CPER errors. Signed-off-by: Gavin Shan <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> --- docs/specs/acpi_hest_ghes.rst | 6 +++--- hw/acpi/generic_event_device.c | 2 ++ hw/core/machine.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/specs/acpi_hest_ghes.rst b/docs/specs/acpi_hest_ghes.rst index aaf7b1ad11..b3ecb5856c 100644 --- a/docs/specs/acpi_hest_ghes.rst +++ b/docs/specs/acpi_hest_ghes.rst @@ -68,9 +68,9 @@ Design Details and N Read Ack Register entries. The size for each entry is 8-byte. The Error Status Data Block table contains N Error Status Data Block entries. The size for each entry is defined at the source code as - ACPI_GHES_MAX_RAW_DATA_LENGTH (currently 1024 bytes). The total size - for the "etc/hardware_errors" fw_cfg blob is - (N * 8 * 2 + N * ACPI_GHES_MAX_RAW_DATA_LENGTH) bytes. + GHES_MAX_RAW_DATA_LENGTH, which is 4096 bytes in QEMU 10.2 or onwards, + but 1024 bytes in other cases. The total size of "etc/hardware_errors" + fw_cfg blob is (N * 8 * 2 + N * GHES_MAX_RAW_DATA_LENGTH) bytes. N is the number of the kinds of hardware error sources. (4) QEMU generates the ACPI linker/loader script for the firmware. The diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index e7b773d84d..30a5078878 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -364,6 +364,8 @@ static const Property acpi_ged_properties[] = { TYPE_PCI_BUS, PCIBus *), DEFINE_PROP_BOOL("x-has-hest-addr", AcpiGedState, ghes_state.use_hest_addr, true), + DEFINE_PROP_UINT32("x-error-block-size", AcpiGedState, + ghes_state.error_block_size, 4096), }; static const VMStateDescription vmstate_memhp_state = { diff --git a/hw/core/machine.c b/hw/core/machine.c index 06e0c9a179..539793b11b 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -40,6 +40,7 @@ GlobalProperty hw_compat_10_1[] = { { TYPE_ACPI_GED, "x-has-hest-addr", "false" }, + { TYPE_ACPI_GED, "x-error-block-size", "1024" }, { TYPE_VIRTIO_NET, "host_tunnel", "off" }, { TYPE_VIRTIO_NET, "host_tunnel_csum", "off" }, { TYPE_VIRTIO_NET, "guest_tunnel", "off" }, -- 2.51.1
