ia64/xen-unstable

changeset 14109:aa1be6f5150e

x86 hvm domain builder, restore: set shared_info.arch.max_pfn for
dump-core to know the area to dump

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir@xensource.com>
date Sat Feb 24 14:19:05 2007 +0000 (2007-02-24)
parents 6c938630de54
children f61992cb82fe
files tools/libxc/xc_hvm_build.c tools/libxc/xc_hvm_restore.c
line diff
     1.1 --- a/tools/libxc/xc_hvm_build.c	Sat Feb 24 14:10:27 2007 +0000
     1.2 +++ b/tools/libxc/xc_hvm_build.c	Sat Feb 24 14:19:05 2007 +0000
     1.3 @@ -262,6 +262,7 @@ static int setup_guest(int xc_handle,
     1.4      /* NB. evtchn_upcall_mask is unused: leave as zero. */
     1.5      memset(&shared_info->evtchn_mask[0], 0xff,
     1.6             sizeof(shared_info->evtchn_mask));
     1.7 +    shared_info->arch.max_pfn = page_array[nr_pages - 1];
     1.8      munmap(shared_info, PAGE_SIZE);
     1.9  
    1.10      if ( v_end > HVM_BELOW_4G_RAM_END )
     2.1 --- a/tools/libxc/xc_hvm_restore.c	Sat Feb 24 14:10:27 2007 +0000
     2.2 +++ b/tools/libxc/xc_hvm_restore.c	Sat Feb 24 14:19:05 2007 +0000
     2.3 @@ -86,6 +86,8 @@ int xc_hvm_restore(int xc_handle, int io
     2.4      uint8_t *hvm_buf = NULL;
     2.5      unsigned long long v_end, memsize;
     2.6      unsigned long shared_page_nr;
     2.7 +    shared_info_t *shared_info = NULL;
     2.8 +    xen_pfn_t arch_max_pfn;
     2.9  
    2.10      unsigned long pfn;
    2.11      unsigned int prev_pc, this_pc;
    2.12 @@ -141,6 +143,7 @@ int xc_hvm_restore(int xc_handle, int io
    2.13          pfns[i] = i;
    2.14      for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < max_pfn; i++ )
    2.15          pfns[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
    2.16 +    arch_max_pfn = pfns[max_pfn - 1];/* used later */
    2.17  
    2.18      /* Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000. */
    2.19      rc = xc_domain_memory_populate_physmap(
    2.20 @@ -350,6 +353,14 @@ int xc_hvm_restore(int xc_handle, int io
    2.21          ERROR("setting the shared-info pfn failed!\n");
    2.22          goto out;
    2.23      }
    2.24 +    if ( (xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp) != 0) ||
    2.25 +         ((shared_info = xc_map_foreign_range(
    2.26 +             xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
    2.27 +             shared_info_frame)) == NULL) )
    2.28 +        goto out;
    2.29 +    /* shared_info.arch.max_pfn is used by dump-core */
    2.30 +    shared_info->arch.max_pfn = arch_max_pfn;
    2.31 +    munmap(shared_info, PAGE_SIZE);
    2.32  
    2.33      rc = 0;
    2.34      goto out;