From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlDTY-0007Ox-0Q for qemu-devel@nongnu.org; Thu, 23 Apr 2015 05:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlDTS-0008Jp-Ea for qemu-devel@nongnu.org; Thu, 23 Apr 2015 05:31:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlDTS-0008Je-6i for qemu-devel@nongnu.org; Thu, 23 Apr 2015 05:31:10 -0400 Message-ID: <5538BBD3.9040404@redhat.com> Date: Thu, 23 Apr 2015 11:30:59 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1429778977-1632-1-git-send-email-eric.auger@linaro.org> In-Reply-To: <1429778977-1632-1-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2] irq: add get_gsi callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Auger , eric.auger@st.com, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, agraf@suse.de Cc: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, patches@linaro.org On 23/04/2015 10:49, Eric Auger wrote: > This series introduces a new callback function in IRQState, named > get_gsi_cb. It is supposed to be populated by the interrupt controller > and its role is to convert the interrupt controller pin number into > the global system interrupt (gsi) number. The gsi is used when setting > irqfd up. > > With PCI there is a PCIINTxRoute bus lookup mechanism that enables to > retrieve the gsi from the PCI host controller/bridge pin. The conversion > is implemented by the PCI host controller. With platform devices, this > conversion function is implemented by the interrupt controller. > > Besides the callback member, a setter is introduced. First user is > arm_gic_kvm. A public function wraps the callback, qemu_irq_get_gsi. > > The first user of qemu_irq_get_gsi might be the VFIO platform device. > This will come in the "KVM platform device passthrough" series. I'm sorry, I cannot understand the point of this without seeing a user. Why can't you just use a GHashTable? This mustn't be a hot path, since VFIO does all the signalling in the kernel via irqfds. Paolo