I\'ve written a small PCI device in QEMU using https://github.com/qemu/qemu/blob/v2.7.0/hw/misc/edu.c as a base, and https://github.com/cirosantilli/linux-kernel-module-chea