Skip to content

Commit

Permalink
dragonball: introduce pci msi/msix interrupt
Browse files Browse the repository at this point in the history
introduce msi/msix mod 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.

fixes: #8661

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 19, 2023
1 parent a998e89 commit 2f8d858
Show file tree
Hide file tree
Showing 6 changed files with 1,300 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/dragonball/src/dbs_interrupt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,11 @@ pub trait InterruptSourceGroup: Send + Sync {
false
}
}

impl PartialEq for dyn InterruptSourceGroup {
fn eq(&self, other: &dyn InterruptSourceGroup) -> bool {
self.interrupt_type() == other.interrupt_type()
&& self.len() == other.len()
&& self.base() == other.base()
}
}
4 changes: 4 additions & 0 deletions src/dragonball/src/dbs_pci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ log = "0.4.14"
downcast-rs = "1.2.0"
byteorder = "1.4.3"
thiserror = "1"
vm-memory = "0.10.0"

[dev-dependencies]
kvm-ioctls = "0.12.0"
6 changes: 5 additions & 1 deletion src/dragonball/src/dbs_pci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ There are several components in `dbs-pci` crate building together to emulate PCI

4. 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.

5. root device mod: A pseudo PCI root device to manage accessing to PCI configuration space.
5. root device mod: a pseudo PCI root device to manage accessing to PCI configuration space.

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

mod msi;
mod msix;

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

0 comments on commit 2f8d858

Please sign in to comment.