Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [PATCH for qemu-kvm-1.2] pci-assign: Use proper pin number for INTx-to-IRQ routing
Date: Wed, 29 Aug 2012 16:02:07 +0300	[thread overview]
Message-ID: <20120829130207.GA6506@redhat.com> (raw)
In-Reply-To: <503DFCB8.8000407@siemens.com>

On Wed, Aug 29, 2012 at 01:27:52PM +0200, Jan Kiszka wrote:
> Broken by commit e21f28b497.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  hw/kvm/pci-assign.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c
> index 9cce02c..fea05b4 100644
> --- a/hw/kvm/pci-assign.c
> +++ b/hw/kvm/pci-assign.c
> @@ -892,7 +892,7 @@ static int assign_intx(AssignedDevice *dev)
>      pci_device_set_intx_routing_notifier(&dev->dev,
>                                           assigned_dev_update_irq_routing);
>  
> -    intx_route = pci_device_route_intx_to_irq(&dev->dev, 0);
> +    intx_route = pci_device_route_intx_to_irq(&dev->dev, dev->intpin);
>      assert(intx_route.mode != PCI_INTX_INVERTED);
>  
>      if (dev->intx_route.mode == intx_route.mode &&


Hmm but looking at it, I see a different problem:

   /* handle interrupt routing */
    e_intx = dev->dev.config[0x3d] - 1;
    dev->intpin = e_intx;

PCI spec however says:

PCI defines one interrupt line for a single function device and up to
four interrupt lines for a multi-function6 device or connector. For a
single function device, only INTA# may be used while the other three
interrupt lines have no meaning.

And:
	When several independent functions are integrated into a single
	device, it will be referred to as a multi-
	function device. Each function on a multi-function device has its own
	configuration space.

So this is not easily virtualizeable.
I think in practice it should be only legal to assign
VFs or all functions of a physical device in one go.

In last case, we can then make sure function numbers match.

Alex?

> -- 
> 1.7.3.4

      reply	other threads:[~2012-08-29 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-29 11:27 [PATCH for qemu-kvm-1.2] pci-assign: Use proper pin number for INTx-to-IRQ routing Jan Kiszka
2012-08-29 13:02 ` Michael S. Tsirkin [this message]

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=20120829130207.GA6506@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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