From: Tom Rotenberg Subject: When doing PT for a device, fails to bind the interrupt, if the specified irq is *not* PT_MACHINE_IRQ_AUTO Date: Mon, 17 Aug 2009 12:39:03 +0300 Message-ID: <8686c3cd0908170239o57abe58dg72686148dd13a261@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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