From: "Arnd Bergmann" <arnd@arndb.de>
To: "Josh Poimboeuf" <jpoimboe@kernel.org>, "Marco Elver" <elver@google.com>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Andrey Konovalov" <andreyknvl@gmail.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Dmitry Vyukov" <dvyukov@google.com>,
"Aleksandr Nogikh" <nogikh@google.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kcov: mark in_softirq_really() as __always_inline
Date: Wed, 18 Dec 2024 09:49:46 +0100 [thread overview]
Message-ID: <6df09ea5-1478-476c-8bc2-16217a4db3a3@app.fastmail.com> (raw)
In-Reply-To: <20241218084049.npa3zhkagbqp2khc@jpoimboe>
[-- Attachment #1: Type: text/plain, Size: 1560 bytes --]
On Wed, Dec 18, 2024, at 09:40, Josh Poimboeuf wrote:
> On Tue, Dec 17, 2024 at 09:30:24AM +0100, Marco Elver wrote:
>> On Tue, 17 Dec 2024 at 08:18, Arnd Bergmann <arnd@kernel.org> wrote:
>> >
>> > From: Arnd Bergmann <arnd@arndb.de>
>> >
>> > 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.
>> >
>> > Fixes: 7d4df2dad312 ("kcov: properly check for softirq context")
>> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> __always_inline is the usual approach for code that can be
>> instrumented - but I thought we explicitly never instrument
>> kernel/kcov.c with anything. So I'm rather puzzled why gcc would not
>> inline this function. In any case "inline" guarantees nothing, so:
>
> I'm guessing CONFIG_DEBUG_SECTION_MISMATCH was enabled, which enables
> -fno-inline-functions-called-once which ends up being the cause of a lot
> of these __always_inline patches.
>
> I had a patch to get rid of that at some point, guess it got lost...
It doesn't seem to be the cause here, I get the warning both with
and without CONFIG_DEBUG_SECTION_MISMATCH in random configurations.
I've attached one .config that shows the problem without this
option in case you want to investigate further.
Arnd
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38798 bytes --]
next prev parent reply other threads:[~2024-12-18 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 7:18 Arnd Bergmann
2024-12-17 8:30 ` Marco Elver
2024-12-18 8:40 ` Josh Poimboeuf
2024-12-18 8:49 ` Arnd Bergmann [this message]
2024-12-18 9:04 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6df09ea5-1478-476c-8bc2-16217a4db3a3@app.fastmail.com \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=andreyknvl@gmail.com \
--cc=arnd@kernel.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=jpoimboe@kernel.org \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nogikh@google.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®