In order to support the pci bus for virtio devices, move the pci system manager from vfio manager to device manager, thus it can be shared by both of vfio and virtio pci devices. Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
dbs-pci
Introduction
dbs-pci is a crate for emulating PCI device.
There are several components in dbs-pci crate building together to emulate PCI device behavior :
-
device mod: mainly provide the trait for
PciDevice, providing the ability to get id, write PCI configuration space, read PCI configuration space andas_anyto downcast the trait object to the actual device type. -
configuration mod: simulate PCI device configuration header and manage PCI Bar configuration. The PCI Specification defines the organization of the 256-byte Configuration Space registers and imposes a specific template for the space. The first 64 bytes of configuration space are standardized as configuration space header.
-
bus mod: simulate PCI buses, to simplify the implementation, PCI hierarchy is not supported. So all PCI devices are directly connected to the PCI root bus. PCI Bus has bus id, PCI devices attached and PCI bus I/O port, I/O mem resource use condition.
-
root bus mod: mainly for emulating PCI root bridge and also create the PCI root bus with the given bus ID with the PCI root bridge.
-
root device mod: a pseudo PCI root device to manage accessing to PCI configuration space.
-
msimod: struct to maintain information for PCI Message Signaled Interrupt Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities. -
msixmod: struct to maintain information for PCI Message Signaled Interrupt Extended Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities. -
vfiomod:vfiomod collects lots of information related to thevfiooperations. a.vfiomsiandmsixcapability and state b.vfiointerrupt information c. PCI region information d.vfioPCI device information and state