-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dragonball: init dbs-pci lib with pci bus & pci conf
This commit inits dbs-pci lib for Dragonball to use. It contains several implementation now: 1. PCI configuration space 2. PCI bus More info of the design & behavior of those two features could be found in the README of dbs-cli. fixes: #8479 Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
- Loading branch information
Showing
7 changed files
with
2,586 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
target | ||
.idea | ||
src/dbs_*/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[package] | ||
name = "dbs-pci" | ||
version = "0.1.0" | ||
authors = ["Alibaba Dragonball Team"] | ||
license = "Apache-2.0" | ||
edition = "2018" | ||
description = "dbs-pci is a crate for emulating pci device" | ||
homepage = "https://github.com/openanolis/dragonball-sandbox" | ||
repository = "https://github.com/openanolis/dragonball-sandbox/tree/main/crates/dbs-pci" | ||
keywords = ["dragonball", "secure-sandbox", "devices", "pci"] | ||
readme = "README.md" | ||
|
||
[dependencies] | ||
dbs-device = { path = "../dbs_device" } | ||
dbs-interrupt = { path = "../dbs_interrupt", features = ["kvm-irq"] } | ||
dbs-allocator = { path = "../dbs_allocator" } | ||
log = "0.4.14" | ||
downcast-rs = "1.2.0" | ||
byteorder = "1.4.3" | ||
thiserror = "1" | ||
|
||
[features] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 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 behaviour : | ||
|
||
1. device mod: mainly provide the trait for `PciDevice`, providing the ability to get id, write PCI configuration space, read PCI configuration space and `as_any` to downcast the trait object to the actual device type. | ||
|
||
2. 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 byets of configuration space are standardardized as configuration space header. | ||
|
||
3. 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. PciBus has bus id, pci devices attached and pci bus ioport, iomem resource use condition. |
Oops, something went wrong.