Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-27 Thread Dou Liyang
Hi Juergen At 10/27/2017 05:21 PM, Juergen Gross wrote: On 27/10/17 10:43, Ingo Molnar wrote: * 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 l

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-27 Thread Juergen Gross
On 27/10/17 10:43, Ingo Molnar wrote: > > * 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_i

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-27 Thread Ingo Molnar
* 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_

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-25 Thread Dou Liyang
Hi Juergen, How about moving the check of xen_pvspin into native_pv_lock_init() like below? This would leak xen_pvspin to non-Xen code. I'd rather do the Oops, yes, I made the mistake. Please ignore it. static_branch_disable() in xen_init_lock_cpu() if cpu == 0. Yes. I will test it. :-

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-25 Thread Juergen Gross
On 25/10/17 09:35, Dou Liyang wrote: > Hi Juergen, > > [...] >>> 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

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-25 Thread Dou Liyang
Hi Juergen, [...] 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 sti

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-24 Thread Juergen Gross
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() ho

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-24 Thread Dou Liyang
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 t

[PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-23 Thread Juergen Gross
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: Ju