From: Thomas Gleixner <tglx@linutronix.de>
To: Josh Poimboeuf <jpoimboe@kernel.org>, x86@kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <frederic@kernel.org>,
"Paul E . McKenney" <paulmck@kernel.org>,
Andy Lutomirski <luto@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/entry: Fix noinstr warning in __enter_from_user_mode()
Date: Tue, 21 Mar 2023 10:08:29 +0100 [thread overview]
Message-ID: <87jzzaa2uq.ffs@tglx> (raw)
In-Reply-To: <d8955fa6d68dc955dda19baf13ae014ae27926f5.1677369694.git.jpoimboe@kernel.org>
On Sat, Feb 25 2023 at 16:01, Josh Poimboeuf wrote:
> __enter_from_user_mode() is triggering noinstr warnings with
> CONFIG_DEBUG_PREEMPT due to its call of preempt_count_add() via
> ct_state().
>
> The preemption disable isn't needed as interrupts are already disabled.
> And the context_tracking_enabled() check in ct_state() also isn't needed
> as that's already being done by the CT_WARN_ON().
>
> Just use __ct_state() instead.
>
> Fixes the following warnings:
>
> vmlinux.o: warning: objtool: enter_from_user_mode+0xba: call to preempt_count_add() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode+0xf9: call to preempt_count_add() leaves .noinstr.text section
> vmlinux.o: warning: objtool: syscall_enter_from_user_mode_prepare+0xc7: call to preempt_count_add() leaves .noinstr.text section
> vmlinux.o: warning: objtool: irqentry_enter_from_user_mode+0xba: call to preempt_count_add() leaves .noinstr.text section
>
> Fixes: 171476775d32 ("context_tracking: Convert state to atomic_t")
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
> include/linux/context_tracking.h | 1 +
> kernel/entry/common.c | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
> index d4afa8508a80..3a7909ed5498 100644
> --- a/include/linux/context_tracking.h
> +++ b/include/linux/context_tracking.h
> @@ -96,6 +96,7 @@ static inline void user_exit_irqoff(void) { }
> static inline int exception_enter(void) { return 0; }
> static inline void exception_exit(enum ctx_state prev_ctx) { }
> static inline int ct_state(void) { return -1; }
> +static inline int __ct_state(void) { return -1; }
This results in a redefinition warning due to CONFIG_CONTEXT_TRACKING=y
and CONFIG_CONFIG_TRACKING_USER=n.
Those headers are a fricking mess.
Thanks,
tglx
next prev parent reply other threads:[~2023-03-21 9:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-26 0:01 [PATCH] x86/entry: Fix noinstr warning in __enter_from_user_mode() Josh Poimboeuf
2023-03-20 10:59 ` [tip: core/urgent] entry: " tip-bot2 for Josh Poimboeuf
2023-03-21 9:08 ` Thomas Gleixner [this message]
2023-03-21 10:54 ` tip-bot2 for 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=87jzzaa2uq.ffs@tglx \
--to=tglx@linutronix.de \
--cc=frederic@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.