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

Re: [Xen-devel] [PATCH v3 08/32] libxc: introduce a xc_dom_arch for hvm-3.0-x86_32 guests



On 03/07/15 12:34, Roger Pau Monne wrote:
> This xc_dom_arch will be used in order to build HVM domains. The code is
> based on the existing xc_hvm_populate_memory and xc_hvm_populate_params
> functions.
>
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>

Similar review to patch 5.  One bug - see below.

> ---
>  tools/libxc/include/xc_dom.h |   6 +
>  tools/libxc/xc_dom_x86.c     | 541 
> ++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 536 insertions(+), 11 deletions(-)
>
> diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
> index 42533a5..68b052c 100644
> --- a/tools/libxc/include/xc_dom.h
> +++ b/tools/libxc/include/xc_dom.h
> @@ -189,6 +189,12 @@ 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;
> +
>      /* Extra ACPI tables passed to HVMLOADER */
>      struct xc_hvm_firmware_module acpi_module;
>  
> diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
> index 993954e..6573b94 100644
> --- a/tools/libxc/xc_dom_x86.c
> +++ b/tools/libxc/xc_dom_x86.c
> @@ -40,10 +40,29 @@
>  
>  /* ------------------------------------------------------------------------ 
> */
>  
> -#define SUPERPAGE_PFN_SHIFT  9
> -#define SUPERPAGE_NR_PFNS    (1UL << SUPERPAGE_PFN_SHIFT)
>  #define SUPERPAGE_BATCH_SIZE 512
>  
> +#define SUPERPAGE_2MB_SHIFT   9
> +#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
> +#define SUPERPAGE_1GB_SHIFT   18
> +#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
> +
> +#define VGA_HOLE_SIZE (0x20)
> +
> +#define SPECIALPAGE_PAGING   0
> +#define SPECIALPAGE_ACCESS   1
> +#define SPECIALPAGE_SHARING  2
> +#define SPECIALPAGE_BUFIOREQ 3
> +#define SPECIALPAGE_XENSTORE 4
> +#define SPECIALPAGE_IOREQ    5
> +#define SPECIALPAGE_IDENT_PT 6
> +#define SPECIALPAGE_CONSOLE  7
> +#define NR_SPECIAL_PAGES     8
> +#define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
> +
> +#define NR_IOREQ_SERVER_PAGES 8
> +#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
> +
>  #define bits_to_mask(bits)       (((xen_vaddr_t)1 << (bits))-1)
>  #define round_down(addr, mask)   ((addr) & ~(mask))
>  #define round_up(addr, mask)     ((addr) | (mask))
> @@ -462,6 +481,135 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
>      return 0;
>  }
>  
> +static void build_hvm_info(void *hvm_info_page, struct xc_dom_image *dom)
> +{
> +    struct hvm_info_table *hvm_info = (struct hvm_info_table *)
> +        (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
> +    uint8_t sum;
> +    int i;
> +
> +    memset(hvm_info_page, 0, PAGE_SIZE);
> +
> +    /* Fill in the header. */
> +    strncpy(hvm_info->signature, "HVM INFO", 8);

Please apply c/s b9dbe33 to this code.  (Said changeset was since your
submission, but please don't reintroduce the bug).

~Andrew

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