From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RESEND PATCH v4 2/3] x86, apicv: add virtual interrupt delivery support Date: Mon, 10 Dec 2012 07:55:25 +0200 Message-ID: <20121210055525.GH19514@redhat.com> References: <1354968271-21335-1-git-send-email-yang.z.zhang@intel.com> <1354968271-21335-3-git-send-email-yang.z.zhang@intel.com> <20121209093117.GA24568@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "mtosatti@redhat.com" , "Tian, Kevin" To: "Zhang, Yang Z" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57778 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959Ab2LJFz2 (ORCPT ); Mon, 10 Dec 2012 00:55:28 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 10, 2012 at 01:34:02AM +0000, Zhang, Yang Z wrote: > Gleb Natapov wrote on 2012-12-09: > > On Sat, Dec 08, 2012 at 08:04:30PM +0800, Yang Zhang wrote: > >> diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c > >> index cfb7e4d..081225a 100644 > >> --- a/virt/kvm/ioapic.c > >> +++ b/virt/kvm/ioapic.c > >> @@ -115,6 +115,40 @@ static void update_handled_vectors(struct kvm_ioapic > > *ioapic) > >> smp_wmb(); > >> } > >> +void _ioapic_update_eoi_exitmap(struct kvm_ioapic *ioapic, int pin) > >> +{ > > Bette make is ioapic_update_eoi_exitmap_one() or something. Underscore > > is undescriptive. > > > >> + union kvm_ioapic_redirect_entry *e; > >> + > >> + e = &ioapic->redirtbl[pin]; > >> + > >> + /* PIT is a special case: which is edge trig but have EOI hook. > >> + * Always set the eoi exit bitmap for PIT interrupt*/ > > No hacks please. Check that ack notifier is register for gsi. > Do you mean do this in kvm_register_irq_ack_notifier()? The problem is that we cannot get the vector when calling this function. Because this function is called during device initializing, and guest is not starting at that time. > Call ioapic_update_eoi_exitmap() in kvm_register_irq_ack_notifier(), check that gsi (pin) has notifier registered in ioapic_update_eoi_exitmap(). -- Gleb.