grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] acpi: use xsdt_addr if present


From: Daniel Kiper
Subject: Re: [PATCH] acpi: use xsdt_addr if present
Date: Mon, 12 Jun 2023 15:59:53 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Thu, Jun 08, 2023 at 07:09:36PM +0800, Qiumiao Zhang via Grub-devel wrote:
> According to the UEFI specification, in ACPI 2.0 or later, an ACPI-compatible 
> OS must use the XSDT if present.

Sorry, I cannot find this in the UEFI spec. Though something more
generic is in the ACPI spec. Could you update the commit message
accordingly?

> So, we should use xsdt_addr instead of rsdt_addr if xsdt_addr is valid.

Ha! We have the same problem in the 
grub-core/kern/acpi.c:grub_acpi_find_table().
May I ask you to fix this function too? Of course in separate patch.

> Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
> ---
>  grub-core/commands/acpi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c
> index deec4bb43..6a7c9ad87 100644
> --- a/grub-core/commands/acpi.c
> +++ b/grub-core/commands/acpi.c
> @@ -514,7 +514,11 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int 
> argc, char **args)
>        /* Set revision variables to replicate the same version as host. */
>        rev1 = ! rsdp->revision;
>        rev2 = rsdp->revision;
> -      rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp->rsdt_addr;
> +      if (rev2 && ((struct grub_acpi_rsdp_v20 *) rsdp)->xsdt_addr != NULL)
> +     rsdt = (struct grub_acpi_table_header *) (grub_addr_t) ((struct 
> grub_acpi_rsdp_v20 *) rsdp)->xsdt_addr;
> +      else
> +     rsdt = (struct grub_acpi_table_header *) (grub_addr_t) rsdp->rsdt_addr;

This LGTM...

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]