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] bug in PT write emulation

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] bug in PT write emulation
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Thu, 18 Oct 2007 02:11:46 +0100
Delivery-date: Wed, 17 Oct 2007 18:12:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
I think the below fix is correct, though as I'm far from comfortable
with this code I'd like some comments first...

'val' is the unmodified pte value written by the guest. We need to use
nl1e instead, which has done the needed PAGE_GLOBAL etc. modifications.

cheers,
john

# HG changeset patch
# User john.levon@xxxxxxx
# Date 1192664022 25200
# Node ID d2eed7e51be31880f04033d1241861602d3628bb
# Parent  a6b52e05bcd026a7d378fff130b90d6eda62209a

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -3204,7 +3204,7 @@ static int ptwr_emulated_update(
         if ( shadow_mode_enabled(d) )
             shadow_lock(d);
         ol1e = l1e_from_intpte(old);
-        if ( cmpxchg((intpte_t *)pl1e, old, val) != old )
+        if ( cmpxchg((intpte_t *)pl1e, old, l1e_get_intpte(nl1e)) != old )
         {
             if ( shadow_mode_enabled(d) )
                 shadow_unlock(d);

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

<Prev in Thread] Current Thread [Next in Thread>