ia64/xen-unstable

changeset 15841:c5f735271e22

[IA64] Foreign p2m: Fix vti domain builder.

It should set arch_domain::convmem_end.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Sep 06 13:48:43 2007 -0600 (2007-09-06)
parents af03eea56697
children d956779d8d47
files tools/libxc/ia64/xc_ia64_hvm_build.c xen/arch/ia64/xen/dom0_ops.c xen/arch/ia64/xen/dom_fw_utils.c xen/include/asm-ia64/dom_fw_utils.h
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Sep 06 12:57:13 2007 -0600
     1.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Sep 06 13:48:43 2007 -0600
     1.3 @@ -1028,7 +1028,9 @@ setup_guest(int xc_handle, uint32_t dom,
     1.4  
     1.5      domctl.u.arch_setup.flags = XEN_DOMAINSETUP_hvm_guest;
     1.6      domctl.u.arch_setup.bp = 0;
     1.7 -    domctl.u.arch_setup.maxmem = 0;
     1.8 +    domctl.u.arch_setup.maxmem = GFW_START + GFW_SIZE;
     1.9 +    if (dom_memsize > MMIO_START)
    1.10 +        domctl.u.arch_setup.maxmem = dom_memsize + 1 * MEM_G;
    1.11      domctl.cmd = XEN_DOMCTL_arch_setup;
    1.12      domctl.domain = (domid_t)dom;
    1.13      if (xc_domctl(xc_handle, &domctl))
     2.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Thu Sep 06 12:57:13 2007 -0600
     2.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Sep 06 13:48:43 2007 -0600
     2.3 @@ -23,6 +23,7 @@
     2.4  #include <xen/iocap.h>
     2.5  #include <xen/errno.h>
     2.6  #include <xen/nodemask.h>
     2.7 +#include <asm/dom_fw_utils.h>
     2.8  
     2.9  #define get_xen_guest_handle(val, hnd)  do { val = (hnd).p; } while (0)
    2.10  
    2.11 @@ -104,6 +105,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
    2.12                  } else {
    2.13                      d->arch.is_vti = 1;
    2.14                      vmx_setup_platform(d);
    2.15 +                    xen_ia64_set_convmem_end(d, ds->maxmem);
    2.16                  }
    2.17              }
    2.18              else {
     3.1 --- a/xen/arch/ia64/xen/dom_fw_utils.c	Thu Sep 06 12:57:13 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/dom_fw_utils.c	Thu Sep 06 13:48:43 2007 -0600
     3.3 @@ -60,6 +60,11 @@ int xen_ia64_is_dom0(struct domain *d)
     3.4  	return d == dom0;
     3.5  }
     3.6  
     3.7 +void xen_ia64_set_convmem_end(struct domain *d, uint64_t convmem_end)
     3.8 +{
     3.9 +	d->arch.convmem_end = convmem_end;
    3.10 +}
    3.11 +
    3.12  static void dom_fw_domain_init(struct domain *d, struct fw_tables *tables)
    3.13  {
    3.14  	/* Initialise for EFI_SET_VIRTUAL_ADDRESS_MAP emulation */
    3.15 @@ -107,7 +112,7 @@ static int dom_fw_set_convmem_end(struct
    3.16  	     memmap_info->efi_memdesc_size, efi_mdt_cmp, NULL);
    3.17  
    3.18  	if (d->arch.convmem_end == 0)
    3.19 -		d->arch.convmem_end = d->max_pages << PAGE_SHIFT;
    3.20 +		xen_ia64_set_convmem_end(d, d->max_pages << PAGE_SHIFT);
    3.21  
    3.22  	for (p = memmap_start; p < memmap_end;
    3.23  	     p += memmap_info->efi_memdesc_size) {
    3.24 @@ -119,7 +124,7 @@ static int dom_fw_set_convmem_end(struct
    3.25  		if (md->attribute == EFI_MEMORY_WB &&
    3.26  		    md->type == EFI_CONVENTIONAL_MEMORY &&
    3.27  		    md->num_pages > 0 && d->arch.convmem_end < end)
    3.28 -			d->arch.convmem_end = end;
    3.29 +			xen_ia64_set_convmem_end(d, end);
    3.30  	}
    3.31  
    3.32  	dom_fw_copy_to(d, gpaddr, memmap_info, size);
    3.33 @@ -141,7 +146,7 @@ static void dom_fw_setup_for_domain_rest
    3.34  {
    3.35  	assign_new_domain_page(d, FW_HYPERCALL_BASE_PADDR);
    3.36  	dom_fw_domain_init(d, domain_mpa_to_imva(d, FW_TABLES_BASE_PADDR));
    3.37 -	d->arch.convmem_end = maxmem;
    3.38 +	xen_ia64_set_convmem_end(d, maxmem);
    3.39  }
    3.40  
    3.41  /* copy memory range to domain pseudo physical address space */
     4.1 --- a/xen/include/asm-ia64/dom_fw_utils.h	Thu Sep 06 12:57:13 2007 -0600
     4.2 +++ b/xen/include/asm-ia64/dom_fw_utils.h	Thu Sep 06 13:48:43 2007 -0600
     4.3 @@ -26,6 +26,7 @@ int xen_ia64_fpswa_revision(struct domai
     4.4  int xen_ia64_is_vcpu_allocated(struct domain *d, uint32_t vcpu); 
     4.5  int xen_ia64_is_running_on_sim(struct domain *unused);
     4.6  int xen_ia64_is_dom0(struct domain *d);
     4.7 +void xen_ia64_set_convmem_end(struct domain *d, uint64_t convmem_end);
     4.8  void dom_fw_copy_to(struct domain *d, unsigned long dest_gpaddr,
     4.9                      void *src, size_t size); 
    4.10  void dom_fw_copy_from(void* dest, struct domain *d, unsigned long src_gpaddr,