As we use it for KMSAN as well now, let's change the name to be more generic. Signed-off-by: Alexander Potapenko <glider@xxxxxxxxxx> To: Alexander Potapenko <glider@xxxxxxxxxx> Cc: Vegard Nossum <vegard.nossum@xxxxxxxxxx> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Cc: Andrey Ryabinin <aryabinin@xxxxxxxxxxxxx> Cc: Dmitry Vyukov <dvyukov@xxxxxxxxxx> Cc: linux-mm@xxxxxxxxx --- Note that __no_kasan_or_inline is currently used only on S390, and KMSAN patches don't introduce uses of __no_memory_tool_or_inline, so this patch can be landed later if needed. Change-Id: I842d88b841bf1c75ab659b0016a808c6dcf7cdae --- arch/s390/include/asm/processor.h | 4 ++-- include/linux/compiler.h | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 51a0e4a2dc96..6bee92331fcd 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h @@ -214,7 +214,7 @@ static inline unsigned long current_stack_pointer(void) return sp; } -static __no_kasan_or_inline unsigned short stap(void) +static __no_memory_tool_or_inline unsigned short stap(void) { unsigned short cpu_address; @@ -253,7 +253,7 @@ static inline void __load_psw(psw_t psw) * Set PSW mask to specified value, while leaving the * PSW addr pointing to the next instruction. */ -static __no_kasan_or_inline void __load_psw_mask(unsigned long mask) +static __no_memory_tool_or_inline void __load_psw_mask(unsigned long mask) { unsigned long addr; psw_t psw; diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5e88e7e33abe..4a594bd1bc47 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -199,19 +199,21 @@ void __read_once_size(const volatile void *p, void *res, int size) __READ_ONCE_SIZE; } -#ifdef CONFIG_KASAN +#if defined(CONFIG_KASAN) /* * We can't declare function 'inline' because __no_sanitize_address confilcts * with inlining. Attempt to inline it may cause a build failure. * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 * '__maybe_unused' allows us to avoid defined-but-not-used warnings. */ -# define __no_kasan_or_inline __no_sanitize_address notrace __maybe_unused +# define __no_memory_tool_or_inline __no_sanitize_address notrace __maybe_unused +#elif defined(CONFIG_KMSAN) +# define __no_memory_tool_or_inline __no_sanitize_memory notrace __maybe_unused #else -# define __no_kasan_or_inline __always_inline +# define __no_memory_tool_or_inline __always_inline #endif -static __no_kasan_or_inline +static __no_memory_tool_or_inline void __read_once_size_nocheck(const volatile void *p, void *res, int size) { __READ_ONCE_SIZE; @@ -274,7 +276,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s */ #define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) -static __no_kasan_or_inline +static __no_memory_tool_or_inline unsigned long read_word_at_a_time(const void *addr) { kasan_check_read(addr, 1); -- 2.23.0.866.gb869b98d4c-goog