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

Re: [Xen-devel] [PATCH] libxc: fix the types used in xc_dom_image to build HVM guests



On Thu, 2015-10-15 at 18:30 +0200, Roger Pau Monne wrote:
> Fix the types used to store the memory parameters of an HVM guest,
> previously they defaulted to unsigned long on 32bit toolstack builds, which
> is wrong because a 32bit value cannot hold a 64bit memory address that
> crosses the 4GB boundary.

This header includes a xen_paddr_t in it which looks like the appropriate
type for most of these.

The ones which have units of pages which you've changed from xen_pfn_t to
unsigned long (not long long) should surely remain xen_pfn_t? At least
target_pages should IMHO.

lowmem_end doesn't strictly need to be 64-bit, but xen_paddr_t seems like
the appropriate type semantically nonetheless.

> 
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> I don't have a 32bit Dom0 at hand, so if someone can try to create a HVM
> guests using a 32bit toolstack with more than 4GB of RAM it would be
> helpful.
> ---
>  tools/libxc/include/xc_dom.h | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
> index e52b023..eb3e355 100644
> --- a/tools/libxc/include/xc_dom.h
> +++ b/tools/libxc/include/xc_dom.h
> @@ -186,11 +186,11 @@ struct xc_dom_image {
>      } container_type;
>  
>      /* HVM specific fields. */
> -    xen_pfn_t target_pages;
> -    xen_pfn_t mmio_start;
> -    xen_pfn_t mmio_size;
> -    xen_pfn_t lowmem_end;
> -    xen_pfn_t highmem_end;
> +    unsigned long target_pages;
> +    unsigned long long mmio_start;
> +    unsigned long long mmio_size;
> +    unsigned long lowmem_end;
> +    unsigned long long highmem_end;
>  
>      /* Extra ACPI tables passed to HVMLOADER */
>      struct xc_hvm_firmware_module acpi_module;

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

 


Rackspace

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