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] pae: cmpxchg8b emulation

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch] pae: cmpxchg8b emulation
From: Gerd Knorr <kraxel@xxxxxxx>
Date: Wed, 22 Jun 2005 15:54:00 +0200
Delivery-date: Wed, 22 Jun 2005 13:54:19 +0000
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/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
  Hi,

The patch below adds cmpxchg8b support for writable page tables
(emulation code path), which is needed to make atomic pae l1
page table updates work.

Originally by Scott Parish, pulled from list archive ;)

  Gerd

Index: xen/arch/x86/mm.c
===================================================================
--- xen.orig/arch/x86/mm.c      2005-06-22 14:55:43.000000000 +0200
+++ xen/arch/x86/mm.c   2005-06-22 14:59:26.000000000 +0200
@@ -2792,12 +2792,30 @@ static int ptwr_emulated_cmpxchg(
     return ptwr_emulated_update(addr, old, new, bytes, 1);
 }
 
+#if CONFIG_X86_PAE
+static int ptwr_emulated_cmpxchg8b(
+    unsigned long addr,
+    unsigned long old,
+    unsigned long old_hi,
+    unsigned long new,
+    unsigned long new_hi)
+{
+    return ptwr_emulated_update(addr,
+                               (u64)old_hi << sizeof(old_hi)*8 | old,
+                               (u64)new_hi << sizeof(new_hi)*8 | new,
+                               sizeof(u64), 1);
+}
+#endif
+
 static struct x86_mem_emulator ptwr_mem_emulator = {
     .read_std         = x86_emulate_read_std,
     .write_std        = x86_emulate_write_std,
     .read_emulated    = x86_emulate_read_std,
     .write_emulated   = ptwr_emulated_write,
-    .cmpxchg_emulated = ptwr_emulated_cmpxchg
+    .cmpxchg_emulated = ptwr_emulated_cmpxchg,
+#if CONFIG_X86_PAE
+    .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b,
+#endif
 };
 
 /* Write page fault handler: check if guest is trying to modify a PTE. */

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [patch] pae: cmpxchg8b emulation, Gerd Knorr <=