From: Juergen Gross <jgross@suse.com>
To: Borislav Petkov <bp@alien8.de>, Peter Zijlstra <peterz@infradead.org>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
tipbuild@zytor.com, lkp@01.org
Subject: Re: [locking/paravirt] 9043442b43: WARNING:at_kernel/jump_label.c:#static_key_disable_cpuslocked
Date: Mon, 23 Oct 2017 11:06:23 +0200 [thread overview]
Message-ID: <c5978d6c-08ee-d45e-bbe0-66e601499b64@suse.com> (raw)
In-Reply-To: <20171018142159.hesobm5arrjvexoj@pd.tnic>
On 18/10/17 16:22, Borislav Petkov wrote:
> On Thu, Oct 12, 2017 at 09:47:17AM +0200, Peter Zijlstra wrote:
>> Urgh.. I always get lost in that whole patching maze :/ Unless Juergen
>> can move it later, I think the below should also work. Moving
>> jump_label_init() before smp_prepare_boot_cpu() might not work for all
>> architectures, but it should work for x86 (and we explicitly allow for
>> archs to initialize this early).
>>
>> ---
>> arch/x86/kernel/smpboot.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
>> index aed1460135e6..93b42d9d9d4f 100644
>> --- a/arch/x86/kernel/smpboot.c
>> +++ b/arch/x86/kernel/smpboot.c
>> @@ -1350,6 +1350,17 @@ void __init native_smp_prepare_boot_cpu(void)
>> /* already set me in cpu_online_mask in boot_cpu_init() */
>> cpumask_set_cpu(me, cpu_callout_mask);
>> cpu_set_state_online(me);
>> +
>> + /*
>> + * native_pv_lock_init() needs jump_labels to work. Moving
>> + * jump_label_init() in generic code requires auditing all archs for
>> + * their text_poke requirements.
>> + *
>> + * The x86 version really only depends on ideal_nops[] which is
>> + * initialized at the end of setup_arch(). So doing an arch specific
>> + * early init of jump-labels here is fine.
>> + */
>> + jump_label_init();
>> native_pv_lock_init();
>> }
>
> This fixes the jump_label thing I'm seeing too but it causes:
>
> [ 0.000000] ------------[ cut here ]------------
> [ 0.000000] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:712 text_poke+0x214/0x220
Yeah, calling jump_label_init() before page_alloc_init() seems to be the
problem.
I guess the best solution would be to move the call of
native_pv_lock_init() after jump_label_init(). This would require a new
hook, e.g. lock_init(), to be called either from start_kernel() or maybe
from sched_init()?
Juergen
prev parent reply other threads:[~2017-10-23 9:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 19:56 kernel test robot
2017-10-11 20:14 ` Waiman Long
2017-10-12 7:47 ` Peter Zijlstra
2017-10-18 14:22 ` Borislav Petkov
2017-10-23 9:06 ` Juergen Gross [this message]
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=c5978d6c-08ee-d45e-bbe0-66e601499b64@suse.com \
--to=jgross@suse.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@01.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tipbuild@zytor.com \
--cc=torvalds@linux-foundation.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®