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

Re: [Xen-devel] [PATCH v2 10/23] acpi/hvmloader: Replace mem_alloc() and virt_to_phys() with memory ops



>>> On 04.08.16 at 23:06, <boris.ostrovsky@xxxxxxxxxx> wrote:
> @@ -568,13 +577,13 @@ void acpi_build_tables(struct acpi_config *config)
>                   offsetof(struct acpi_header, checksum),
>                   sizeof(struct acpi_20_fadt));
>  
> -    nr_secondaries = construct_secondary_tables(secondary_tables,
> +    nr_secondaries = construct_secondary_tables(ctxt, secondary_tables,
>                   config, acpi_info);
>      if ( nr_secondaries < 0 )
>          goto oom;
>  
> -    xsdt = mem_alloc(sizeof(struct acpi_20_xsdt)+
> -                     sizeof(uint64_t)*nr_secondaries,
> +    xsdt = ctxt->mem_ops.alloc(ctxt, (sizeof(struct acpi_20_xsdt) +
> +                     sizeof(uint64_t)*nr_secondaries),

Please take the opportunity and add the missing blanks in expressions
like this (more elsewhere).

> --- a/tools/firmware/hvmloader/util.c
> +++ b/tools/firmware/hvmloader/util.c
> @@ -866,10 +866,21 @@ static uint8_t battery_port_exists(void)
>      return (inb(0x88) == 0x1F);
>  }
>  
> +static unsigned long acpi_v2p(struct acpi_ctxt *ctxt, void *v)
> +{
> +    return virt_to_phys(v);
> +}
> +
> +static void *acpi_mem_alloc(struct acpi_ctxt *ctxt, uint32_t size, uint32_t 
> align)
> +{
> +    return mem_alloc(size, align);
> +}
> +
>  void hvmloader_acpi_build_tables(struct acpi_config *config,
>                                   unsigned int physical)
>  {
>      const char *s;
> +    struct acpi_ctxt ctxt;
>  
>      /* Allocate and initialise the acpi info area. */
>      mem_hole_populate_ram(ACPI_INFO_PHYSICAL_ADDRESS >> PAGE_SHIFT, 1);
> @@ -934,7 +945,10 @@ void hvmloader_acpi_build_tables(struct acpi_config 
> *config,
>      config->rsdp = physical;
>      config->infop = ACPI_INFO_PHYSICAL_ADDRESS;
>  
> -    acpi_build_tables(config);
> +    ctxt.mem_ops.alloc = acpi_mem_alloc;
> +    ctxt.mem_ops.v2p = acpi_v2p;

So you did add a free() hook, but now you don't set it to some
dummy (e.g. invoking BUG())?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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