# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 069ac1bb78669c19d1570d32d48be8429ec1e81a
# Parent 58ed222274f2bcf1a001b15c18d72d9a221c533d
[XEN] Fix shadow2 integration with writable-pagetable logic.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/mm.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff -r 58ed222274f2 -r 069ac1bb7866 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Aug 21 09:01:53 2006 +0100
+++ b/xen/arch/x86/mm.c Mon Aug 21 10:28:02 2006 +0100
@@ -3139,13 +3139,14 @@ static int ptwr_emulated_update(
}
}
- /* Checked successfully: do the update (write or cmpxchg). */
pl1e = map_domain_page(page_to_mfn(page));
pl1e = (l1_pgentry_t *)((unsigned long)pl1e + (addr & ~PAGE_MASK));
+
+ if ( shadow2_mode_enabled(d) )
+ shadow2_lock(d);
+
if ( do_cmpxchg )
{
- if ( shadow2_mode_enabled(d) )
- shadow2_lock(d);
ol1e = l1e_from_intpte(old);
if ( cmpxchg((intpte_t *)pl1e, old, val) != old )
{
@@ -3155,17 +3156,18 @@ static int ptwr_emulated_update(
put_page_from_l1e(nl1e, d);
return X86EMUL_CMPXCHG_FAILED;
}
- if ( unlikely(shadow2_mode_enabled(v->domain)) )
- {
- shadow2_validate_guest_entry(v, _mfn(page_to_mfn(page)), pl1e);
- shadow2_unlock(v->domain);
- }
}
else
{
ol1e = *pl1e;
if ( !update_l1e(pl1e, ol1e, nl1e, page_to_mfn(page), v) )
BUG();
+ }
+
+ if ( shadow2_mode_enabled(d) )
+ {
+ shadow2_validate_guest_entry(v, _mfn(page_to_mfn(page)), pl1e);
+ shadow2_unlock(v->domain);
}
unmap_domain_page(pl1e);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|