linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Andrew Murray <andrew.murray@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Will Deacon <will.deacon@arm.com>,
	Ard.Biesheuvel@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/5] jump_label: Don't warn on __exit jump entries
Date: Thu, 22 Aug 2019 16:32:37 +0100	[thread overview]
Message-ID: <20190822153237.GC33080@lakrids.cambridge.arm.com> (raw)
In-Reply-To: <20190812143625.42745-2-andrew.murray@arm.com>

On Mon, Aug 12, 2019 at 03:36:21PM +0100, Andrew Murray wrote:
> On architectures that discard .exit.* sections at runtime, a
> warning is printed for each jump label that is used within an
> in-kernel __exit annotated function:
> 
> can't patch jump_label at ehci_hcd_cleanup+0x8/0x3c
> WARNING: CPU: 0 PID: 1 at kernel/jump_label.c:410 __jump_label_update+0x12c/0x138
> 
> As these functions will never get executed (they are free'd along
> with the rest of initmem) - we do not need to patch them and should
> not display any warnings.
> 
> The warning is displayed because the test required to satisfy
> jump_entry_is_init is based on init_section_contains (__init_begin to
> __init_end) whereas the test in __jump_label_update is based on
> init_kernel_text (_sinittext to _einittext) via kernel_text_address).
> 
> In addition to fixing this, we also remove an out-of-date comment
> and use a WARN instead of a WARN_ONCE.

This last sentence is stale -- it was true in v1 but not since then.

With that droppped:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.
 
> Fixes: 19483677684b ("jump_label: Annotate entries that operate on __init code earlier")
> Signed-off-by: Andrew Murray <andrew.murray@arm.com>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  kernel/jump_label.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/jump_label.c b/kernel/jump_label.c
> index df3008419a1d..cdb3ffab128b 100644
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -407,7 +407,9 @@ static bool jump_label_can_update(struct jump_entry *entry, bool init)
>  		return false;
>  
>  	if (!kernel_text_address(jump_entry_code(entry))) {
> -		WARN_ONCE(1, "can't patch jump_label at %pS", (void *)jump_entry_code(entry));
> +		WARN_ONCE(!jump_entry_is_init(entry),
> +			  "can't patch jump_label at %pS",
> +			  (void *)jump_entry_code(entry));
>  		return false;
>  	}
>  
> -- 
> 2.21.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-22 15:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 14:36 [PATCH v3 0/5] arm64: avoid out-of-line ll/sc atomics Andrew Murray
2019-08-12 14:36 ` [PATCH v3 1/5] jump_label: Don't warn on __exit jump entries Andrew Murray
2019-08-22 15:32   ` Mark Rutland [this message]
2019-08-22 18:41     ` Andrew Murray
2019-08-12 14:36 ` [PATCH v3 2/5] arm64: Use correct ll/sc atomic constraints Andrew Murray
2019-08-22 15:32   ` Mark Rutland
2019-08-28 13:01     ` Andrew Murray
2019-08-28 15:25       ` Mark Rutland
2019-08-28 15:44         ` Andrew Murray
2019-08-28 16:24           ` Mark Rutland
2019-08-28 16:42             ` Andrew Murray
2019-08-12 14:36 ` [PATCH v3 3/5] arm64: atomics: avoid out-of-line ll/sc atomics Andrew Murray
2019-08-22 17:01   ` Mark Rutland
2019-08-28 11:53     ` Andrew Murray
2019-08-12 14:36 ` [PATCH v3 4/5] arm64: avoid using hard-coded registers for LSE atomics Andrew Murray
2019-08-12 14:36 ` [PATCH v3 5/5] arm64: atomics: remove atomic_ll_sc compilation unit Andrew Murray
2019-08-27 16:49 ` [PATCH v3 0/5] arm64: avoid out-of-line ll/sc atomics Will Deacon
2019-08-28  9:04   ` Andrew Murray

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=20190822153237.GC33080@lakrids.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=Ard.Biesheuvel@arm.com \
    --cc=andrew.murray@arm.com \
    --cc=boqun.feng@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    /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;
as well as URLs for NNTP newsgroup(s).