Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e2db8cc
Merge pull request #156 from syswonder/dev
Inquisitor-201 Jul 9, 2025
91f9f05
[refactor] aarch64: Refactored PCI device passthrough
dallasxy Sep 10, 2025
8b9cc29
Merge remote-tracking branch 'origin/dev' into new_pcie
dallasxy Sep 10, 2025
760e56f
[fixed] Synchronize pci changes to configuration files
dallasxy Sep 10, 2025
9c7ac92
[fixed] The bar remap is no longer mistakenly skipped
dallasxy Sep 10, 2025
7492842
[fixed] Adapt PCI configuration changes for other zones
dallasxy Sep 11, 2025
d395612
[fixed] fmt
dallasxy Sep 11, 2025
0f64e94
[fixed] fix loongarch64 config for pci changes
dallasxy Sep 11, 2025
a5886e4
[fixed] fix ci
dallasxy Sep 11, 2025
e369ee0
[feature] pci:add parse of bridge
dallasxy Sep 11, 2025
6cfd3b2
[build] pci: adjust import method of mod pci
dallasxy Sep 11, 2025
16867d6
[feature] pci: add cap
dallasxy Sep 17, 2025
4e22850
Merge remote-tracking branch 'upstream/dev' into new_pcie
dallasxy Sep 23, 2025
786357b
[fixed] rk3568: Fixed a memory corruption caused by oversized binary …
dallasxy Sep 24, 2025
20a14fb
add get & get_mut for VirtualRootComplex
dallasxy Oct 28, 2025
4423b75
merge new_pcie into dev-x86_64
Solicey Nov 12, 2025
ffb6fb8
Merge branch 'dev-x86_64' into new_pcie
Solicey Nov 12, 2025
8a8a8dd
add frame of dwc and longarch
dallasxy Nov 12, 2025
6394c41
Merge remote-tracking branch 'upstream/new_pcie' into new_pcie
dallasxy Nov 12, 2025
523739e
add dwc_and loongarch for pcie
dallasxy Nov 19, 2025
be122c8
Merge remote-tracking branch 'upstream/dev' into new_pcie
dallasxy Nov 19, 2025
54c8e44
fix rk3568 config
dallasxy Nov 19, 2025
f9251e8
add loongarch64 pcie config
dallasxy Nov 19, 2025
ca79386
fmt
dallasxy Nov 19, 2025
93f35ab
for x86, add time.rs
dallasxy Nov 19, 2025
cffc361
fix wrong base cal for loongarch in get_physical_address
dallasxy Nov 20, 2025
e93d1a3
1.no_pcie_bar_realloc is now working correctly
dallasxy Nov 26, 2025
223ffa0
add function and is_mulitple_function to stack
dallasxy Nov 26, 2025
03aa2c0
[feature] add support for virt pci dev
dallasxy Nov 27, 2025
21833c7
update config for virt pci
dallasxy Nov 27, 2025
25f973c
use get_handler for vpci dev in config
dallasxy Nov 27, 2025
dd6a72c
1. for loongarch, fix the wrong mmio handler register
dallasxy Dec 2, 2025
5478a19
for loongarch, bar page aligned before insert
dallasxy Dec 3, 2025
19c796b
Merge remote-tracking branch 'upstream/dev' into new_pcie
dallasxy Dec 3, 2025
08a227c
fix: fixed loongarch 3a5000 new_pcie compilation error and pagetable …
enkerewpo Dec 4, 2025
9b58483
1. for loongarch, add allocator for bar
dallasxy Dec 4, 2025
d540d3b
Merge remote-tracking branch 'upstream/new_pcie' into new_pcie
dallasxy Dec 4, 2025
ad624bc
for virt dev, update bar and example for mmio register
dallasxy Dec 4, 2025
14fb040
1. update bar init for virt dev
dallasxy Dec 10, 2025
9c46e3b
Update memory size configuration and comment out unused PCI device en…
enkerewpo Dec 11, 2025
767820a
Refactor ROOT_PCI_DEVS to use a slice reference in board.rs and clear…
enkerewpo Dec 11, 2025
b35d9dc
update vdev bar init method
dallasxy Dec 12, 2025
0ec1dcb
1.Replace VirtualPciConfigSpace with ArcRwLockVirtualPciConfigSpace a…
dallasxy Dec 16, 2025
9fdac90
Merge remote-tracking branch 'upstream/new_pcie' into new_pcie
dallasxy Dec 16, 2025
8172829
Fixes the issue of multiple device access in DWC PCIe
dallasxy Dec 16, 2025
cba14d0
remove pci_addr_base
dallasxy Dec 17, 2025
3d1bb0f
1.check size when delete bar region in gpm,no more accidental deletio…
dallasxy Dec 17, 2025
7181b3b
in direct, for root update hardware when write bar
dallasxy Dec 17, 2025
09bfbc1
remove clone from bar access and update interface
dallasxy Dec 23, 2025
2dd3760
1.remove config sapce for vdev and use config value instead
dallasxy Dec 23, 2025
c0ff6f6
updating mem64low when only rw mem64low
dallasxy Dec 23, 2025
61cdcdb
emu class and revision id for pci dev, so that prevent root to use de…
dallasxy Dec 23, 2025
4f47071
change vdev handler interface and set default value for vdev
dallasxy Dec 24, 2025
4f5242d
add cap for vdev
dallasxy Dec 24, 2025
6c9080b
fixed the bug where some bridges were incorrectly removed
dallasxy Dec 24, 2025
eebe224
cover non root atu0 mmio bug
dallasxy Dec 29, 2025
627d1b1
1. add emu rom
dallasxy Dec 31, 2025
3775dff
1.Added hardware emulation for the atu0 limit register
dallasxy Dec 31, 2025
49f0aed
fmt
dallasxy Dec 31, 2025
3c81c21
add domain for pci config
dallasxy Dec 31, 2025
013d64e
added Vbdf generation logic to support discontinuous PCIe devices
dallasxy Dec 31, 2025
6d6b24d
pcie config update
dallasxy Dec 31, 2025
33ba614
adjust log level for pcie
dallasxy Dec 31, 2025
553a9e7
Merge remote-tracking branch 'upstream/dev' into new_pcie
dallasxy Dec 31, 2025
ed8f9a8
update magic version
dallasxy Dec 31, 2025
e139d55
add license and fix warning
dallasxy Dec 31, 2025
3c1deb1
add license for virt dev
dallasxy Dec 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ iommu = [] # supported by: aarch64
pci = [] # supported by: aarch64, loongarch64
print_timestamp = [] # print timestamp when logging

