Skip to content

Commit

Permalink
dragonball: introduce vfio support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
studychao committed Dec 25, 2023
1 parent 3a3f39a commit 726ce40
Show file tree
Hide file tree
Showing 4 changed files with 1,939 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/dragonball/src/dbs_pci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,21 @@ keywords = ["dragonball", "secure-sandbox", "devices", "pci"]
readme = "README.md"

[dependencies]
anyhow = "1"
log = "0.4.14"
thiserror = "1"
dbs-allocator = { path = "../dbs_allocator" }
dbs-device = { path = "../dbs_device" }
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"
byteorder = "1.4.3"
thiserror = "1"
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]
dbs-arch = { path = "../dbs_arch" }
kvm-ioctls = "0.12.0"
8 changes: 7 additions & 1 deletion src/dragonball/src/dbs_pci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ 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.

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
4 changes: 4 additions & 0 deletions src/dragonball/src/dbs_pci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ mod root_device;
pub use root_device::PciRootDevice;

mod msi;
pub use msi::{MsiCap, MsiState};
mod msix;
pub use msix::{MsixCap, MsixState, MSIX_TABLE_ENTRY_SIZE};

mod vfio;

/// Error codes related to PCI root/bus/device operations.
#[derive(Debug, thiserror::Error)]
Expand Down

0 comments on commit 726ce40

Please sign in to comment.