All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx routing support
Date: Wed, 17 Oct 2012 21:48:52 +0200	[thread overview]
Message-ID: <20121017194852.GA8629@redhat.com> (raw)
In-Reply-To: <507EFB85.5030206@siemens.com>

On Wed, Oct 17, 2012 at 08:40:05PM +0200, Jan Kiszka wrote:
> On 2012-10-17 20:25, Alex Williamson wrote:
> > Rather than assert, simply return PCI_INTX_DISABLED when we don't
> > have a pci_route_irq_fn.  PIIX already returns DISABLED for an
> > invalid pin, so users already deal with this state.  Users of this
> > interface should only be acting on an ENABLED or INVERTED return
> > value (though we really have no support for INVERTED).
> > 
> > Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> > ---
> > 
> > A compromise to the gridlock; defuse the assert, but don't add
> > a new state to the API.  Thanks,
> 
> But how do you tell "unsupported" apart from "disabled" in VFIO? If the
> chipset truly disabled the line, you must not provide it to the guest in
> some other way.
> 
> Jan

vfio does not care. It merely disables irqfd and delivers irqs to qemu.

> > 
> > Alex
> > 
> >  hw/pci.c |    6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/hw/pci.c b/hw/pci.c
> > index 83d262a..9525220 100644
> > --- a/hw/pci.c
> > +++ b/hw/pci.c
> > @@ -1094,7 +1094,11 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
> >           pin = bus->map_irq(dev, pin);
> >           dev = bus->parent_dev;
> >      } while (dev);
> > -    assert(bus->route_intx_to_irq);
> > +
> > +    if (!bus->route_intx_to_irq) {
> > +        return (PCIINTxRoute) { PCI_INTX_DISABLED, -1 };
> > +    }
> > +
> >      return bus->route_intx_to_irq(bus->irq_opaque, pin);
> >  }
> >  
> > 
> 
> -- 
> Siemens AG, Corporate Technology, CT RTC ITP SDP-DE
> Corporate Competence Center Embedded Linux

      parent reply	other threads:[~2012-10-17 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 18:25 [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx routing support Alex Williamson
2012-10-17 18:40 ` Jan Kiszka
2012-10-17 18:54   ` Alex Williamson
2012-10-17 19:08     ` Michael S. Tsirkin
2012-10-17 19:48   ` 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=20121017194852.GA8629@redhat.com \
    --to=mst@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.