Re: [PATCH v9 3/3] x86, apicv: add virtual interrupt delivery support

Marcelo Tosatti
2013-01-11T18:04:08Z

> >
> > Move inside irq_lock protection.
> >
> > >
> > > void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
> > > @@ -270,6 +291,7 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
> > > hlist_del_init_rcu(&kian->link);
> > > mutex_unlock(&kvm->irq_lock);
> > > synchronize_rcu();
> > > + ioapic_update_eoi_exitmap(kvm);
> >
> > Move both synchronize_rcu and ioapic_update_eoi_exitmap inside irq_lock
> > protection.
> Why? (here and one above). If vcpu uses stale data during update it will
> find recalculate request during guest entry and will recalculate again.
>
> --
> Gleb.

Indeed, its not necessary and also not necessary to grab irq_lock during
vcpu entry, while processing the KVM_REQ_ bit.