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

[Xen-changelog] Add cmpxchg8b support for writable page tables



ChangeSet 1.1729, 2005/06/22 18:40:09+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Add cmpxchg8b support for writable page tables
        (emulation code path), which is needed to make atomic pae l1
        page table updates work.
        Signed-off-by: Scott Parish <srparish@xxxxxxxxxx>
        



 mm.c |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)


diff -Nru a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c 2005-06-22 14:01:34 -04:00
+++ b/xen/arch/x86/mm.c 2005-06-22 14:01:34 -04:00
@@ -2793,12 +2793,24 @@
     return ptwr_emulated_update(addr, old, new, bytes, 1);
 }
 
+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 << 32) | old, ((u64)new_hi << 32) | new, 8, 1);
+}
+
 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
+    .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,
+    .cmpxchg8b_emulated = ptwr_emulated_cmpxchg8b
 };
 
 /* Write page fault handler: check if guest is trying to modify a PTE. */

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


 


Rackspace

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