]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
tcg: add early clober modifier in atomic16_cmpxchg on aarch64
authorCatherine Ho <catherine.hecx@gmail.com>
Wed, 30 Jan 2019 08:59:54 +0000 (03:59 -0500)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 6 Feb 2019 03:38:39 +0000 (03:38 +0000)
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>
Message-Id: <1548838794-23757-1-git-send-email-catherine.hecx@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
include/qemu/atomic128.h

index a6af22ff1096c072fb64a49d39653b59317b10de..ddd0d55d31c8e3457f8585b26f930ea889862183 100644 (file)
@@ -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");