On 15.03.25 15:26, Simon Glass wrote:
This table lacks a correct checksum at present, so fix it.
Signed-off-by: Simon Glass <s...@chromium.org>
---
(no changes since v3)
Changes in v3:
- Add new patch to add a checksum to the DMAR table
lib/acpi/acpi_table.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/acpi/acpi_table.c b/lib/acpi/acpi_table.c
index 3805b61159e..4044a64d688 100644
--- a/lib/acpi/acpi_table.c
+++ b/lib/acpi/acpi_table.c
@@ -66,6 +66,7 @@ int acpi_create_dmar(struct acpi_dmar *dmar, enum dmar_flags
flags)
dmar->host_address_width = info.address_width - 1;
dmar->flags = flags;
+ header->checksum = table_compute_checksum(dmar, header->length);
table_compute_checksum is used for ACPI and SMBIOS.
In the ACPI case header->length and header->checksum are always at the
same offset to the table start. Shouldn't we introduce a new function to
avoid repeating ourselves:
/**
* acpi_update_checksum() - update ACPI table checksum
*
* @header - header of an ACPI table
*/
void acpi_update_checksum(struct acpi_table_header *header)
{
header->checksum = table_compute_checksum(header, header->length);
}
Reviewed-by: Heinrich Schuchardt <xypron.g...@gmx.de>
return 0;
}