Changes since previous version:
- Refactored the discovery of the shm regions, taking into account
  Waldek's input. I think this results in simpler code: the generic PCI
  code (drivers/pci-function.cc) returns the offsets of all capabilities
  of a given device and the virtio code (drivers/virtio-pci-device.cc)
  iterates over them and parses the capabilities it expects. Also, this
  should be somewhat more efficient, since there are no redundant calls
  to pci::function::pci_read*() (that probably cause VM exits).
- Exposed the shared memory regions in the public interface of
  virtio::virtio_device. Note that the corresponding implementations for
  legacy PCI devices and MMIO devices are stubs: shm regions are not
  supported on legaci PCI and MMIO is TODO (not urgent since there is no
  VMM implementing virtio shared memory regions over MMIO right now that
  I am aware of).

Please take a look, I will be glad to discuss further.

A note on performance: I did some rough comparison of current master
(752b6bb8b2fe01d693b9ffb751669ec476771087) and this, on QEMU, with a
single virtio-fs device. Boot times were pretty much equivalent: around
405 ms median in 6 runs each, so it seems that at least the discovery of
the shm regions as well as the refactor did not introduce a regression
there.
I did not compare against legacy virtio PCI because I am not sure how
fair that would be, I don't have a clear image of the legacy
implementation and wouldn't know what to expect out of such a comparison
to be honest.

Fotis Xenakis (3):
  pci: add batch capability discovery
  virtio-pci: discover shared memory regions
  virtio: expose shared memory regions

 drivers/pci-function.cc      |  39 +++++++++--
 drivers/pci-function.hh      |   1 +
 drivers/virtio-device.hh     |   2 +
 drivers/virtio-mmio.hh       |   1 +
 drivers/virtio-pci-device.cc | 121 ++++++++++++++++++++++++++++-------
 drivers/virtio-pci-device.hh |  47 +++++++++-----
 6 files changed, 167 insertions(+), 44 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/VI1PR03MB438309ECC779226D73AE1355A6F80%40VI1PR03MB4383.eurprd03.prod.outlook.com.

Reply via email to