############# PCIe access mechanism ##############
ecam_pcie = [] # Standard ECAM mechanism (default for most platforms)
dwc_pcie = [] # DesignWare PCIe Core mechanism (CFG0/CFG1, used by RK3568)
loongarch64_pcie = [] # LoongArch PCIe mechanism (used by LoongArch platforms)
no_pcie_bar_realloc = []

############# aarch64 ##############
# irqchip driver
gicv2 = []
Expand Down
2 changes: 1 addition & 1 deletion platform/aarch64/imx8mp/configs/zone1-ruxos.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
},
"num_pci_devs": 0,
"alloc_pci_devs": [],
"pci_config": {}
"pci_config": []
}
41 changes: 27 additions & 14 deletions platform/aarch64/qemu-gicv2/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ use crate::{
zone::{GicConfig, Gicv2Config, HvArchZoneConfig},
},
config::*,
pci::vpci_dev::VpciDevType,
};

use crate::pci_dev;

pub const BOARD_NAME: &str = "qemu-gicv2";

pub const BOARD_NCPUS: usize = 4;
Expand Down Expand Up @@ -92,20 +95,30 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
}),
};

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
io_size: 0x10000,
pci_io_base: 0x0,
mem32_base: 0x10000000,
mem32_size: 0x2eff0000,
pci_mem32_base: 0x10000000,
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
};

pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [
HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
io_size: 0x10000,
pci_io_base: 0x0,
mem32_base: 0x10000000,
mem32_size: 0x2eff0000,
pci_mem32_base: 0x10000000,
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
bus_range_begin: 0x0,
bus_range_end: 0xff,
domain: 0x0,
}
];

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: [HvPciDevConfig; 3] = [
pci_dev!(0x0, 0x0, 0x0, 0x0, VpciDevType::Physical),
pci_dev!(0x0, 0x0, 0x1, 0x0, VpciDevType::Physical),
pci_dev!(0x0, 0x0, 0x2, 0x0, VpciDevType::Physical),
];
18 changes: 18 additions & 0 deletions platform/aarch64/qemu-gicv2/image/dts/zone0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@
compatible = "arm,armv8-timer\0arm,armv7-timer";
};

pcie@10000000 {
interrupt-map-mask = <0x1800 0x00 0x00 0x07>;
interrupt-map = <0x00 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x03 0x04 0x00 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x04 0x04 0x00 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x05 0x04 0x00 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x04 0x04 0x800 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x05 0x04 0x800 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x06 0x04 0x800 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x05 0x04 0x1000 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x06 0x04 0x1000 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x03 0x04 0x1000 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x01 0x01 0x00 0x00 0x00 0x06 0x04 0x1800 0x00 0x00 0x02 0x01 0x00 0x00 0x00 0x03 0x04 0x1800 0x00 0x00 0x03 0x01 0x00 0x00 0x00 0x04 0x04 0x1800 0x00 0x00 0x04 0x01 0x00 0x00 0x00 0x05 0x04>;
#interrupt-cells = <0x01>;
ranges = <0x1000000 0x00 0x00 0x00 0x3eff0000 0x00 0x10000
0x2000000 0x00 0x10000000 0x00 0x10000000 0x00 0x2eff0000
0x3000000 0x80 0x00 0x80 0x00 0x80 0x00>;
reg = <0x40 0x10000000 0x00 0x10000000>;
msi-map = <0x00 0x8006 0x00 0x10000>;
dma-coherent;
bus-range = <0x00 0xff>;
linux,pci-domain = <0x00>;
#size-cells = <0x02>;
#address-cells = <0x03>;
device_type = "pci";
compatible = "pci-host-ecam-generic";
};

