Files
linux/include/asm-generic
Matt Evans 6246541522 locking/atomic: cmpxchg: Make __generic_cmpxchg_local compare against zero-extended 'old' value
__generic_cmpxchg_local takes unsigned long old/new arguments which
might end up being up-cast from smaller signed types (which will
sign-extend).  The loaded compare value must be compared against a
truncated smaller type, so down-cast appropriately for each size.

The issue is apparent on 64-bit machines with code, such as
atomic_dec_unless_positive(), that sign-extends from int.

64-bit machines generally don't use the generic cmpxchg but
development/early ports might make use of it, so make it correct.

Signed-off-by: Matt Evans <mev@rivosinc.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-02-03 15:31:23 +01:00
..
2022-02-25 09:36:06 +01:00
2022-09-26 10:13:14 -07:00
2021-12-11 23:31:51 +01:00
2022-10-17 11:03:09 +02:00
2021-06-29 10:53:55 -07:00
2020-01-23 10:41:16 -08:00
2021-01-20 09:30:45 +01:00
2022-07-22 17:34:57 -05:00
2022-02-25 09:36:06 +01:00