From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH] vhost: force vhost off for non-MSI guests Date: Mon, 14 Mar 2011 21:00:02 +0200 Message-ID: <20110314190002.GA24011@redhat.com> References: <20110120153521.GA24357@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Alex Williamson , Juan Quintela , jasowang@redhat.com, Jes.Sorensen@redhat.com To: rukhsana ansari Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57054 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752555Ab1CNTAT (ORCPT ); Mon, 14 Mar 2011 15:00:19 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Mar 14, 2011 at 10:35:08PM +0530, rukhsana ansari wrote: > Seeking clarification to the original question I posted: > >> > >> > > This maybe a novice question - Would appreciate it if you can you p= rovide a > > pointer to documentation or relevant code that explains what is the > > limitation in supporting level irq support in kvm irqfd. > > > > > > > After browsing the KVM kernel code, it does look like direct assignme= nt of PCI > devices allows support for level-triggered interrupts to be injected = to the > guest from the kernel.=A0 (as opposed to not supporting it for vhost = irqfd > mechanism) > This occurs when the guest device supports INTX. > Reference: =A0kvm_assigned_dev_interrupt_work_handler() in assigned-d= ev.c calls > kvm_set_irq() > with the guest_irq. > This function in turn invokes the assigned set function =A0(either > kvm_set_pic_irq or kvm_set_ioapic_irq) which was setup at kvm_irq_chi= p creation > time when kvm_setup_default_irq_routing () called for handling ioctl > KVM_CREATE_IRQCHIP. >=20 > So, it isn't clear why level-triggered interrupt isn't supported for = irqfd > mechanism. > Would greatly appreciate clarification here >=20 > Thanks > -Rukhsana >=20 Mostly, no one came up with an implementation so far. If the point is to use irqfd with vhost-net, there's also a question of adding interfaces to 1. pass IO read transactions directly to another kernel module 2. add an interface to clear the irq level Maybe the right thing is to combine the two somehow: irqfd might get an oiption to set a bit in memory, ioeventfd might get an option to read and clear from memory and clear irqfd line at the same time. --=20 MST From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43202 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PzD08-00074k-BR for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:00:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzD07-0007cZ-B8 for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:00:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzD06-0007bU-OC for qemu-devel@nongnu.org; Mon, 14 Mar 2011 15:00:19 -0400 Date: Mon, 14 Mar 2011 21:00:02 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH] vhost: force vhost off for non-MSI guests Message-ID: <20110314190002.GA24011@redhat.com> References: <20110120153521.GA24357@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: rukhsana ansari Cc: kvm@vger.kernel.org, Juan Quintela , Jes.Sorensen@redhat.com, jasowang@redhat.com, qemu-devel@nongnu.org, Alex Williamson On Mon, Mar 14, 2011 at 10:35:08PM +0530, rukhsana ansari wrote: > Seeking clarification to the original question I posted: > >> > >> > > This maybe a novice question - Would appreciate it if you can you pro= vide a > > pointer to documentation or relevant code that explains what is the > > limitation in supporting level irq support in kvm irqfd. > > > > > > > After browsing the KVM kernel code, it does look like direct assignment= of PCI > devices allows support for level-triggered interrupts to be injected to= the > guest from the kernel.=A0 (as opposed to not supporting it for vhost ir= qfd > mechanism) > This occurs when the guest device supports INTX. > Reference: =A0kvm_assigned_dev_interrupt_work_handler() in assigned-dev= .c calls > kvm_set_irq() > with the guest_irq. > This function in turn invokes the assigned set function =A0(either > kvm_set_pic_irq or kvm_set_ioapic_irq) which was setup at kvm_irq_chip = creation > time when kvm_setup_default_irq_routing () called for handling ioctl > KVM_CREATE_IRQCHIP. >=20 > So, it isn't clear why level-triggered interrupt isn't supported for ir= qfd > mechanism. > Would greatly appreciate clarification here >=20 > Thanks > -Rukhsana >=20 Mostly, no one came up with an implementation so far. If the point is to use irqfd with vhost-net, there's also a question of adding interfaces to 1. pass IO read transactions directly to another kernel module 2. add an interface to clear the irq level Maybe the right thing is to combine the two somehow: irqfd might get an oiption to set a bit in memory, ioeventfd might get an option to read and clear from memory and clear irqfd line at the same time. --=20 MST