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

[Xen-changelog] [xen-unstable] x86: Define pte_{read, write}[_atomic] in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Define pte_{read, write}[_atomic] in terms of atomic_readN
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 23 Dec 2010 05:35:13 -0800
Delivery-date: Thu, 23 Dec 2010 05:47:43 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1292528195 0
# Node ID 1cc551716430e296423c95c9c1bb16071c4c3e6c
# Parent  aa33ab320f7e5978cc2158dbcd5da6002afc4b55
x86: Define pte_{read,write}[_atomic] in terms of atomic_readN

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---
 xen/include/asm-x86/x86_32/page.h |   14 +++++---------
 xen/include/asm-x86/x86_64/page.h |    6 +++---
 2 files changed, 8 insertions(+), 12 deletions(-)

diff -r aa33ab320f7e -r 1cc551716430 xen/include/asm-x86/x86_32/page.h
--- a/xen/include/asm-x86/x86_32/page.h Thu Dec 16 19:29:08 2010 +0000
+++ b/xen/include/asm-x86/x86_32/page.h Thu Dec 16 19:36:35 2010 +0000
@@ -84,19 +84,15 @@ extern unsigned int PAGE_HYPERVISOR_NOCA
 
 #endif
 
-#define pte_read_atomic(ptep) cmpxchg(ptep, 0, 0)
-#define pte_write_atomic(ptep, pte) do {                      \
-    intpte_t __pte = *(ptep), __npte;                         \
-    while ( (__npte = cmpxchg(ptep, __pte, (pte))) != __pte ) \
-        __pte = __npte;                                       \
-} while ( 0 )
+#define pte_read_atomic(ptep)       atomic_read64(ptep)
+#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
 #define pte_write(ptep, pte) do {                             \
     u32 *__ptep_words = (u32 *)(ptep);                        \
-    __ptep_words[0] = 0;                                      \
+    atomic_write32(&__ptep_words[0], 0);                      \
     wmb();                                                    \
-    __ptep_words[1] = (pte) >> 32;                            \
+    atomic_write32(&__ptep_words[1], (pte) >> 32);            \
     wmb();                                                    \
-    __ptep_words[0] = (pte) >>  0;                            \
+    atomic_write32(&__ptep_words[0], (pte) >>  0);            \
 } while ( 0 )
 
 /* root table */
diff -r aa33ab320f7e -r 1cc551716430 xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h Thu Dec 16 19:29:08 2010 +0000
+++ b/xen/include/asm-x86/x86_64/page.h Thu Dec 16 19:36:35 2010 +0000
@@ -113,9 +113,9 @@ typedef l4_pgentry_t root_pgentry_t;
 
 #endif /* !__ASSEMBLY__ */
 
-#define pte_read_atomic(ptep)       (*(ptep))
-#define pte_write_atomic(ptep, pte) (*(ptep) = (pte))
-#define pte_write(ptep, pte)        (*(ptep) = (pte))
+#define pte_read_atomic(ptep)       atomic_read64(ptep)
+#define pte_write_atomic(ptep, pte) atomic_write64(ptep, pte)
+#define pte_write(ptep, pte)        atomic_write64(ptep, pte)
 
 /* Given a virtual address, get an entry offset into a linear page table. */
 #define l1_linear_offset(_a) (((_a) & VADDR_MASK) >> L1_PAGETABLE_SHIFT)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Define pte_{read, write}[_atomic] in terms of atomic_readN, Xen patchbot-unstable <=