From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v9 3/3] x86, apicv: add virtual interrupt delivery support Date: Fri, 11 Jan 2013 15:58:36 -0200 Message-ID: <20130111175836.GA11791@amt.cnet> References: <1357802768-15816-1-git-send-email-yang.z.zhang@intel.com> <1357802768-15816-4-git-send-email-yang.z.zhang@intel.com> <20130110213628.GB9830@amt.cnet> <20130111140928.GB6513@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Yang Zhang , kvm@vger.kernel.org, haitao.shan@intel.com, Kevin Tian To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:27399 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754330Ab3AKSEI (ORCPT ); Fri, 11 Jan 2013 13:04:08 -0500 Content-Disposition: inline In-Reply-To: <20130111140928.GB6513@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: > > > > 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.