From: Nicholas Miehlbradt <nicholas@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
"mpe@ellerman.id.au" <mpe@ellerman.id.au>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] Add static_key_feature_checks_initialized flag
Date: Tue, 2 Apr 2024 12:53:50 +1100 [thread overview]
Message-ID: <92fe8355-233c-4d73-a81a-08e7c6fc571e@linux.ibm.com> (raw)
In-Reply-To: <65caab3e-8618-4045-8bb9-75a2548d7cd7@csgroup.eu>
On 28/3/2024 2:20 am, Christophe Leroy wrote:
>
>
> Le 27/03/2024 à 05:59, Nicholas Miehlbradt a écrit :
>> JUMP_LABEL_FEATURE_CHECK_DEBUG used static_key_initialized to determine
>> whether {cpu,mmu}_has_feature() was used before static keys were
>> initialized. However, {cpu,mmu}_has_feature() should not be used before
>> setup_feature_keys() is called. As static_key_initalized is set much
>> earlier during boot there is a window in which JUMP_LABEL_FEATURE_CHECK_DEBUG
>> will not report errors. Add a flag specifically to indicate when
>> {cpu,mmu}_has_feature() is safe to use.
>
> What do you mean by "much earlier" ?
>
> As far as I can see, static_key_initialized is set by jump_label_init()
> as cpu_feature_keys_init() and mmu_feature_keys_init() are call
> immediately after. I don't think it is possible to do anything inbetween.
>
> Or maybe you mean the problem is the call to jump_label_init() in
> early_init_devtree() ? You should make it explicit in the message, and
> see if it wouldn't be better to call cpu_feature_keys_init() and
> mmu_feature_keys_init() as well in early_init_devtree() in that case ?
>
The jump_label_init() call in early_init_devtree() is exactly the issue.
I don't think it's possible to move the call to mmu_feature_keys_init()
earlier without significant refactoring since mmu features are being set
as late as setup_kup().
I'll still sent a v2 with a better worded commit message.
Nicholas
> Christophe
next prev parent reply other threads:[~2024-04-02 1:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-27 4:59 [PATCH] Add static_key_feature_checks_initialized flag Nicholas Miehlbradt
2024-03-27 15:20 ` Christophe Leroy
2024-04-02 1:53 ` Nicholas Miehlbradt [this message]
2024-04-02 1:57 ` Nicholas Miehlbradt
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=92fe8355-233c-4d73-a81a-08e7c6fc571e@linux.ibm.com \
--to=nicholas@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).