[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Explicitly block attempts to mutate the M2P tables of shadow mode



# HG changeset patch
# User sos22@xxxxxxxxxxxxxxxxxxxx
# 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@xxxxxxxxx

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.