ia64/xen-unstable

changeset 6641:ff14bb5600c9

On suspend, canonicalize store and console mfns in the guest.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 05 15:32:14 2005 +0000 (2005-09-05)
parents 1f460d0fd6c6
children 3ba3e5fc2530
files linux-2.6-xen-sparse/arch/xen/kernel/reboot.c tools/libxc/xc_linux_save.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Mon Sep 05 14:54:05 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c	Mon Sep 05 15:32:14 2005 +0000
     1.3 @@ -177,6 +177,9 @@ static int __do_suspend(void *ignore)
     1.4      HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     1.5      clear_fixmap(FIX_SHARED_INFO);
     1.6  
     1.7 +    xen_start_info.store_mfn = mfn_to_pfn(xen_start_info.store_mfn);
     1.8 +    xen_start_info.console_mfn = mfn_to_pfn(xen_start_info.console_mfn);
     1.9 +
    1.10      /* We'll stop somewhere inside this hypercall.  When it returns,
    1.11         we'll start resuming after the restore. */
    1.12      HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
     2.1 --- a/tools/libxc/xc_linux_save.c	Mon Sep 05 14:54:05 2005 +0000
     2.2 +++ b/tools/libxc/xc_linux_save.c	Mon Sep 05 15:32:14 2005 +0000
     2.3 @@ -434,9 +434,6 @@ int xc_linux_save(int xc_handle, int io_
     2.4      /* base of the region in which domain memory is mapped */
     2.5      unsigned char *region_base = NULL;
     2.6  
     2.7 -    /* A temporary mapping of the guest's start_info page. */
     2.8 -    start_info_t *start_info = NULL;
     2.9 -
    2.10      /* number of pages we're dealing with */
    2.11      unsigned long nr_pfns;
    2.12  
    2.13 @@ -669,28 +666,6 @@ int xc_linux_save(int xc_handle, int io_
    2.14          goto out;
    2.15      }
    2.16  
    2.17 -    /* Map the suspend-record MFN to pin it. The page must be owned by 
    2.18 -       dom for this to succeed. */
    2.19 -    start_info = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
    2.20 -				      PROT_READ | PROT_WRITE, 
    2.21 -				      ctxt.user_regs.esi);
    2.22 -    if (!start_info){
    2.23 -        ERR("Couldn't map start_info page");
    2.24 -        goto out;
    2.25 -    }
    2.26 -
    2.27 -    /* Canonicalize store mfn. */
    2.28 -    if ( !translate_mfn_to_pfn(&start_info->store_mfn) ) {
    2.29 -	ERR("Store frame is not in range of pseudophys map");
    2.30 -	goto out;
    2.31 -    }
    2.32 -
    2.33 -    /* Canonicalize console mfn. */
    2.34 -    if ( !translate_mfn_to_pfn(&start_info->console_mfn) ) {
    2.35 -	ERR("Console frame is not in range of pseudophys map");
    2.36 -	goto out;
    2.37 -    }
    2.38 -
    2.39      print_stats( xc_handle, dom, 0, &stats, 0 );
    2.40  
    2.41      /* Now write out each data page, canonicalising page tables as we go... */
    2.42 @@ -1062,9 +1037,6 @@ int xc_linux_save(int xc_handle, int io_
    2.43      if(live_shinfo)
    2.44          munmap(live_shinfo, PAGE_SIZE);
    2.45  
    2.46 -    if(start_info) 
    2.47 -        munmap(start_info, PAGE_SIZE);
    2.48 -
    2.49      if(live_pfn_to_mfn_frame_list) 
    2.50          munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE);
    2.51