]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kcov: mark in_softirq_really() as __always_inline
authorArnd Bergmann <arnd@arndb.de>
Tue, 17 Dec 2024 07:18:10 +0000 (08:18 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 31 Dec 2024 01:59:08 +0000 (17:59 -0800)
If gcc decides not to inline in_softirq_really(), objtool warns about a
function call with UACCESS enabled:

kernel/kcov.o: warning: objtool: __sanitizer_cov_trace_pc+0x1e: call to in_softirq_really() with UACCESS enabled
kernel/kcov.o: warning: objtool: check_kcov_mode+0x11: call to in_softirq_really() with UACCESS enabled

Mark this as __always_inline to avoid the problem.

Link: https://lkml.kernel.org/r/20241217071814.2261620-1-arnd@kernel.org
Fixes: 7d4df2dad312 ("kcov: properly check for softirq context")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Aleksandr Nogikh <nogikh@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kcov.c

index 28a6be6e64fdd721d49c4040ed10ce33f9d890a1..187ba1b80bda169d2f7efead5c6076b8829522ca 100644 (file)
@@ -166,7 +166,7 @@ static void kcov_remote_area_put(struct kcov_remote_area *area,
  * Unlike in_serving_softirq(), this function returns false when called during
  * a hardirq or an NMI that happened in the softirq context.
  */
-static inline bool in_softirq_really(void)
+static __always_inline bool in_softirq_really(void)
 {
        return in_serving_softirq() && !in_hardirq() && !in_nmi();
 }