WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Get rid of suspend record, start info holds all the info

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Get rid of suspend record, start info holds all the info now.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 05 Sep 2005 14:54:12 +0000
Delivery-date: Mon, 05 Sep 2005 14:52:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 89e8a2144c1d6acf7904e8c7719ae79d36591e27
# Parent  5d8b2c258b2689e76d7bfbaf5c5ca09f25b7d40c
Get rid of suspend record, start info holds all the info now.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 5d8b2c258b26 -r 89e8a2144c1d 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Sep  5 14:48:44 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Sep  5 14:53:39 2005
@@ -12,7 +12,6 @@
 #include <asm-xen/evtchn.h>
 #include <asm-xen/hypervisor.h>
 #include <asm-xen/xen-public/dom0_ops.h>
-#include <asm-xen/linux-public/suspend.h>
 #include <asm-xen/queues.h>
 #include <asm-xen/xenbus.h>
 #include <asm-xen/ctrl_if.h>
@@ -69,7 +68,6 @@
 static int __do_suspend(void *ignore)
 {
     int i, j;
-    suspend_record_t *suspend_record;
 
 #ifdef CONFIG_XEN_USB_FRONTEND
     extern void usbif_resume();
@@ -111,10 +109,6 @@
        return -EOPNOTSUPP;
     }
 #endif
-
-    suspend_record = (suspend_record_t *)__get_free_page(GFP_KERNEL);
-    if ( suspend_record == NULL )
-        goto out;
 
     preempt_disable();
 #ifdef CONFIG_SMP
@@ -145,8 +139,6 @@
     }
 #endif
 
-    suspend_record->nr_pfns = max_pfn; /* final number of pfns */
-
     __cli();
 
     preempt_enable();
@@ -185,17 +177,11 @@
     HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page;
     clear_fixmap(FIX_SHARED_INFO);
 
-    memcpy(&suspend_record->resume_info, xen_start_info,
-           sizeof(*xen_start_info));
-
     /* We'll stop somewhere inside this hypercall.  When it returns,
        we'll start resuming after the restore. */
-    HYPERVISOR_suspend(virt_to_mfn(suspend_record));
+    HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
 
     shutting_down = SHUTDOWN_INVALID; 
-
-    memcpy(xen_start_info, &suspend_record->resume_info,
-           sizeof(*xen_start_info));
 
     set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
 
@@ -248,9 +234,6 @@
     }
 #endif
 
- out:
-    if ( suspend_record != NULL )
-        free_page((unsigned long)suspend_record);
     return err;
 }
 
diff -r 5d8b2c258b26 -r 89e8a2144c1d tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Mon Sep  5 14:48:44 2005
+++ b/tools/libxc/xc_linux_restore.c    Mon Sep  5 14:53:39 2005
@@ -10,7 +10,6 @@
 #include <unistd.h>
 #include "xg_private.h"
 #include <xenctrl.h>
-#include <xen/linux/suspend.h>
 #include <xen/memory.h>
 
 #define MAX_BATCH_SIZE 1024
@@ -89,8 +88,8 @@
     /* used by mapper for updating the domain's copy of the table */
     unsigned long *live_pfn_to_mfn_table = NULL;
 
-    /* A temporary mapping of the guest's suspend record. */
-    suspend_record_t *p_srec;
+    /* A temporary mapping of the guest's start_info page. */
+    start_info_t *start_info;
 
     char *region_base;
 
@@ -479,18 +478,18 @@
         goto out;
     }
     ctxt.user_regs.esi = mfn = pfn_to_mfn_table[pfn];
