WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Explicitly block attempts to mutate the M2P tables of shadow mode
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 30 Jan 2006 15:00:09 +0000
Delivery-date: Mon, 30 Jan 2006 15:23:26 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Explicitly block attempts to mutate the M2P tables of shadow mode, Xen patchbot -unstable <=