qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] pci: Return PCI_INTX_DISABLED when no bus INTx routing support
Date: Wed, 17 Oct 2012 20:40:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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 <address@hidden>
> ---
> 
> 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

> 
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]