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] [xen-unstable] [HVM] save restore: shadow fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [HVM] save restore: shadow fix
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Jan 2007 19:05:18 -0800
Delivery-date: Thu, 18 Jan 2007 19:06:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1169138889 0
# Node ID 025218cdb17dd4d57e8c60948c62b546bfef0080
# Parent  4138b80a8a23de6aa48cc1ba6472b18b3fe9cccb
[HVM] save restore: shadow fix

Signed-off-by: Zhai Edwin <edwin.zhai@xxxxxxxxx>

fix 2 shadow issues:
* restored guest's mem type_info are not correct
* remove annoying warnings when restore

enable smp:
turn on the vcpu when set_vcpu_context in restore as cpu hotplug is not 
feasible for HVM
---
 xen/arch/x86/mm/shadow/common.c |    2 +-
 xen/arch/x86/mm/shadow/multi.c  |    8 ++++++++
 xen/common/domain.c             |    9 +++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff -r 4138b80a8a23 -r 025218cdb17d xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Thu Jan 18 16:48:08 2007 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Thu Jan 18 16:48:09 2007 +0000
@@ -2187,7 +2187,7 @@ int sh_remove_all_mappings(struct vcpu *
         /* Don't complain if we're in HVM and there's one extra mapping: 
          * The qemu helper process has an untyped mapping of this dom's RAM */
         if ( !(shadow_mode_external(v->domain)
-               && (page->count_info & PGC_count_mask) <= 2
+               && (page->count_info & PGC_count_mask) <= 3 /* vmx restore add 
one extra mapping*/
                && (page->u.inuse.type_info & PGT_count_mask) == 0) )
         {
             SHADOW_ERROR("can't find all mappings of mfn %lx: "
diff -r 4138b80a8a23 -r 025218cdb17d xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c    Thu Jan 18 16:48:08 2007 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c    Thu Jan 18 16:48:09 2007 +0000
@@ -1628,6 +1628,14 @@ sh_make_shadow(struct vcpu *v, mfn_t gmf
         }
     }
     
+    {
+        struct page_info *page = mfn_to_page(gmfn);
+        /* XXX: add it to emulate a touched page */
+        if ((page->u.inuse.type_info & PGT_type_mask) == PGT_none){
+            page->u.inuse.type_info |= (PGT_writable_page | PGT_validated);
+        }
+    }
+
     shadow_promote(v, gmfn, shadow_type);
     set_shadow_status(v, gmfn, shadow_type, smfn);
 
diff -r 4138b80a8a23 -r 025218cdb17d xen/common/domain.c
--- a/xen/common/domain.c       Thu Jan 18 16:48:08 2007 +0000
+++ b/xen/common/domain.c       Thu Jan 18 16:48:09 2007 +0000
@@ -24,6 +24,7 @@
 #include <xen/percpu.h>
 #include <xen/multicall.h>
 #include <asm/debugger.h>
+#include <asm/hvm/support.h>
 #include <public/sched.h>
 #include <public/vcpu.h>
 #ifdef CONFIG_COMPAT
@@ -505,6 +506,14 @@ int set_info_guest(struct domain *d,
     if ( rc == 0 )
         rc = arch_set_info_guest(v, c);
 
+    /*XXX: hvm smp guest restore support */
+    if ( rc == 0 &&
+            v->vcpu_id != 0 &&
+            is_hvm_vcpu(v) &&
+            test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) ) {
+        vcpu_wake(v);
+    }
+
     domain_unpause(d);
 
     xfree(c.nat);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [HVM] save restore: shadow fix, Xen patchbot-unstable <=