PCI drivers and interrupts

Kenneth Adam Miller kennethadammiller at gmail.com
Fri Nov 4 06:15:26 EDT 2016


I'm trying to author a driver that communicates over shared memory
within the kernel land between concurrent userland processes. I'm
using this as a base:


I've been able to build it and to insmod it into a linux that I have
built and started running in qemu. I need a way to send an interrupt,
as per the documentation mentions in the device_spec and in the guide.
But I'm looking in the uio_ivshmem driver and I don't see
functionality that corresponds to sending an interrupt at all. This
functionality is supposed to be demonstrated in
but this is problematic because it seems to indicate that one of the
ioctls corresponds to an interrupt. Unless there's something I'm
missing, I think that the stub pci driver implementation that this
particular demo filled out implements some kind of interrupt, or else
it's actually implemented with one of the function calls on line 28 or
43. But those each seem to correspond to interrupt handlers for
receiving from other QEMU instances, with no sign of how they are

I need to write a function in the context of the driver that can be
compiled in the same code, meaning editing uio_ivshmem.c and yielding
some function interface like send_interrupt(int index), where index
corresponds to the BAR against which the driver registers irq handlers

How can I send interrupts from the kernel land using a particular BAR entry?

More information about the Kernelnewbies mailing list