mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Dou Liyang <douly.fnst@cn.fujitsu.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Cc: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com,
	arnd@arndb.de, peterz@infradead.org
Subject: Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()
Date: Wed, 25 Oct 2017 08:58:22 +0200	[thread overview]
Message-ID: <7223e00c-0fe6-8844-d0f2-a7cabfba9c03@suse.com> (raw)
In-Reply-To: <a11a14cf-9f92-28f2-1d69-c8fc3a829eb7@cn.fujitsu.com>

On 25/10/17 06:26, Dou Liyang wrote:
> Hi Juergen,
> 
> At 10/23/2017 09:49 PM, Juergen Gross wrote:
>> Don't try to set the static virt_spin_lock_key to a value before
>> jump_label_init() has been called, as this will result in a WARN().
>>
>> Solve the problem by introducing a new lock_init() hook called after
>> jump_label_init() instead of doing the call inside of
>> smp_prepare_boot_cpu().
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>> Based on kernel/git/tip/tip.git locking/core
> 
> I also found that WARN() in tip tree.
> 
> IMO, adding a hook in start_kernel() is not elegant. It will
> affect other arches and increase the complexity of the system.
> 
> I like your original method.
> So, I try to fix it by moving the native_pv_lock_init() from
>  native_smp_prepare_boot_cpu() to native_smp_prepare_cpus().

Hmm, this might work, but the Xen case has to be modified (same for
my more general solution), as xen_init_spinlocks() is still modifying
the static key too early. And we can't move xen_init_spinlocks() to
smp_prepare_cpus() as this would be too late for the alternatives
patching.

So let me extend your patch a little bit to cover Xen, too.

> I hope it's useful to you.

It really is, thanks.


Juergen

  reply	other threads:[~2017-10-25  6:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 13:49 Juergen Gross
2017-10-25  4:26 ` Dou Liyang
2017-10-25  6:58   ` Juergen Gross [this message]
2017-10-25  7:35     ` Dou Liyang
2017-10-25  7:51       ` Juergen Gross
2017-10-25  8:06         ` Dou Liyang
2017-10-27  8:43 ` Ingo Molnar
2017-10-27  9:21   ` Juergen Gross
2017-10-27  9:38     ` Dou Liyang

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=7223e00c-0fe6-8844-d0f2-a7cabfba9c03@suse.com \
    --to=jgross@suse.com \
    --cc=arnd@arndb.de \
    --cc=douly.fnst@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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 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®