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-4.0-testing] x86: Fix atomic_write*() macros to cor

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] x86: Fix atomic_write*() macros to correctly inform GCC that memory
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 07:52:22 -0800
Delivery-date: Mon, 17 Jan 2011 07:53:02 -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 1294483522 0
# Node ID ed6ff865366e8dc9964a6dd0050f831300881a93
# Parent  ee9d0e23fff739facc9d4c528e3fe38802f656c7
x86: Fix atomic_write*() macros to correctly inform GCC that memory
it knows about is being written to.

The bug is a copy-and-paste error from inline asm that writes to I/O
memory. In that case, as with asm for accessign guest memory,
specifying memory as a read-only parameter is acceptable because the
memory cannot alias with anything that GCC reads directly.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   22683:533d6e5c0099
xen-unstable date:        Sat Jan 08 10:05:55 2011 +0000
---
 xen/include/asm-x86/atomic.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -r ee9d0e23fff7 -r ed6ff865366e xen/include/asm-x86/atomic.h
--- a/xen/include/asm-x86/atomic.h      Fri Jan 07 13:32:36 2011 +0000
+++ b/xen/include/asm-x86/atomic.h      Sat Jan 08 10:45:22 2011 +0000
@@ -17,8 +17,8 @@ static inline type name(const volatile t
 
 #define build_atomic_write(name, size, type, reg, barrier) \
 static inline void name(volatile type *addr, type val) \
-{ asm volatile("mov" size " %0,%1": :reg (val), \
-"m" (*(volatile type *)addr) barrier); }
+{ asm volatile("mov" size " %1,%0": "=m" (*(volatile type *)addr) \
+:reg (val) barrier); }
 
 build_atomic_read(atomic_read8, "b", uint8_t, "=q", )
 build_atomic_read(atomic_read16, "w", uint16_t, "=r", )

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] x86: Fix atomic_write*() macros to correctly inform GCC that memory, Xen patchbot-4.0-testing <=