diff -X /home/yamahata/dontdiff -x '.hg/.*' -x 'export/.*' -x '*.porig' -rupNbBw ../foreign_p2m_unbundle/xen-unstable.hg/tools/libxc/ia64/xc_ia64_linux_restore.c ./xen-unstable.hg/tools/libxc/ia64/xc_ia64_linux_restore.c --- ../foreign_p2m_unbundle/xen-unstable.hg/tools/libxc/ia64/xc_ia64_linux_restore.c 2007-09-07 14:51:00.000000000 +0900 +++ ./xen-unstable.hg/tools/libxc/ia64/xc_ia64_linux_restore.c 2007-09-07 15:14:01.000000000 +0900 @@ -16,6 +16,7 @@ #include "xg_private.h" #include "xc_ia64_save_restore.h" #include "xc_ia64.h" +#include "xc_efi.h" #define PFN_TO_KB(_pfn) ((_pfn) << (PAGE_SHIFT - 10)) @@ -179,6 +180,33 @@ xc_domain_restore(int xc_handle, int io_ goto out; } free(memmap_info); + } else if (ver == XC_IA64_SR_FORMAT_VER_ONE) { + xen_ia64_memmap_info_t *memmap_info; + efi_memory_desc_t *memdesc; + uint64_t buffer[(sizeof(*memmap_info) + sizeof(*memdesc) + + sizeof(uint64_t) - 1) / sizeof(uint64_t)]; + + memset(buffer, 0, sizeof(buffer)); + memmap_info = (xen_ia64_memmap_info_t *)buffer; + memdesc = (efi_memory_desc_t*)&memmap_info->memdesc[0]; + memmap_info->efi_memmap_size = sizeof(*memmap_info) + sizeof(*memdesc); + memmap_info->efi_memdesc_size = sizeof(*memdesc); + memmap_info->efi_memdesc_version = EFI_MEMORY_DESCRIPTOR_VERSION; + + memdesc->type = EFI_MEMORY_DESCRIPTOR_VERSION; + memdesc->phys_addr = 0; + memdesc->virt_addr = 0; + memdesc->num_pages = nr_pfns << (PAGE_SHIFT - EFI_PAGE_SHIFT); + memdesc->attribute = EFI_MEMORY_WB; + + if (xc_ia64_p2m_map(&p2m_table, xc_handle, + dom, memmap_info, IA64_DOM0VP_EFP_ALLOC_PTE)) { + ERROR("p2m mapping"); + goto out; + } + } else { + ERROR("unknown version"); + goto out; } DPRINTF("Reloading memory pages: 0%%\n"); @@ -229,7 +257,6 @@ xc_domain_restore(int xc_handle, int io_ goto out; } - nr_frees = 0; for (i = 0; i < count; i++) { if (xc_ia64_p2m_allocated(&p2m_table, pfntab[i])) {