uhyve
uhyve copied to clipboard
add basic virtio support
By add virtio support, does that mean we need to extend uhyve to support PCI devices? Or will this be done through shared memory?
We've been looking through crates, and kvm-ioctl and kvm-bindings should be all we need to support virtio.
What do you mean by shared memory? Hm, I thought that by scanning the IO address space uhyve jump to https://github.com/hermitcore/uhyve/blob/master/src/linux/vcpu.rs#L274
Currently when the pci scan is initiated in libhermit. It jumps to Uhvye Unknown exit reason rather than handle the exit. Currently Uhyve does not handle PCI_CONFIG_ADDRESS_PORT and PCI_CONFIG_DATA_PORT. Are we adding PCI support to Uhvye, or are we connecting the virtio device differently?
No, I think that you have to extend uhyve
Our first goal is to emulate the PCI bus by providing the address and data port catches in Uhvye. This will allow for PCI devices to be detected by libhermit. From there, we will construct a virtio device around it. Does this work?
Yes!
Is there a driver that we should model our device after?
Should we add mmio support next for the virtio device? If so, is there a specific region of memory you would wish the device to use?
I think that MMIO isn't not necessary. I don't use it in in me C driver. As far as I remember it correctly.
Oh, I misspoke. What values should we assign the base registers for iobase, iomem and the irq? Do you have preference?
virtio-queue is definitely worth a look and I will take care of this in my draft implementation.
Side note: GuestMemoryMmap does look like an interesting alternative for the in-house struct.