[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7223e00c-0fe6-8844-d0f2-a7cabfba9c03@suse.com>
Date: Wed, 25 Oct 2017 08:58:22 +0200
From: Juergen Gross <jgross@...e.com>
To: Dou Liyang <douly.fnst@...fujitsu.com>,
linux-kernel@...r.kernel.org, x86@...nel.org
Cc: hpa@...or.com, tglx@...utronix.de, mingo@...hat.com, arnd@...db.de,
peterz@...radead.org
Subject: Re: [PATCH] paravirt/locks: avoid modifying static key before
jump_label_init()
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@...e.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
Powered by blists - more mailing lists