Mailing List Archive

Explicitly block attempts to mutate the M2P tables of shadow mode
# HG changeset patch
# User sos22@douglas.cl.cam.ac.uk
# Node ID 0d95066795de09b0cecdfae0c1c60763cdd42dbb
# Parent 1580009f137c2d90a3de05c06d677dfbdd65e4bd
Explicitly block attempts to mutate the M2P tables of shadow mode
guests once they're running.

Signed-off-by: Steven Smith, sos22@cam.ac.uk

diff -r 1580009f137c -r 0d95066795de xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Thu Jan 26 13:33:20 2006
+++ b/xen/arch/x86/mm.c Thu Jan 26 13:39:12 2006
@@ -2152,32 +2152,19 @@

case MMU_MACHPHYS_UPDATE:

+ if (shadow_mode_translate(FOREIGNDOM)) {
+ /* We don't allow translate mode guests to have their
+ M2P tables mutated while they're running. */
+ okay = 0;
+ break;
+ }
+
mfn = req.ptr >> PAGE_SHIFT;
gpfn = req.val;
-
- /* HACK ALERT... Need to think about this some more... */
- if ( unlikely(shadow_mode_translate(FOREIGNDOM) && IS_PRIV(d)) )
- {
- shadow_lock(FOREIGNDOM);
- printk("privileged guest dom%d requests pfn=%lx to "
- "map mfn=%lx for dom%d\n",
- d->domain_id, gpfn, mfn, FOREIGNDOM->domain_id);
- set_pfn_from_mfn(mfn, gpfn);
- set_p2m_entry(FOREIGNDOM, gpfn, mfn, &sh_mapcache, &mapcache);
- okay = 1;
- shadow_unlock(FOREIGNDOM);
- break;
- }

if ( unlikely(!get_page_from_pagenr(mfn, FOREIGNDOM)) )
{
MEM_LOG("Could not get page for mach->phys update");
- break;
- }
-
- if ( unlikely(shadow_mode_translate(FOREIGNDOM) && !IS_PRIV(d)) )
- {
- MEM_LOG("can't mutate the m2p of translated guests");
break;
}


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