[Qemu-devel] [PATCH] tcg: add early clober modifier in atomic16_cmpxchg on aarch64

Catherine Ho posted 1 patch 6 years, 9 months ago
Test docker-mingw@fedora passed
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1548838794-23757-1-git-send-email-catherine.hecx@gmail.com
include/qemu/atomic128.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] tcg: add early clober modifier in atomic16_cmpxchg on aarch64
Posted by Catherine Ho 6 years, 9 months ago
Without this patch, gcc might up the Input/Output registers and
cause unpredictable error.

Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")

Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>
---
 include/qemu/atomic128.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/qemu/atomic128.h b/include/qemu/atomic128.h
index a6af22ff10..ddd0d55d31 100644
--- a/include/qemu/atomic128.h
+++ b/include/qemu/atomic128.h
@@ -68,7 +68,7 @@ static inline Int128 atomic16_cmpxchg(Int128 *ptr, Int128 cmp, Int128 new)
         "cbnz %w[tmp], 0b\n"
         "1:"
         : [mem] "+m"(*ptr), [tmp] "=&r"(tmp),
-          [oldl] "=&r"(oldl), [oldh] "=r"(oldh)
+          [oldl] "=&r"(oldl), [oldh] "=&r"(oldh)
         : [cmpl] "r"(cmpl), [cmph] "r"(cmph),
           [newl] "r"(newl), [newh] "r"(newh)
         : "memory", "cc");
-- 
2.17.1


Re: [Qemu-devel] [PATCH] tcg: add early clober modifier in atomic16_cmpxchg on aarch64
Posted by Richard Henderson 6 years, 9 months ago
On 1/30/19 12:59 AM, Catherine Ho wrote:
> Without this patch, gcc might up the Input/Output registers and
> cause unpredictable error.
> 
> Fixes: 1ec182c33379 ("target/arm: Convert to HAVE_CMPXCHG128")
> 
> Signed-off-by: Catherine Ho <catherine.hecx@gmail.com>

Queued, thanks.


r~