ia64/xen-unstable

changeset 14710:3c8039aa5004

[IA64] Fix xm dump-core with vti domain

Share privregs with domain and assign it to pseudo physical
address space as para virtualized domain.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Apr 05 09:18:49 2007 -0600 (2007-04-05)
parents 770c465344d3
children 81ba9d2267cb
files tools/libxc/xc_core_ia64.c xen/arch/ia64/vmx/vmx_init.c xen/arch/ia64/xen/domain.c xen/include/asm-ia64/domain.h
line diff
     1.1 --- a/tools/libxc/xc_core_ia64.c	Thu Apr 05 09:13:16 2007 -0600
     1.2 +++ b/tools/libxc/xc_core_ia64.c	Thu Apr 05 09:18:49 2007 -0600
     1.3 @@ -93,6 +93,7 @@ memory_map_get_old_hvm(int xc_handle, xc
     1.4          {IO_PAGE_START, IO_PAGE_SIZE},
     1.5          {STORE_PAGE_START, STORE_PAGE_SIZE},
     1.6          {BUFFER_IO_PAGE_START, BUFFER_IO_PAGE_SIZE},
     1.7 +        {BUFFER_PIO_PAGE_START, BUFFER_PIO_PAGE_SIZE},
     1.8          {GFW_START, GFW_SIZE},
     1.9      };
    1.10      const unsigned int nr_gfw_map = sizeof(gfw_map)/sizeof(gfw_map[0]);
     2.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Thu Apr 05 09:13:16 2007 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Thu Apr 05 09:18:49 2007 -0600
     2.3 @@ -301,6 +301,7 @@ vmx_final_setup_guest(struct vcpu *v)
     2.4  	ASSERT(vpd);
     2.5  
     2.6  	v->arch.privregs = (mapped_regs_t *)vpd;
     2.7 +	vcpu_share_privregs_with_guest(v);
     2.8  	vpd->vpd_low.virt_env_vaddr = vm_buffer;
     2.9  
    2.10  	/* Per-domain vTLB and vhpt implementation. Now vmx domain will stick
     3.1 --- a/xen/arch/ia64/xen/domain.c	Thu Apr 05 09:13:16 2007 -0600
     3.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Apr 05 09:18:49 2007 -0600
     3.3 @@ -446,10 +446,29 @@ int vcpu_initialise(struct vcpu *v)
     3.4  	return 0;
     3.5  }
     3.6  
     3.7 +void vcpu_share_privregs_with_guest(struct vcpu *v)
     3.8 +{
     3.9 +	struct domain *d = v->domain;
    3.10 +	int i, order = get_order_from_shift(XMAPPEDREGS_SHIFT); 
    3.11 +
    3.12 +	for (i = 0; i < (1 << order); i++)
    3.13 +		share_xen_page_with_guest(virt_to_page(v->arch.privregs) + i,
    3.14 +		                          d, XENSHARE_writable);
    3.15 +	/*
    3.16 +	 * XXX IA64_XMAPPEDREGS_PADDR
    3.17 +	 * assign these pages into guest pseudo physical address
    3.18 +	 * space for dom0 to map this page by gmfn.
    3.19 +	 * this is necessary for domain save, restore and dump-core.
    3.20 +	 */
    3.21 +	for (i = 0; i < XMAPPEDREGS_SIZE; i += PAGE_SIZE)
    3.22 +		assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i,
    3.23 +		                   virt_to_maddr(v->arch.privregs + i));
    3.24 +}
    3.25 +
    3.26  int vcpu_late_initialise(struct vcpu *v)
    3.27  {
    3.28  	struct domain *d = v->domain;
    3.29 -	int rc, order, i;
    3.30 +	int rc, order;
    3.31  
    3.32  	if (HAS_PERVCPU_VHPT(d)) {
    3.33  		rc = pervcpu_vhpt_alloc(v);
    3.34 @@ -462,18 +481,7 @@ int vcpu_late_initialise(struct vcpu *v)
    3.35  	v->arch.privregs = alloc_xenheap_pages(order);
    3.36  	BUG_ON(v->arch.privregs == NULL);
    3.37  	memset(v->arch.privregs, 0, 1 << XMAPPEDREGS_SHIFT);
    3.38 -	for (i = 0; i < (1 << order); i++)
    3.39 -		share_xen_page_with_guest(virt_to_page(v->arch.privregs) + i,
    3.40 -		                          d, XENSHARE_writable);
    3.41 -	/*
    3.42 -	 * XXX IA64_XMAPPEDREGS_PADDR
    3.43 -	 * assign these pages into guest pseudo physical address
    3.44 -	 * space for dom0 to map this page by gmfn.
    3.45 -	 * this is necessary for domain save, restore and dump-core.
    3.46 -	 */
    3.47 -	for (i = 0; i < XMAPPEDREGS_SIZE; i += PAGE_SIZE)
    3.48 -		assign_domain_page(d, IA64_XMAPPEDREGS_PADDR(v->vcpu_id) + i,
    3.49 -		                   virt_to_maddr(v->arch.privregs + i));
    3.50 +	vcpu_share_privregs_with_guest(v);
    3.51  
    3.52  	return 0;
    3.53  }
     4.1 --- a/xen/include/asm-ia64/domain.h	Thu Apr 05 09:13:16 2007 -0600
     4.2 +++ b/xen/include/asm-ia64/domain.h	Thu Apr 05 09:18:49 2007 -0600
     4.3 @@ -21,6 +21,7 @@ struct tlb_track;
     4.4  extern void domain_relinquish_resources(struct domain *);
     4.5  struct vcpu;
     4.6  extern void relinquish_vcpu_resources(struct vcpu *v);
     4.7 +extern void vcpu_share_privregs_with_guest(struct vcpu *v);
     4.8  extern int vcpu_late_initialise(struct vcpu *v);
     4.9  
    4.10  /* given a current domain metaphysical address, return the physical address */