At 09/06/2011 03:45 PM, Avi Kivity Write: > On 09/06/2011 06:06 AM, Wen Congyang wrote: >> > Use the uio driver - >> > http://docs.blackfin.uclinux.org/kernel/generated/uio-howto/. You >> just >> > mmap() the BAR from userspace and play with it. >> >> When I try to bind ivshmem to uio_pci_generic, I get the following >> messages: >> uio_pci_generic 0000:01:01.0: No IRQ assigned to device: no support >> for interrupts? >> > > No idea what this means.
PCI 3.0 6.2.4 For x86 based PCs, the values in this register correspond to IRQ numbers (0-15) of the standard dual 8259 configuration. The value 255 is defined as meaning "unknown" or "no connection" to the interrupt controller. Values between 15 and 254 are reserved. The register is interrupt line. I read the config of this device, the interrupt line is 0. It means that it uses the IRQ0. The following is the uio_pci_generic's code: static int __devinit probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct uio_pci_generic_dev *gdev; int err; err = pci_enable_device(pdev); if (err) { dev_err(&pdev->dev, "%s: pci_enable_device failed: %d\n", __func__, err); return err; } if (!pdev->irq) { dev_warn(&pdev->dev, "No IRQ assigned to device: " "no support for interrupts?\n"); pci_disable_device(pdev); return -ENODEV; } ... } This function will be called when we write 'domain:bus:slot.function' to /sys/bus/pci/drivers/uio_pci_generic/bind. pdev->irq is 0, it means the device uses IRQ0. But we refuse it. I do not why. To Michael S. Tsirkin This code is writen by you. Do you know why you check whether pdev->irq is 0? Thanks Wen Congyang >