Skip to content

Commit 878a84d

Browse files
Andre-ARMwildea01
authored andcommitted
arm64: add missing data types in smp_load_acquire/smp_store_release
Commit 8053871 ("smp: Fix smp_call_function_single_async() locking") introduced a call to smp_load_acquire() with a u16 argument, but we only cared about u32 and u64 types in that function so far. This resulted in a compiler warning fortunately, pointing at an uninitialized use. Due to the implementation structure the compiler misses that bug in the smp_store_release(), though. Add the u16 and u8 variants using ldarh/stlrh and ldarb/stlrb, respectively. Together with the compiletime_assert_atomic_type() check this should cover all cases now. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent b787f68 commit 878a84d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

arch/arm64/include/asm/barrier.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ do { \
6565
do { \
6666
compiletime_assert_atomic_type(*p); \
6767
switch (sizeof(*p)) { \
68+
case 1: \
69+
asm volatile ("stlrb %w1, %0" \
70+
: "=Q" (*p) : "r" (v) : "memory"); \
71+
break; \
72+
case 2: \
73+
asm volatile ("stlrh %w1, %0" \
74+
: "=Q" (*p) : "r" (v) : "memory"); \
75+
break; \
6876
case 4: \
6977
asm volatile ("stlr %w1, %0" \
7078
: "=Q" (*p) : "r" (v) : "memory"); \
@@ -81,6 +89,14 @@ do { \
8189
typeof(*p) ___p1; \
8290
compiletime_assert_atomic_type(*p); \
8391
switch (sizeof(*p)) { \
92+
case 1: \
93+
asm volatile ("ldarb %w0, %1" \
94+
: "=r" (___p1) : "Q" (*p) : "memory"); \
95+
break; \
96+
case 2: \
97+
asm volatile ("ldarh %w0, %1" \
98+
: "=r" (___p1) : "Q" (*p) : "memory"); \
99+
break; \
84100
case 4: \
85101
asm volatile ("ldar %w0, %1" \
86102
: "=r" (___p1) : "Q" (*p) : "memory"); \

0 commit comments

Comments
 (0)