Commit d864b580 authored by Thomas Huth's avatar Thomas Huth Committed by Paolo Bonzini
Browse files

lib/arm64/spinlock: Fix inline assembly for Clang

/home/travis/build/huth/kvm-unit-tests/lib/arm64/spinlock.c:29:12: error:
 value size does not match register size specified by the constraint and
 modifier [-Werror,-Wasm-operand-widths]
                : "=&r" (val), "=&r" (fail)
/home/travis/build/huth/kvm-unit-tests/lib/arm64/spinlock.c:27:9: note: use
 constraint modifier "w"
                "       mov     %0, #1\n"

Use the "w" modifier as suggested to fix the issue.
Signed-off-by: default avatarThomas Huth <>
Message-Id: <>
Signed-off-by: default avatarPaolo Bonzini <>
Reviewed-by: Andrew Jones's avatarAndrew Jones <>
Tested-by: Andrew Jones's avatarAndrew Jones <>
parent 9e186511
......@@ -24,7 +24,7 @@ void spin_lock(struct spinlock *lock)
asm volatile(
"1: ldaxr %w0, [%2]\n"
" cbnz %w0, 1b\n"
" mov %0, #1\n"
" mov %w0, #1\n"
" stxr %w1, %w0, [%2]\n"
: "=&r" (val), "=&r" (fail)
: "r" (&lock->v)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment