From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] Move irq sharing information to irqchip level. Date: Sun, 23 Aug 2009 14:56:58 +0300 Message-ID: <20090823115658.GB30093@redhat.com> References: <20090813171910.GA4636@redhat.com> <4A892473.9010000@redhat.com> <20090821181638.GA30248@redhat.com> <4A9127D8.7060709@redhat.com> <20090823113657.GA30093@redhat.com> <4A912C1E.5090004@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56820 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933589AbZHWL46 (ORCPT ); Sun, 23 Aug 2009 07:56:58 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7NBv0rL031265 for ; Sun, 23 Aug 2009 07:57:00 -0400 Content-Disposition: inline In-Reply-To: <4A912C1E.5090004@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Aug 23, 2009 at 02:46:38PM +0300, Avi Kivity wrote: > On 08/23/2009 02:36 PM, Gleb Natapov wrote: > >>> > >>>The problem is that at this level it is not known if GSI is MSI or not. > >>>Current code dials with this by arbitrary assuming that GSI is MSI if it > >>>is greater then KVM_IOAPIC_NUM_PINS, but this is not enforced when > >>>routing table is installed and userspace is free to use any GSI as MSI. > >>>Of cause this problem would not exist if MSIs were not linked to GSIs > >>>in the first place. > >>Does msi actually care about the states? I don't think it does. > >> > >That is the point. MSI doesn't care, but we don't know if GSI is MSI or > >not. > > So we toggle the bits needlessly. Just like with edge-triggered interrupts. If we can avoid it why not? > >>No, it's more correct at the GSI level, since all interrupt lines > >>connected to one GSI are shared. > >> > >Why? All interrupts connected to the same irqchip pin (through pci irq > >router or other onboard logic) are shared. GSI is pure logical > >abstraction. > > All interrupts connected through one GSI are shared, so why not keep > the level information shared as well? > If we will keep sharing info at irq routing table level how will we recalculate sharing state when irq routing table changes? -- Gleb.