From: Tim Deegan Date: Thu, 18 Jan 2007 16:48:12 +0000 (+0000) Subject: [HVM] Save/Restore: don't clobber page types in shadow code X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15371^2~133^2~9^2~5 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=54ffbbd7f33ca3a532f4c1be23907ba24d1e0615;p=xen.git [HVM] Save/Restore: don't clobber page types in shadow code Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 609fa6e122..b821222634 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -2184,10 +2184,11 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn) expected_count = (page->count_info & PGC_allocated) ? 1 : 0; if ( (page->count_info & PGC_count_mask) != expected_count ) { - /* 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 */ + /* Don't complain if we're in HVM and there are some extra mappings: + * The qemu helper process has an untyped mapping of this dom's RAM + * and the HVM restore program takes another. */ if ( !(shadow_mode_external(v->domain) - && (page->count_info & PGC_count_mask) <= 3 /* vmx restore add one extra mapping*/ + && (page->count_info & PGC_count_mask) <= 3 && (page->u.inuse.type_info & PGT_count_mask) == 0) ) { SHADOW_ERROR("can't find all mappings of mfn %lx: " diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c index 6a594682a5..8b8b8585a7 100644 --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -1627,14 +1627,6 @@ sh_make_shadow(struct vcpu *v, mfn_t gmfn, u32 shadow_type) default: /* Do nothing */ break; } } - - { - 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);