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-devel

[Xen-devel] [PATCH] ignore guest writes to read only memory regions or m

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] ignore guest writes to read only memory regions or memory holes in EPT
From: "Li, Xin" <xin.li@xxxxxxxxx>
Date: Fri, 23 Oct 2009 15:26:17 +0800
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Fri, 23 Oct 2009 00:27:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpTshwet9Mx65+CR7O1y3TC0QRywQ==
Thread-topic: [PATCH] ignore guest writes to read only memory regions or memory holes in EPT
ignore guest writes to read only memory regions or memory holes in EPT.

This patch prevents domain crash when running memtest86 with EPT.

Signed-off-by: Xin Li <xin.li@xxxxxxxxx>

diff -r 37829fd7c1e3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Wed Oct 21 16:08:28 2009 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Fri Oct 23 23:21:27 2009 +0800
@@ -2184,6 +2184,17 @@
         return;
     }

+    /* Ignore writes to:
+     *     1. read only memory regions;
+     *     2. memory holes. */
+    if ( (qualification & EPT_WRITE_VIOLATION)
+         && (((gla_validity == EPT_GLA_VALIDITY_MATCH) && (t == p2m_ram_ro))
+             || (mfn_x(mfn) == INVALID_MFN)) ) {
+        int inst_len = __get_instruction_length();
+        __update_guest_eip(inst_len);
+        return;
+    }
+
     /* Everything else is an error. */
     gla = __vmread(GUEST_LINEAR_ADDRESS);
     gdprintk(XENLOG_ERR, "EPT violation %#lx (%c%c%c/%c%c%c), "

Attachment: fix-ept-memtest86.patch
Description: fix-ept-memtest86.patch

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