virtio_mmio@a003a00 {
dma-coherent;
interrupt-parent = <0x01>;
Expand Down
20 changes: 16 additions & 4 deletions platform/aarch64/qemu-gicv3/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ use crate::{
zone::{GicConfig, Gicv3Config, HvArchZoneConfig},
},
config::*,
pci::vpci_dev::VpciDevType,
};

use crate::pci_dev;

pub const BOARD_NAME: &str = "qemu-gicv3";

pub const BOARD_NCPUS: usize = 4;
Expand Down Expand Up @@ -51,7 +55,7 @@ pub const ROOT_ZONE_CPUS: u64 = (1 << 0) | (1 << 1);

pub const ROOT_ZONE_NAME: &str = "root-linux";

pub const ROOT_ZONE_MEMORY_REGIONS: [HvConfigMemoryRegion; 3] = [
pub const ROOT_ZONE_MEMORY_REGIONS: &[HvConfigMemoryRegion] = &[
HvConfigMemoryRegion {
mem_type: MEM_TYPE_RAM,
physical_start: 0x50000000,
Expand Down Expand Up @@ -89,7 +93,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
}),
};

pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [HvPciConfig {
ecam_base: 0x4010000000,
ecam_size: 0x10000000,
io_base: 0x3eff0000,
Expand All @@ -101,8 +105,16 @@ pub const ROOT_PCI_CONFIG: HvPciConfig = HvPciConfig {
mem64_base: 0x8000000000,
mem64_size: 0x8000000000,
pci_mem64_base: 0x8000000000,
};
bus_range_begin: 0,
bus_range_end: 0xff,
domain: 0x0,
}];

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];

pub const ROOT_PCI_DEVS: [u64; 2] = [0, 1 << 3];
pub const ROOT_PCI_DEVS: &[HvPciDevConfig] = &[
pci_dev!(0x0, 0x0, 0x0, 0x0, VpciDevType::Physical),
pci_dev!(0x0, 0x0, 0x1, 0x0, VpciDevType::Physical),
pci_dev!(0x0, 0x0, 0x2, 0x0, VpciDevType::Physical),
pci_dev!(0x0, 0x0, 0x5, 0x0, VpciDevType::StandardVdev),
];
1 change: 1 addition & 0 deletions platform/aarch64/qemu-gicv3/cargo/features
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ gicv3
pl011
iommu
pci
ecam_pcie
46 changes: 28 additions & 18 deletions platform/aarch64/qemu-gicv3/configs/zone1-linux.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"arch": "arm64",
"name": "linux2",
"zone_id": 1,
"cpus": [2, 3],
Expand All @@ -12,22 +11,15 @@
},
{
"type": "virtio",
"physical_start": "0xa003800",
"virtual_start": "0xa003800",
"size": "0x200"
},
{
"type": "virtio",
"physical_start": "0xa003c00",
"virtual_start": "0xa003c00",
"size": "0x200"
"physical_start": "0xa000000",
"virtual_start": "0xa000000",
"size": "0x4000"
}
],
"interrupts": [76, 78],
"ivc_configs": [],
"kernel_filepath": "Image",
"kernel_args": "",
"dtb_filepath": "zone1-linux.dtb",
"kernel_filepath": "./Image",
"dtb_filepath": "./linux2.dtb",
"kernel_load_paddr": "0x50400000",
"dtb_load_paddr": "0x50000000",
"entry_point": "0x50400000",
Expand All @@ -38,9 +30,10 @@
"gicr_base": "0x80a0000",
"gicr_size": "0xf60000",
"gits_base": "0x8080000",
"gits_size": "0x20000"
"gits_size": "0x20000",
"is_aarch32": false
},
"pci_config": {
"pci_config": [{
"ecam_base": "0x4010000000",
"ecam_size": "0x10000000",
"io_base": "0x3eff0000",
Expand All @@ -51,8 +44,25 @@
"pci_mem32_base": "0x10000000",
"mem64_base": "0x8000000000",
"mem64_size": "0x8000000000",
"pci_mem64_base": "0x8000000000"
},
"pci_mem64_base": "0x8000000000",
"bus_range_begin": "0x0",
"bus_range_end": "0x1f"
}],
"num_pci_devs": 2,
"alloc_pci_devs": [0, 16]
"alloc_pci_devs": [
{
"domain": "0x0",
"bus": "0x0",
"device": "0x0",
"function": "0x0",
"dev_type": "0"
},
{
"domain": "0x0",
"bus": "0x0",
"device": "0x1",
"function": "0x0",
"dev_type": "0"
}
]
}
Loading
Loading