On Wed, May 22, 2013 at 06:38:47AM +0300, Gleb Natapov wrote:
> On Wed, May 22, 2013 at 12:32:57AM -0300, Marcelo Tosatti wrote:
> > On Wed, May 22, 2013 at 06:28:47AM +0300, Gleb Natapov wrote
> > > > > +     case HV_X64_MSR_TIME_REF_COUNT:
> > > > >               r = true;
> > > > >               break;
> > > > >       }
> > > > > @@ -1827,6 +1829,29 @@ static int set_msr_hyperv_pw(struct kvm_vcpu 
> > > > > *vcpu, u32 msr, u64 data)
> > > > >               if (__copy_to_user((void __user *)addr, instructions, 
> > > > > 4))
> > > > >                       return 1;
> > > > >               kvm->arch.hv_hypercall = data;
> > > > > +             local_irq_disable();
> > > > > +             kvm->arch.hv_ref_count = get_kernel_ns();
> > > > > +             local_irq_enable();
> > > > > +             break;
> > > > 
> > > > local_irq_disable/local_irq_enable not needed.
> > > >
> > > get_kernel_ns has WARN_ON(preemptible()) so at least preempt_disable()
> > > is needed, but all callers of the function disable interrupts.
> > 
> > OK. Its not necessary to disable interrupts (this is a left over of
> > kvm_guest_update_time).
> So preempt_disable() then? Should we change other callers?

Yes. Should only disable interrupts if necessary (the case in
kvm_write_guest_time is necessary).


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to