Re: [PATCH] [x86, msr]: remove code duplication

H. Peter Anvin
2009-07-07T15:58:18Z

Borislav Petkov wrote:
>
> Actually, the more important question is why am I executing anything on
> my own CPU without first checking if it is in the cpumask _at_ _all_?!
> /me ducks behind the sofa.
>
> The right thing to do should be something like the following:
>
> preempt_disable();
> this_cpu = raw_smp_processor_id();
>
> if (cpumask_test_cpu(this_cpu, mask)) {
> local_irq_disable();
> msr_func(&rv);
> local_irq_enable();
> }
>
> smp_call_function_many(mask, msr_func, &rv, 1);
> preempt_enable();
>

I don't see why you're disabling local IRQs.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.