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

Re: [Xen-devel] [PATCH v2] xen/shim: stash RSDP address for ACPI driver



On Mon, Jan 22, 2018 at 03:02:52PM +0000, Wei Liu wrote:
> diff --git a/xen/arch/x86/guest/pvh-boot.c b/xen/arch/x86/guest/pvh-boot.c
> index be3122b16c..2903b392bc 100644
> --- a/xen/arch/x86/guest/pvh-boot.c
> +++ b/xen/arch/x86/guest/pvh-boot.c
> @@ -69,6 +69,8 @@ static void __init convert_pvh_info(void)
>          mod[i].mod_end   = entry[i].paddr + entry[i].size;
>          mod[i].string    = entry[i].cmdline_paddr;
>      }
> +
> +    rsdp_hint = pvh_info->rsdp_paddr;

BUG_ON(!rsdp_hint);

I know it's not ideal, but given the other BUGs I think this should be
here also.

>  }
>  
>  static void __init get_memory_map(void)
> diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
> index 52c9b4ba9a..5d8af6f290 100644
> --- a/xen/drivers/acpi/osl.c
> +++ b/xen/drivers/acpi/osl.c
> @@ -62,8 +62,13 @@ void __init acpi_os_vprintf(const char *fmt, va_list args)
>       printk("%s", buffer);
>  }
>  
> +acpi_physical_address rsdp_hint;

Since this is only used by acpi_os_get_root_pointer it should be
__initdata. I also prefer to place global variables at the top of the
file after the includes, but that's just a matter of taste I guess.

>  acpi_physical_address __init acpi_os_get_root_pointer(void)
>  {
> +     if (rsdp_hint)
> +             return rsdp_hint;
> +
>       if (efi_enabled(EFI_BOOT)) {
>               if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
>                       return efi.acpi20;
> diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
> index 9409350f05..e83182cb14 100644
> --- a/xen/include/xen/acpi.h
> +++ b/xen/include/xen/acpi.h
> @@ -33,6 +33,8 @@
>  #include <acpi/acpi.h>
>  #include <asm/acpi.h>
>  
> +extern acpi_physical_address rsdp_hint;
> +
>  #define ACPI_MADT_GET_(fld, x) (((x) & ACPI_MADT_##fld##_MASK) / \
>       (ACPI_MADT_##fld##_MASK & -ACPI_MADT_##fld##_MASK))

I think this needs to go after the #ifdef CONFIG_ACPI guard?

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.