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

[Xen-devel] [patch] pae: cmpxchg8b emulation


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Gerd Knorr <kraxel@xxxxxxx>
  • Date: Wed, 22 Jun 2005 15:54:00 +0200
  • Delivery-date: Wed, 22 Jun 2005 13:54:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

  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


 


Rackspace

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