[PATCH 1/3] acpi: fix struct acpi_xsdt

Simon Glass sjg at chromium.org
Sun Nov 12 04:08:38 CET 2023


On Sat, 11 Nov 2023 at 06:42, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> The size of the ACPI table header is not a multiple of 8. We have to mark
> struct acpi_xsdt as packed to correctly read the entries.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  include/acpi/acpi_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

It is really unfortunate.

Would it be worth adding a test for this, which actually checks the
member offset?

>
> diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h
> index a3b67259e6..20ac3b51ba 100644
> --- a/include/acpi/acpi_table.h
> +++ b/include/acpi/acpi_table.h
> @@ -80,7 +80,7 @@ struct acpi_rsdt {
>  };
>
>  /* XSDT (Extended System Description Table) */
> -struct acpi_xsdt {
> +struct __packed acpi_xsdt {
>         struct acpi_table_header header;
>         u64 entry[MAX_ACPI_TABLES];
>  };
> --
> 2.40.1
>

Regards,
Simon


More information about the U-Boot mailing list