This is groundwork for supporting DAX windows in the virtio-fs driver. It just adds the code to discover shared memory regions (for the modern PCI transport only, which is used by the current implementation of virtio-fs in QEMU), but does not yet expose them to the driver.
The overall process of using the DAX window consists of: 1. Discovering the (optional) shared memory region offered by the virtio device. This is transport-specific. 2. Mapping the region in virtual memory as necessary. 3. Using it in the driver with the custom FUSE_SETUPMAPPING, FUSE_REMOVEMAPPING requests as per the virtio-fs spec. My next step is #2 above, mapping the device memory. For PCI at least, this might be automatic with the current implementation: the memory region is represented with a PCI BAR, which the current seems to be mapped automatically, using pci::bar::map(). I need to look more into this though, to get a better grasp of virtual memory in OSv. Any references here would be welcome! Since this is my first patch, please feel free to point out any omission and room for improvement. References: [1] The official (draft) virtio specification: https://github.com/oasis-tcs/virtio-spec [2] A comprehensive summary of PCI configuration space: https://wiki.osdev.org/Pci Fotis Xenakis (2): pci: allow 64-bit BAR offsets virtio-pci: discover shared memory regions drivers/pci-function.cc | 31 ++++++-------- drivers/pci-function.hh | 19 ++++----- drivers/virtio-pci-device.cc | 78 +++++++++++++++++++++++++++++------- drivers/virtio-pci-device.hh | 44 +++++++++++++------- 4 files changed, 114 insertions(+), 58 deletions(-) -- 2.25.1 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/VI1PR03MB4383D61AE94EC977F154E192A6E10%40VI1PR03MB4383.eurprd03.prod.outlook.com.