-    p_srec = xc_map_foreign_range(
+    start_info = xc_map_foreign_range(
         xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE, mfn);
-    p_srec->resume_info.nr_pages    = nr_pfns;
-    p_srec->resume_info.shared_info = shared_info_frame << PAGE_SHIFT;
-    p_srec->resume_info.flags       = 0;
-    *store_mfn = p_srec->resume_info.store_mfn   =
-       pfn_to_mfn_table[p_srec->resume_info.store_mfn];
-    p_srec->resume_info.store_evtchn = store_evtchn;
-    *console_mfn = p_srec->resume_info.console_mfn   =
-       pfn_to_mfn_table[p_srec->resume_info.console_mfn];
-    p_srec->resume_info.console_evtchn = console_evtchn;
-    munmap(p_srec, PAGE_SIZE);
+    start_info->nr_pages    = nr_pfns;
+    start_info->shared_info = shared_info_frame << PAGE_SHIFT;
+    start_info->flags       = 0;
+    *store_mfn = start_info->store_mfn   =
+       pfn_to_mfn_table[start_info->store_mfn];
+    start_info->store_evtchn = store_evtchn;
+    *console_mfn = start_info->console_mfn   =
+       pfn_to_mfn_table[start_info->console_mfn];
+    start_info->console_evtchn = console_evtchn;
+    munmap(start_info, PAGE_SIZE);
 
     /* Uncanonicalise each GDT frame number. */
     if ( ctxt.gdt_ents > 8192 )
diff -r 5d8b2c258b26 -r 89e8a2144c1d tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Mon Sep  5 14:48:44 2005
+++ b/tools/libxc/xc_linux_save.c       Mon Sep  5 14:53:39 2005
@@ -14,7 +14,6 @@
 
 #include "xg_private.h"
 
-#include <xen/linux/suspend.h>
 #include <xen/io/domain_controller.h>
 
 #define BATCH_SIZE 1024   /* 1024 pages (4MB) at a time */
@@ -435,8 +434,8 @@
     /* base of the region in which domain memory is mapped */
     unsigned char *region_base = NULL;
 
-    /* A temporary mapping, and a copy, of the guest's suspend record. */
-    suspend_record_t *p_srec = NULL;
+    /* A temporary mapping of the guest's start_info page. */
+    start_info_t *start_info = NULL;
 
     /* number of pages we're dealing with */
     unsigned long nr_pfns;
@@ -672,22 +671,22 @@
 
     /* Map the suspend-record MFN to pin it. The page must be owned by 
        dom for this to succeed. */
-    p_srec = xc_map_foreign_range(xc_handle, dom,
-                                   sizeof(*p_srec), PROT_READ | PROT_WRITE, 
-                                   ctxt.user_regs.esi);
-    if (!p_srec){
-        ERR("Couldn't map suspend record");
+    start_info = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
+                                     PROT_READ | PROT_WRITE, 
+                                     ctxt.user_regs.esi);
+    if (!start_info){
+        ERR("Couldn't map start_info page");
         goto out;
     }
 
     /* Canonicalize store mfn. */
-    if ( !translate_mfn_to_pfn(&p_srec->resume_info.store_mfn) ) {
+    if ( !translate_mfn_to_pfn(&start_info->store_mfn) ) {
        ERR("Store frame is not in range of pseudophys map");
        goto out;
     }
 
     /* Canonicalize console mfn. */
-    if ( !translate_mfn_to_pfn(&p_srec->resume_info.console_mfn) ) {
+    if ( !translate_mfn_to_pfn(&start_info->console_mfn) ) {
        ERR("Console frame is not in range of pseudophys map");
        goto out;
     }
@@ -1030,13 +1029,6 @@
        }
     }
 
-    if (nr_pfns != p_srec->nr_pfns )
-    {
-       ERR("Suspend record nr_pfns unexpected (%ld != %ld)",
-                  p_srec->nr_pfns, nr_pfns);
-        goto out;
-    }
-
     /* Canonicalise the suspend-record frame number. */
     if ( !translate_mfn_to_pfn(&ctxt.user_regs.esi) ){
         ERR("Suspend record is not in range of pseudophys map");
@@ -1070,8 +1062,8 @@
     if(live_shinfo)
         munmap(live_shinfo, PAGE_SIZE);
 
-    if(p_srec) 
-        munmap(p_srec, sizeof(*p_srec));
+    if(start_info) 
+        munmap(start_info, PAGE_SIZE);
 
     if(live_pfn_to_mfn_frame_list) 
         munmap(live_pfn_to_mfn_frame_list, PAGE_SIZE);
diff -r 5d8b2c258b26 -r 89e8a2144c1d 
linux-2.6-xen-sparse/include/asm-xen/linux-public/suspend.h
--- a/linux-2.6-xen-sparse/include/asm-xen/linux-public/suspend.h       Mon Sep 
 5 14:48:44 2005
+++ /dev/null   Mon Sep  5 14:53:39 2005
@@ -1,43 +0,0 @@
-/******************************************************************************
- * suspend.h
- * 
- * Copyright (c) 2003-2004, K A Fraser
- * 
- * This file may be distributed separately from the Linux kernel, or
- * incorporated into other software packages, subject to the following license:
- * 
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this source file (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy, modify,
- * merge, publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef __ASM_XEN_SUSPEND_H__
-#define __ASM_XEN_SUSPEND_H__
-
-typedef struct suspend_record_st {
-    /* To be filled in before resume. */
-    start_info_t resume_info;
-    /*
-     * The number of a machine frame containing, in sequence, the number of
-     * each machine frame that contains PFN -> MFN translation table data.
-     */
-    unsigned long pfn_to_mfn_frame_list;
-    /* Number of entries in the PFN -> MFN translation table. */
-    unsigned long nr_pfns;
-} suspend_record_t;
-
-#endif /* __ASM_XEN_SUSPEND_H__ */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Get rid of suspend record, start info holds all the info now., Xen patchbot -unstable <=