From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH v6 2/3] x86, apicv: add virtual interrupt delivery support Date: Thu, 13 Dec 2012 08:50:02 +0200 Message-ID: <20121213065002.GT11016@redhat.com> References: <1355288208-26786-1-git-send-email-yang.z.zhang@intel.com> <1355288208-26786-3-git-send-email-yang.z.zhang@intel.com> <20121212105404.GL11016@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "mtosatti@redhat.com" , "Shan, Haitao" , "Tian, Kevin" To: "Zhang, Yang Z" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53903 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819Ab2LMGuk (ORCPT ); Thu, 13 Dec 2012 01:50:40 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Dec 13, 2012 at 01:09:11AM +0000, Zhang, Yang Z wrote: > >> +static void ioapic_update_eoi_exitmap_one(struct kvm_ioapic *ioapic, int pin) > >> +{ > >> + union kvm_ioapic_redirect_entry *e; > >> + > >> + e = &ioapic->redirtbl[pin]; > >> + > >> + if ((e->fields.trig_mode == IOAPIC_LEVEL_TRIG || > >> + kvm_irq_has_notifier(ioapic->kvm, KVM_IRQCHIP_IOAPIC, pin))) { > >> + struct kvm_lapic_irq irqe; > >> + > >> + irqe.dest_id = e->fields.dest_id; > >> + irqe.vector = e->fields.vector; > >> + irqe.dest_mode = e->fields.dest_mode; > >> + irqe.delivery_mode = e->fields.delivery_mode << 8; > >> + kvm_update_eoi_exitmap(ioapic->kvm, &irqe); > >> + } > >> +} > >> + > > There is a bugs in exitbitmap recalculation that I've missed. > > We need to zero all the exit bitmaps for all vcpus before we are > > starting to recalculate them to get rid of stale bits. > Right. I forget it too. So if consider to clear it, we should call ioapic_update_eoi_exitmap instead ioapic_update_eoi_exitmap_one when programming one program ioapic entry. > Yes. -- Gleb.