From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0DpJ-0008Qa-SX for qemu-devel@nongnu.org; Sun, 04 Sep 2011 10:37:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0DpI-0002PP-NH for qemu-devel@nongnu.org; Sun, 04 Sep 2011 10:37:37 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:42027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0DpI-0002PH-JT for qemu-devel@nongnu.org; Sun, 04 Sep 2011 10:37:36 -0400 Received: by gyd12 with SMTP id 12so3117163gyd.4 for ; Sun, 04 Sep 2011 07:37:35 -0700 (PDT) Message-ID: <4E638D2D.6060503@codemonkey.ws> Date: Sun, 04 Sep 2011 09:37:33 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E58FC3F.6080809@web.de> <4E5BE7C5.60705@us.ibm.com> <4E5BFF51.9010503@web.de> <4E5C00F0.9070103@redhat.com> <4E5D39C8.5020205@web.de> <4E5E1297.3050904@siemens.com> <4E628607.20309@codemonkey.ws> <4E636B56.9070808@web.de> <4E637E06.9020206@codemonkey.ws> <4E637EEA.1030502@web.de> <4E638010.9010503@codemonkey.ws> <4E6381D9.5060709@web.de> <4E6383CB.3070102@codemonkey.ws> In-Reply-To: <4E6383CB.3070102@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pc: Clean up PIC-to-APIC IRQ path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Lucas Meneghel Rodrigues , Peter Maydell , Marcelo Tosatti , qemu-devel , Blue Swirl , Avi Kivity , Gerd Hoffmann On 09/04/2011 08:57 AM, Anthony Liguori wrote: > On 09/04/2011 08:49 AM, Jan Kiszka wrote: >> On 2011-09-04 15:41, Anthony Liguori wrote: >>> On 09/04/2011 08:36 AM, Jan Kiszka wrote: >>> Having some sort of global interrupt routing table is just going to add >>> a layer of complexity for very little obvious gain. >> >> It's not yet decided how the problem is solved. A global interrupt >> matrix is just one proposal, another option is to extend the pin model >> in a way that supports routing change notifiers and backward polling. > > If that's all you need, then you really just want notification on socket > changes. Backwards polling can be achieved by just adding state to the > Pin (which I full heartedly support). > > If that's all you're proposing, than I'm entirely happy with it :-) It's not that simple. Routing paths can change because of device changes, not just socket changes. I think you would need an interface for irq routing. Something like: struct IrqRouter { Interface parent; void (*foreach_output)(IrqRouter *obj, void (*fn)(const char *out, void *opaque), void *opaque); void (*foreach_input)(IrqRouter *obj, void (*fn)(const char *in, void *opaque), void *opaque); const char *(*get_mapping)(IrqRouter *obj, const char *in); }; You could then implement this interface in I440FX or any other controller where we want to be able to support device passthrough. Representing endpoints as strings means that you can correlate inputs to outputs throughout the chain provided that you understand how inputs/outputs relate to plugs/sockets. I think this has the property of letting you write reasonably generic code to discover routing while only having to add complexity to the bare minimum set of devices to enable device passthrough. It's basically what I suggested for PCI INTx mapping but a little more generic as an interface so that it can extend to other types of devices. Regards, Anthony Liguori > I'm happy with that because all of the route detection logic can live > outside of the devices which at least contains the complexity. > > Regards, > > Anthony Liguori