public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dor Laor <dor.laor@gmail.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rusycorp.com.au>,
	virtualization@lists.osdl.org, kvm-devel@lists.sourceforge.net
Subject: Re: [kvm-devel] [PATCH 3/3] virtio PCI device
Date: Fri, 09 Nov 2007 02:39:22 +0200	[thread overview]
Message-ID: <4733AC3A.20701@qumranet.com> (raw)
In-Reply-To: <11944900163817-git-send-email-aliguori@us.ibm.com>

Anthony Liguori wrote:
> This is a PCI device that implements a transport for virtio.  It allows virtio
> devices to be used by QEMU based VMMs like KVM or Xen.
>
> ....
>   
While it's a little premature, we can start thinking of irq path 
improvements.
The current patch acks a private isr and afterwards apic eoi will also 
be hit since its
a level trig irq. This means 2 vmexits per irq.
We can start with regular pci irqs and move afterwards to msi.
Some other ugly hack options [we're better use msi]:
    - Read the eoi directly from apic and save the first private isr ack
    - Convert the specific irq line to edge triggered and dont share it
What do you guys think?
> +/* A small wrapper to also acknowledge the interrupt when it's handled.
> + * I really need an EIO hook for the vring so I can ack the interrupt once we
> + * know that we'll be handling the IRQ but before we invoke the callback since
> + * the callback may notify the host which results in the host attempting to
> + * raise an interrupt that we would then mask once we acknowledged the
> + * interrupt. */
> +static irqreturn_t vp_interrupt(int irq, void *opaque)
> +{
> +	struct virtio_pci_device *vp_dev = opaque;
> +	struct virtio_pci_vq_info *info;
> +	irqreturn_t ret = IRQ_NONE;
> +	u8 isr;
> +
> +	/* reading the ISR has the effect of also clearing it so it's very
> +	 * important to save off the value. */
> +	isr = ioread8(vp_dev->ioaddr + VIRTIO_PCI_ISR);
> +
> +	/* It's definitely not us if the ISR was not high */
> +	if (!isr)
> +		return IRQ_NONE;
> +
> +	spin_lock(&vp_dev->lock);
> +	list_for_each_entry(info, &vp_dev->virtqueues, node) {
> +		if (vring_interrupt(irq, info->vq) == IRQ_HANDLED)
> +			ret = IRQ_HANDLED;
> +	}
> +	spin_unlock(&vp_dev->lock);
> +
> +	return ret;
> +}
>   


  parent reply	other threads:[~2007-11-09  1:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-08  2:46 [PATCH 0/3] virtio PCI driver Anthony Liguori
2007-11-08  2:46 ` [PATCH 1/3] Export vring functions for modules to use Anthony Liguori
2007-11-08  2:46   ` [PATCH 2/3] Put the virtio under the virtualization menu Anthony Liguori
2007-11-08  2:46     ` [PATCH 3/3] virtio PCI device Anthony Liguori
2007-11-08  6:12       ` [kvm-devel] " Avi Kivity
2007-11-08 13:54         ` Anthony Liguori
2007-11-08 14:37           ` Avi Kivity
2007-11-08 15:06             ` Anthony Liguori
2007-11-08 15:13               ` Avi Kivity
2007-11-08 23:43           ` Dor Laor
2007-11-08 17:46       ` Arnd Bergmann
2007-11-08 19:04         ` Anthony Liguori
2007-11-09 11:03           ` Arnd Bergmann
2007-11-09  0:39       ` Dor Laor [this message]
2007-11-09  2:17         ` Anthony Liguori
2007-11-20 15:01       ` Avi Kivity
2007-11-20 15:43         ` Anthony Liguori
2007-11-20 16:12           ` Avi Kivity
2007-11-20 22:16             ` Anthony Liguori
2007-11-21  7:13               ` Avi Kivity
2007-11-21 18:22                 ` Zachary Amsden
2007-11-22  7:32                   ` Avi Kivity
2007-11-23 16:51                 ` Anthony Liguori
2007-11-23 17:47                   ` Avi Kivity
2007-11-26 19:18                     ` Anthony Liguori
2007-11-27  9:02                       ` Avi Kivity
2007-11-27  9:09                         ` Carsten Otte
2007-11-27  9:27                           ` Avi Kivity
2007-11-27 10:12                             ` Carsten Otte
2007-11-27 10:19                               ` Avi Kivity
2007-11-27 10:28                                 ` Carsten Otte
2007-11-27  9:25                         ` Arnd Bergmann
2007-11-08  6:49     ` [kvm-devel] [PATCH 2/3] Put the virtio under the virtualization menu Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4733AC3A.20701@qumranet.com \
    --to=dor.laor@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=dor.laor@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rusycorp.com.au \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox