ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
Quoted 9 lines · jaccon.bastiaansen at gmail.com
From: Jaccon Bastiaansen <[email protected]>
The implementation of
cmpxchg64()for the ARM v6 and v7 architecture casts parameter 2 and 3 (the old and new 64bit values) to an unsigned long before calling theatomic_cmpxchg64()function. This clears the top 32 bits of the old and new values, resulting in the wrong values being compare-exchanged.This bug is introduced by commit
3e0f5a15f5003f4576c35498814f0f1567860449
Please truncate the commit id to 12 characters and stick the title string in brackets afterwards, e.g. 123456789abc ("will's broken commit"),
Quoted 1 line
Change-Id: I8e8a4c09c525ed8056385c9dc4d65163c28307dc
You can drop the Change-Id.
Quoted 18 lines
Signed-off-by Jaccon Bastiaansen <[email protected]>--- arch/arm/include/asm/cmpxchg.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)arch/arm/include/asm/cmpxchg.h +2
-2@@ -233,15 +233,15 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, ((__typeof__ (*(ptr )))atomic64_cmpxchg (container_of ((ptr), \ atomic64_t, \ counter), \ - (unsigned long )(o), \ - (unsigned long )(n))) + (unsigned long long )(o), \ + (unsigned long long )(n)))
arch/arm/include/asm/cmpxchg.h static inline unsigned long __cmpxchg_local(volatile void *ptr, · line 246
Quoted 10 lines
arch/arm/include/asm/cmpxchg.h +2
-2#define cmpxchg64_local (ptr, o, n) \ ((__typeof__(*(ptr)))local64_cmpxchg(container_of((ptr), \ local64_t, \ a), \ - (unsigned long)(o), \ - (unsigned long)(n))) + (unsigned long long)(o), \ + (unsigned long long)(n)))#endif /* __LINUX_ARM_ARCH__ >= 6 */
With the above cleanup:
Will
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
Quoted 7 lines · Jaccon Bastiaansen
The implementation of
cmpxchg64()for the ARM v6 and v7 architecture casts parameter 2 and 3 (the old and new 64bit values) to an unsigned long before calling theatomic_cmpxchg64()function. This clears the top 32 bits of the old and new values, resulting in the wrong values being compare-exchanged.This bug is introduced by commit
3e0f5a15f500(ARM: 7404/1: cmpxchg64: use atomic64
Best to line-wrap this at 76 chars.
Quoted 3 lines
and local64 routines for cmpxchg64)
Signed-off-by Jaccon Bastiaansen <[email protected]>
Please add the following above your S-o-B:
Then below your S-o-B, add:
KernelVersion: 3.9
and send the patch to patches at arm.linux.org.uk
Cheers,
Will
PATCH v2 1/1 ARM v6/v7 cmpxchg64 shouldn't clear upper 32 bits of the old/new value
Hi Jaccon,
Quoted 17 lines · Will Deacon
Quoted 7 lines · Jaccon Bastiaansen
The implementation of
cmpxchg64()for the ARM v6 and v7 architecture casts parameter 2 and 3 (the old and new 64bit values) to an unsigned long before calling theatomic_cmpxchg64()function. This clears the top 32 bits of the old and new values, resulting in the wrong values being compare-exchanged.This bug is introduced by commit
3e0f5a15f500(ARM: 7404/1: cmpxchg64: use atomic64Best to line-wrap this at 76 chars.
Quoted 3 lines
and local64 routines for cmpxchg64)
Signed-off-by Jaccon Bastiaansen <[email protected]>Please add the following above your S-o-B:
Quoted 8 lines
Cc <[email protected]>Acked-by Will Deacon <[email protected]>Then below your S-o-B, add:
KernelVersion: 3.9
and send the patch to patches at arm.linux.org.uk
Did you manage to do this? I can't see anything pending or queued in rmk's tree...
Cheers,
Will