RE: [PATCH V3 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions

2017-03-28 Thread Thomas Gleixner
On Tue, 28 Mar 2017, Liang, Kan wrote: > Thanks. It simplify the code very much. > I think we still need to protect the smp_call_function in the driver, right? Yes. > Would be the following code enough? > > get_online_cpus(); > preempt_disable(); Only get_online_cpus(). smp_call_function() disa

RE: [PATCH V3 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions

2017-03-28 Thread Liang, Kan
. > > msr_set/clear_bit() are not protected by anyhting. And in your call > > site this is invoked from fully preemptible context. What protects > > against context switch and interrupts fiddling with DEBUGMSR? > > And thinking more about that whole interface. It's just overkill. > > diff --git

Re: [PATCH V3 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions

2017-03-28 Thread Thomas Gleixner
On Tue, 28 Mar 2017, Thomas Gleixner wrote: > On Mon, 27 Mar 2017, kan.li...@intel.com wrote: > > > From: Kan Liang > > > > To flip a MSR bit on many CPUs or specific CPU, currently it has to do > > read-modify-write operation on the MSR through rd/wrmsr_on_cpu(s). > > It actually sends two IPIs

Re: [PATCH V3 1/2] x86/msr: add msr_set/clear_bit_on_cpu/cpus access functions

2017-03-28 Thread Thomas Gleixner
On Mon, 27 Mar 2017, kan.li...@intel.com wrote: > From: Kan Liang > > To flip a MSR bit on many CPUs or specific CPU, currently it has to do > read-modify-write operation on the MSR through rd/wrmsr_on_cpu(s). > It actually sends two IPIs to the given CPU. The IPIs are the least of the problems