x86: Fix shadow pinning logic (for PV live relo).

From: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
This commit is contained in:
Keir Fraser committed 2008-01-29 11:50:30 +00:00
1 parent c8e525b16b
commit 53a11bbde4
1 file changed
+12 -2
+12 -2
View File
@@ -3518,8 +3518,18 @@ sh_set_toplevel_shadow(struct vcpu *v,
v->arch.shadow_table[slot] = new_entry;
/* Decrement the refcount of the old contents of this slot */
if ( !pagetable_is_null(old_entry) )
sh_put_ref(v, pagetable_get_mfn(old_entry), 0);
if ( !pagetable_is_null(old_entry) ) {
mfn_t old_smfn = pagetable_get_mfn(old_entry);
/* Need to repin the old toplevel shadow if it's been unpinned
* by shadow_prealloc(): in PV mode we're still running on this
* shadow and it's not safe to free it yet. */
if ( !mfn_to_shadow_page(old_smfn)->pinned && !sh_pin(v, old_smfn) )
{
SHADOW_ERROR("can't re-pin %#lx\n", mfn_x(old_smfn));
domain_crash(v->domain);
}
sh_put_ref(v, old_smfn, 0);
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.