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

[Xen-devel] When doing PT for a device, fails to bind the interrupt, if the specified irq is *not* PT_MACHINE_IRQ_AUTO


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Tom Rotenberg <tom.rotenberg@xxxxxxxxx>
  • Date: Mon, 17 Aug 2009 12:39:03 +0300
  • Delivery-date: Mon, 17 Aug 2009 02:39:27 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=TMjm/Tq3tn7TIckL7YFBRO9JOZqx8J8y5ko+j1zax8V2Z29FgOLzsvkcNKCX7bHv3E 346v53+71oCJLbKp5a2yMlAjX5BS25JJKd8PUYN/lWxRQGpJgl3sb1IwJt7QG1MMkBCg jGffReUyXt1eb5eZCNgXrPPj7mIpyO8goAW6U=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi,

When i'm doing PT for a device, if i specify the 'PT_MACHINE_IRQ_AUTO'
as the irq for  the device, it works fine. However, if i try and
specify an irq number (even if i specify the same irq , which will
later be selected by the auto-irq method) - it fails to bind the
interrupt.

I looked at the code a little bit, and it looks like, if the irq isn't
PT_MACHINE_IRQ_AUTO, then the call to 'xc_physdev_map_pirq()' won't be
executed. Here is the code:
    if ( PT_MACHINE_IRQ_AUTO == machine_irq )
    {
        int pirq = pci_dev->irq;

        machine_irq = pci_dev->irq;
        rc = xc_physdev_map_pirq(xc_handle, domid, machine_irq, &pirq);

        if ( rc )
        {
            PT_LOG("Error: Mapping irq failed, rc = %d\n", rc);

            /* Disable PCI intx assertion (turn on bit10 of devctl) */
            pci_write_word(pci_dev, PCI_COMMAND,
                *(uint16_t *)(&assigned_device->dev.config[PCI_COMMAND])
                | PCI_COMMAND_DISABLE_INTx);
            machine_irq = 0;
            assigned_device->machine_irq = 0;
        }
        else
        {
            machine_irq = pirq;
            assigned_device->machine_irq = pirq;
            mapped_machine_irq[machine_irq]++;
        }
    }


This looks like a bug, no?

Tom

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.