Skip to content

Make ivshmem more generic not only a PCI device

Goal

Currently ivshmem device tailored for use only as a PCI device and mostly for the x86 targets. It would be tremendously helpful to make it more generic, allowing it to attach also as MMIO device, attached to some address, using both API and object options. Thus, ARM, MIPS, RISC-V, etc targets could tremendously benefit, especially those heterogenous multicore SoCs with the physical shared memory.

Technical details

Idea is to allow using API like that:

object_initialize_child(obj, "myshr", &s->shr, TYPE_IVSHMEM_MMIO);
...
dev = DEVICE(&(s->shr));
if (!sysbus_realize(SYS_BUS_DEVICE(&s->shr), errp)) {
    return;
}
busdev = SYS_BUS_DEVICE(dev);
sysbus_mmio_map(busdev, 0, some_addr);

Moreover, the same but with the object options:

-device ivshmem-mmio,memdev=memory-backend-file,memaddr=0x10000000
-object memory-backend-file,size=1M,share,mem-path=/dev/shm/ivshmem,id=hostmem

where 0x10000000 is the address where to map our device in the guest address space.

Additional information

It will also benefit from making it more portable, see #666

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information