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-devel

[Xen-devel] [PATCH 09 of 10] Advertise address of grant table shared pag

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 09 of 10] Advertise address of grant table shared pages in suspend record
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Thu, 14 Dec 2006 23:38:45 -0700
Delivery-date: Thu, 14 Dec 2006 23:43:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1166168316@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Brendan Cully <brendan@xxxxxxxxx>
# Date 1166166342 28800
# Node ID 9182ff9b291d7fef7e05c6899922e88c54d0e419
# Parent  a5274ebef731512d9681c7b81667b509f2e5346a
Advertise address of grant table shared pages in suspend record.

A checkpointed guest keeps its mappings to the shared_info page and
grant table shared pages. To let xc_linux_save distinguish between
these legitimate mappings and page table races, export the addresses
in the suspend record. This patch puts the grant table shared page and
lengths into the start_info pt_base and nr_pt_frames fields, which are
otherwise unused after boot.

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>

diff -r a5274ebef731 -r 9182ff9b291d 
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Thu Dec 14 23:05:42 
2006 -0800
+++ b/linux-2.6-xen-sparse/drivers/xen/core/gnttab.c    Thu Dec 14 23:05:42 
2006 -0800
@@ -426,6 +426,12 @@ int gnttab_suspend(void)
        return 0;
 }
 
+int gnttab_checkpoint(void)
+{
+       xen_start_info->pt_base = (unsigned long)shared;
+       xen_start_info->nr_pt_frames = NR_GRANT_FRAMES;
+}
+
 #else /* !CONFIG_XEN */
 
 #include <platform-pci.h>
diff -r a5274ebef731 -r 9182ff9b291d 
linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c    Thu Dec 14 
23:05:42 2006 -0800
+++ b/linux-2.6-xen-sparse/drivers/xen/core/machine_reboot.c    Thu Dec 14 
23:05:42 2006 -0800
@@ -229,6 +229,8 @@ int __xen_checkpoint(void)
 
        pre_checkpoint();
 
+       gnttab_checkpoint();
+
        /*
         * We'll stop somewhere inside this hypercall. When it returns,
         * we'll start resuming after the restore.
diff -r a5274ebef731 -r 9182ff9b291d linux-2.6-xen-sparse/include/xen/gnttab.h
--- a/linux-2.6-xen-sparse/include/xen/gnttab.h Thu Dec 14 23:05:42 2006 -0800
+++ b/linux-2.6-xen-sparse/include/xen/gnttab.h Thu Dec 14 23:05:42 2006 -0800
@@ -116,6 +116,7 @@ void gnttab_grant_foreign_transfer_ref(g
 #endif
 
 int gnttab_suspend(void);
+int gnttab_checkpoint(void);
 int gnttab_resume(void);
 
 static inline void

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