From: "Zhai, Edwin" <edwin.zhai@intel.com>
To: Ian Pratt <Ian.Pratt@cl.cam.ac.uk>,
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com, edwin.zhai@intel.com
Subject: [PATCH 7/8] HVM save restore: shadow fix
Date: Thu, 11 Jan 2007 22:12:31 +0800 [thread overview]
Message-ID: <20070111141231.GA2909@edwin-gen.sh.intel.com> (raw)
[PATCH 7/8] HVM save restore: shadow fix
Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
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
diff -r b8fd7c5be4eb xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c Tue Jan 09 16:44:52 2007 +0800
+++ b/xen/arch/x86/mm/shadow/common.c Tue Jan 09 16:44:52 2007 +0800
@@ -2176,7 +2176,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 b8fd7c5be4eb xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c Tue Jan 09 16:44:52 2007 +0800
+++ b/xen/arch/x86/mm/shadow/multi.c Tue Jan 09 16:44:52 2007 +0800
@@ -1630,6 +1630,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 b8fd7c5be4eb xen/common/domain.c
--- a/xen/common/domain.c Tue Jan 09 16:44:52 2007 +0800
+++ b/xen/common/domain.c Tue Jan 09 16:44:52 2007 +0800
@@ -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);
next reply other threads:[~2007-01-11 14:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-11 14:12 Zhai, Edwin [this message]
2007-01-18 16:31 ` [PATCH 7/8] HVM save restore: shadow fix Tim Deegan
2007-01-19 5:05 ` Zhai, Edwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070111141231.GA2909@edwin-gen.sh.intel.com \
--to=edwin.zhai@intel.com \
--cc=Ian.Pratt@cl.cam.ac.uk \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.