dragonball: introduce vfio support

vfio mod collects lots of information related to the vfio operations, including VfioMsi and VfioMsix capability & state,
vfio interrupt info, pci region infor and vfio pci device info & state.

fixes: #8722

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
Signed-off-by: Shifang Feng <fengshifang@linux.alibaba.com>
Signed-off-by: Yang Su <yang.su@linux.alibaba.com>
Signed-off-by: Zha Bin <zhabin@linux.alibaba.com>
Signed-off-by: Xin Lin <jingshan@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
This commit is contained in:
Chao Wu 2023-12-06 12:11:21 +08:00
parent 3a3f39aa2d
commit 9c13b2c990
4 changed files with 1990 additions and 4 deletions

View File

@ -11,14 +11,21 @@ keywords = ["dragonball", "secure-sandbox", "devices", "pci"]
readme = "README.md" readme = "README.md"
[dependencies] [dependencies]
log = "0.4.14"
thiserror = "1"
dbs-allocator = { path = "../dbs_allocator" }
dbs-boot = { path = "../dbs_boot" }
dbs-device = { path = "../dbs_device" } dbs-device = { path = "../dbs_device" }
dbs-interrupt = { path = "../dbs_interrupt", features = ["kvm-irq", "kvm-legacy-irq", "kvm-msi-irq"] } dbs-interrupt = { path = "../dbs_interrupt", features = ["kvm-irq", "kvm-legacy-irq", "kvm-msi-irq"] }
dbs-allocator = { path = "../dbs_allocator" }
log = "0.4.14"
downcast-rs = "1.2.0" downcast-rs = "1.2.0"
byteorder = "1.4.3" byteorder = "1.4.3"
thiserror = "1"
vm-memory = "0.10.0" vm-memory = "0.10.0"
kvm-ioctls = "0.12.0"
kvm-bindings = "0.6.0"
vfio-ioctls = "0.1.0"
vfio-bindings = "0.3.0"
libc = "0.2.39"
[dev-dependencies] [dev-dependencies]
dbs-arch = { path = "../dbs_arch" }
kvm-ioctls = "0.12.0" kvm-ioctls = "0.12.0"

View File

@ -19,3 +19,9 @@ There are several components in `dbs-pci` crate building together to emulate PCI
6. `msi` mod: struct to maintain information for PCI Message Signalled Interrupt Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities. 6. `msi` mod: struct to maintain information for PCI Message Signalled Interrupt Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities.
7. `msix` mod: struct to maintain information for PCI Message Signalled Interrupt Extended Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities. 7. `msix` mod: struct to maintain information for PCI Message Signalled Interrupt Extended Capability. It will be initialized when parsing PCI configuration space and used when getting interrupt capabilities.
8. `vfio` mod: `vfio` mod collects lots of information related to the `vfio` operations.
a. `vfio` `msi` and `msix` capability and state
b. `vfio` interrupt information
c. PCI region information
d. `vfio` PCI device information and state

View File

@ -48,7 +48,12 @@ mod root_device;
pub use root_device::PciRootDevice; pub use root_device::PciRootDevice;
mod msi; mod msi;
pub use msi::{MsiCap, MsiState};
mod msix; mod msix;
pub use msix::{MsixCap, MsixState, MSIX_TABLE_ENTRY_SIZE};
mod vfio;
/// Error codes related to PCI root/bus/device operations. /// Error codes related to PCI root/bus/device operations.
#[derive(Debug, thiserror::Error)] #[derive(Debug, thiserror::Error)]

File diff suppressed because it is too large Load Diff