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

Re: [Xen-devel] [PATCH v1 05/20] acpi/hvmloader: Move passthrough initialization from ACPI code



>>> On 05.07.16 at 21:05, <boris.ostrovsky@xxxxxxxxxx> wrote:
> Initialize it in hvmloader, avoiding ACPI code's use of xenstore_read()
> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
> ---
> 
> Changes in v1:
> * Rename acpi_pt_length/addr to pt_length/addr

And stopped half way? I ask because ...

> @@ -280,19 +280,11 @@ static int construct_passthrough_tables(unsigned long 
> *table_ptrs,
>      uint32_t total = 0;
>      uint8_t *buffer;
>  
> -    s = xenstore_read(HVM_XS_ACPI_PT_ADDRESS, NULL);
> -    if ( s == NULL )
> -        return 0;    
> -
> -    acpi_pt_addr = (uint8_t*)(uint32_t)strtoll(s, NULL, 0);
> -    if ( acpi_pt_addr == NULL )
> -        return 0;
> -
> -    s = xenstore_read(HVM_XS_ACPI_PT_LENGTH, NULL);
> -    if ( s == NULL )
> +    if ( config->pt.pt_addr == 0 )
>          return 0;
>  
> -    acpi_pt_length = (uint32_t)strtoll(s, NULL, 0);
> +    acpi_pt_addr = config->pt.pt_addr;
> +    acpi_pt_length = config->pt.pt_length;

... expressions like the right side ones here look like K&R C to me -
the pt_ prefixes are redundant too. With that taken care of and ...

> @@ -895,6 +896,16 @@ void hvmloader_acpi_build_tables(struct acpi_config 
> *config,
>              config->vm_gid[1] = strtoll(end+1, NULL, 0);
>      }
>  
> +    s = xenstore_read(HVM_XS_ACPI_PT_ADDRESS, NULL);
> +    if ( s )
> +    {
> +        config->pt.pt_addr = strtoll(s, NULL, 0);
> +
> +        s = xenstore_read(HVM_XS_ACPI_PT_LENGTH, NULL);
> +        if ( s  )

... the double blank here reduced to just one
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

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®.