]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
powerpc: support KASAN instrumentation of bitops
authorDaniel Axtens <dja@axtens.net>
Tue, 20 Aug 2019 02:49:41 +0000 (12:49 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Nov 2019 02:15:40 +0000 (13:15 +1100)
commit5bece3d66153d78f1fd62108a1553c3f15e71412
tree51601bf479c97064128a2cef170355131f2694f3
parent81d2c6f81996e01fbcd2b5aeefbb519e21c806e9
powerpc: support KASAN instrumentation of bitops

The powerpc-specific bitops are not being picked up by the KASAN
test suite.

Instrumentation is done via the bitops/instrumented-{atomic,lock}.h
headers. They require that arch-specific versions of bitop functions
are renamed to arch_*. Do this renaming.

For clear_bit_unlock_is_negative_byte, the current implementation
uses the PG_waiters constant. This works because it's a preprocessor
macro - so it's only actually evaluated in contexts where PG_waiters
is defined. With instrumentation however, it becomes a static inline
function, and all of a sudden we need the actual value of PG_waiters.
Because of the order of header includes, it's not available and we
fail to compile. Instead, manually specify that we care about bit 7.
This is still correct: bit 7 is the bit that would mark a negative
byte.

While we're at it, replace __inline__ with inline across the file.

Reviewed-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Daniel Axtens <dja@axtens.net>
Tested-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820024941.12640-2-dja@axtens.net
arch/powerpc/include/asm/bitops.h