direct-io.hg

diff tools/libxc/xc_hvm_restore.c @ 14099: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 e21834bc78f2
children eedbddf55e51
line diff
     1.1 --- a/tools/libxc/xc_hvm_restore.c	Sat Feb 24 14:10:27 2007 +0000
     1.2 +++ b/tools/libxc/xc_hvm_restore.c	Sat Feb 24 14:19:05 2007 +0000
     1.3 @@ -86,6 +86,8 @@ int xc_hvm_restore(int xc_handle, int io
     1.4      uint8_t *hvm_buf = NULL;
     1.5      unsigned long long v_end, memsize;
     1.6      unsigned long shared_page_nr;
     1.7 +    shared_info_t *shared_info = NULL;
     1.8 +    xen_pfn_t arch_max_pfn;
     1.9  
    1.10      unsigned long pfn;
    1.11      unsigned int prev_pc, this_pc;
    1.12 @@ -141,6 +143,7 @@ int xc_hvm_restore(int xc_handle, int io
    1.13          pfns[i] = i;
    1.14      for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < max_pfn; i++ )
    1.15          pfns[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
    1.16 +    arch_max_pfn = pfns[max_pfn - 1];/* used later */
    1.17  
    1.18      /* Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000. */
    1.19      rc = xc_domain_memory_populate_physmap(
    1.20 @@ -350,6 +353,14 @@ int xc_hvm_restore(int xc_handle, int io
    1.21          ERROR("setting the shared-info pfn failed!\n");
    1.22          goto out;
    1.23      }
    1.24 +    if ( (xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp) != 0) ||
    1.25 +         ((shared_info = xc_map_foreign_range(
    1.26 +             xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
    1.27 +             shared_info_frame)) == NULL) )
    1.28 +        goto out;
    1.29 +    /* shared_info.arch.max_pfn is used by dump-core */
    1.30 +    shared_info->arch.max_pfn = arch_max_pfn;
    1.31 +    munmap(shared_info, PAGE_SIZE);
    1.32  
    1.33      rc = 0;
    1.34      goto out;