Skip to content
Merged
Show file tree
Hide file tree
Changes from 107 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
41841c5
riscv64: init megrez board
liulog Jun 20, 2025
ca740dd
riscv64: add platform megrez
liulog Jun 20, 2025
025a13f
riscv64: support megrez's zone0 start
liulog Jun 29, 2025
10fcac3
riscv64 megrez: zone0 can run into shell
liulog Jul 2, 2025
5b90713
update spin from v0.9 to v0.10.0
liulog Jul 2, 2025
de926c4
riscv64: add eic770x_soc feature
liulog Jul 2, 2025
a203772
riscv64: support dynamic detection of g-stage mode
liulog Jul 6, 2025
de85541
riscv64: make fmt
liulog Jul 7, 2025
149c991
riscv64: modify zone.pt_init func
liulog Jul 7, 2025
6fb97b1
riscv64: initialize the relevant configurations for starting zone1
CHonghaohao Jul 7, 2025
ab83d74
riscv64: fix idle binary code
liulog Jul 8, 2025
73cd985
riscv64: support zone1 start with virtio
liulog Jul 9, 2025
c61ba37
riscv64: support zone1 to start using the physical serial port uart2
CHonghaohao Jul 10, 2025
999110d
riscv64: support passthrough sata to zone1
liulog Jul 11, 2025
7a196e9
riscv64: init hifive-premier-p550
liulog Jul 15, 2025
b498d1b
update Makefile
liulog Jul 15, 2025
b6fc456
update some comments
liulog Jul 15, 2025
eb0465d
make fmt
liulog Jul 15, 2025
5122f80
Merge branch 'dev' into megrez
liulog Jul 15, 2025
bfb67e6
feature: Remove rockchip MPIDR feature and add generic MPIDR mapping
Inquisitor-201 Jul 10, 2025
2683b39
features: Unify UART base address configuration across platforms
Inquisitor-201 Jul 15, 2025
1e9c5c2
mmu.rs: Refactor boot-pt initializing code
Inquisitor-201 Jul 16, 2025
c3219e9
feature: Remove gic version feature in arch/aarch64.
ForeverYolo Jul 16, 2025
d09550c
riscv64: enable ethernet support for zone0 and zone1
CHonghaohao Jul 17, 2025
f00decc
fix. loongarch: disable trap return timer injection and compensation …
enkerewpo Jul 17, 2025
35905b8
riscv64: mv clear_bss to entry assembly code
liulog Jul 18, 2025
7688874
riscv64: add fence w,w
liulog Jul 18, 2025
621ce50
riscv64: add some comments for entry.rs
liulog Jul 18, 2025
77d1fa1
riscv64: fix assembly code in entry.rs
liulog Jul 18, 2025
c9c84ca
feature: Centralize iommu features in the iommu file.
ForeverYolo Jul 19, 2025
7eeb1d4
bug-fix: fix fmt and iommu compile error in risc-v.
ForeverYolo Jul 19, 2025
5d8a93b
bug-fix: fix iommu compile error in risc-v.
ForeverYolo Jul 19, 2025
0b2df19
bug-fix: add iommu.rs.
ForeverYolo Jul 19, 2025
b4eaabc
Merge pull request #180 from liulog/fix-deadlock
Inquisitor-201 Jul 19, 2025
77cde1b
bug fix: Fix rk3588/ok6254-c board configures to pass CI build-tests
Inquisitor-201 Jul 19, 2025
b69a941
Update dependencies and enhance loongarch64 support with new device t…
enkerewpo Jul 20, 2025
179f30f
Merge branch 'syswonder:dev' into dev
enkerewpo Jul 20, 2025
773d51b
feature: Remove arch feature in event.rs.
ForeverYolo Jul 20, 2025
f534a81
bug-fix: Fix fmt.
ForeverYolo Jul 20, 2025
cbea0de
Merge remote-tracking branch 'origin/clk/dev' into clk/dev
ForeverYolo Jul 20, 2025
b6d9a96
bug-fix: Fix compile error in risc-v platform.
ForeverYolo Jul 20, 2025
d05650b
feature: Remove arch feature in percpu.rs.
ForeverYolo Jul 20, 2025
f37f719
bug-fix: Fix fmt.
ForeverYolo Jul 20, 2025
3634155
feature: Remove the missing arch feature in event.rs.
ForeverYolo Jul 21, 2025
cde255e
bug-fix: Fix compile error in loongarch platform.
ForeverYolo Jul 21, 2025
4ccaf87
Add support for loongson_3a5000 and loongson_3a6000 platforms
enkerewpo Jul 21, 2025
631c2dc
platform: change BOARD_PHYSMEM_LIST to slice and expand rk3588 memory
Inquisitor-201 Jul 22, 2025
24605a0
Enhance loongarch64 clock and trap handling
enkerewpo Jul 23, 2025
21054b9
Add configuration files for loongarch64 zones
enkerewpo Jul 23, 2025
3eeab20
Update src/arch/loongarch64/clock.rs
enkerewpo Jul 23, 2025
21e6aea
Update src/arch/loongarch64/clock.rs
enkerewpo Jul 23, 2025
8439137
Update platform/loongarch64/ls3a6000/image/dts/include/loongson-3a500…
enkerewpo Jul 23, 2025
821ba03
Update README.md
enkerewpo Jul 24, 2025
e3f6800
Merge pull request #185 from enkerewpo/dev
enkerewpo Jul 24, 2025
e9d8c41
refactor: move plic from zone struct
liulog Jul 26, 2025
b7343d5
modify warn! to info!
liulog Jul 28, 2025
6bad2eb
fix(arch/aarch64/cpu): Correct MPIDR mask and AFF3 shift
Inquisitor-201 Jul 30, 2025
a88478d
feat(arch): add aarch32 support
KouweiLee Aug 2, 2025
fccee08
Merge branch 'dev' of github.com:KouweiLee/hvisor into dev
KouweiLee Aug 2, 2025
3222e3b
fix(arch): correct formatting and add is_aarch32 field for ok6254
KouweiLee Aug 3, 2025
0123c42
Merge pull request #187 from KouweiLee/dev
Inquisitor-201 Aug 4, 2025
a0aef0c
Merge pull request #186 from liulog/refactor
Inquisitor-201 Aug 4, 2025
429474c
Merge remote-tracking branch 'origin/clk/dev' into clk/dev
ForeverYolo Aug 6, 2025
48fcd5d
bug-fix: Fix code style.
ForeverYolo Aug 6, 2025
16ce01e
feature: Remove arch feature in zone.rs.
ForeverYolo Aug 6, 2025
c371b5b
feature: Remove aarch64 feature in main.rs and pci feature in zone.rs.
ForeverYolo Aug 6, 2025
850a94a
feature: Remove loongarch feature in src/pci folder.
ForeverYolo Aug 6, 2025
04a977e
bug-fix: add consts.rs.
ForeverYolo Aug 6, 2025
79c3111
bug-fix: resolve conflict.
ForeverYolo Aug 6, 2025
a98e807
bug-fix: fix code style.
ForeverYolo Aug 6, 2025
c3f301e
bug-fix: fix code style.
ForeverYolo Aug 6, 2025
471a6d6
bug-fix: fix code style.
ForeverYolo Aug 6, 2025
df5b056
Merge branch 'dev' into clk/dev
ForeverYolo Aug 6, 2025
3588bef
feature: remove arch features in src/hypercall folder.
ForeverYolo Aug 7, 2025
cd50a52
Merge remote-tracking branch 'origin/clk/dev' into clk/dev
ForeverYolo Aug 7, 2025
1230968
feature: remove risc-v feature in main.rs.
ForeverYolo Aug 7, 2025
0ac90b9
bug-fix: solve compile error in loongarch/risc-v.
ForeverYolo Aug 8, 2025
45eabbf
bug-fix: solve compile error in loongarch/risc-v.
ForeverYolo Aug 8, 2025
db8d367
bug-fix: fix-fmt
ForeverYolo Aug 8, 2025
70124bd
bug-fix: fix-fmt and fix compile error in loongarch.
ForeverYolo Aug 8, 2025
83d8b7f
bug-fix: fix compile error in loongarch.
ForeverYolo Aug 8, 2025
f1ea0f7
Merge pull request #183 from syswonder/clk/dev
Inquisitor-201 Aug 10, 2025
033c488
fix merge conflict
liulog Aug 12, 2025
6d86641
make fmt
liulog Aug 12, 2025
9e9ebec
riscv64: initial support milk-v megrez board.
liulog Aug 16, 2025
d6dff3b
riscv64: add ccache and syscrg emulation
liulog Aug 21, 2025
4f0e8b3
riscv: add hifive-premier-p550 files
liulog Aug 21, 2025
ba516b8
merge from upstream/dev
liulog Aug 21, 2025
1d69158
fix compile error
liulog Aug 21, 2025
78b6781
Merge branch 'megrez' of github.com:liulog/hvisor into megrez
liulog Aug 21, 2025
2846823
riscv64: refactor aia's code
liulog Aug 24, 2025
d577add
make fmt
liulog Aug 24, 2025
97112b2
riscv64: fix compile error for plic
liulog Aug 24, 2025
ccaf8d6
riscv64: support hifive-premier-p550
liulog Aug 25, 2025
e913029
riscv64: add npu configuration on megrez
CHonghaohao Aug 25, 2025
e198a29
riscv64: fix the conflict between the npu and the ethernet
CHonghaohao Aug 26, 2025
f358db0
riscv64: (megrez) update the device tree to the version dumped from t…
CHonghaohao Aug 26, 2025
91d88db
Merge pull request #189 from liulog/megrez
liulog Aug 28, 2025
2e4ee3b
aarch64: Add support phytium-pi board.
Baozixu99 Aug 26, 2025
21e8568
fix(aarch64/qemu-gicv2): correct memory size and add reserved memory …
agicy Aug 28, 2025
9c841ff
fix(aarch64/qemu-gicv3): correct interrupt controller address in zone…
agicy Aug 30, 2025
4e706f5
feat(aarch64/qemu-gicv2): add configuration files for zone1-linux
agicy Aug 30, 2025
508710d
Merge pull request #190 from agicy/dev
KouweiLee Sep 2, 2025
2b2af04
fix(gicv3): remove unnecessary bit in vmcr calculation
KouweiLee Sep 2, 2025
1b7e90b
fix: update zcu102 config. (#192)
ForeverYolo Sep 3, 2025
2d81688
Merge pull request #188 from Baozixu99/phytium-pi
Inquisitor-201 Sep 4, 2025
5c938ba
Merge pull request #191 from KouweiLee/dev
Inquisitor-201 Sep 4, 2025
50ae5ed
Optimized the parameter expression structure of the interrupt control…
ForeverYolo Sep 7, 2025
16f797e
Fix bug.
ForeverYolo Sep 7, 2025
55d4c5c
Limit the range of constants.
ForeverYolo Sep 8, 2025
eef7bf5
Merge pull request #195 from syswonder/gic_struct_opt
KouweiLee Sep 8, 2025
5b74b86
refactor: enhance GICR handling and initialization logic
Inquisitor-201 Sep 7, 2025
0368068
refactor: update warning messages for hypercall implementations and i…
Inquisitor-201 Sep 7, 2025
f8f0529
Remove unused FDT node and parsing code.
Inquisitor-201 Sep 7, 2025
aef723d
refactor: remove unused FDT dependency from Cargo files
Inquisitor-201 Sep 7, 2025
248b0b0
refactor(zone): Remove `isa_init` in loongarch64 and riscv64; Cargo fmt
Inquisitor-201 Sep 8, 2025
e0246ec
refactor(gicv3): Replace BOARD_MPIDR_MAPPINGS with cpuid_to_mpidr_aff…
Inquisitor-201 Sep 8, 2025
c6b680f
fix: Remove arg `fdt` in init_hv_page_table (LoongArch64)
Inquisitor-201 Sep 8, 2025
103a306
Merge pull request #194 from syswonder/clk/dev
Inquisitor-201 Sep 10, 2025
83e74a7
chore: Update CHANGELOG for version 0.2 with new platform and feature…
Inquisitor-201 Sep 10, 2025
8cca45f
refactor(changelog): Optimize GIC parameters structure
Inquisitor-201 Sep 10, 2025
8491eb0
Update readme
Inquisitor-201 Sep 11, 2025
04f4e67
docs: Update README to enhance device support and roadmap details
Inquisitor-201 Sep 11, 2025
d649d59
Merge pull request #197 from syswonder/clk/dev
Inquisitor-201 Sep 11, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ flash.img*
compile.sh
src/platform/__board.rs
.config
.cursorrules
.vscode/extensions.json

# systemtest
rootfs1.zip*
2 changes: 1 addition & 1 deletion .vscode/settings-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
// "rust-analyzer.cargo.target": "riscv64gc-unknown-none-elf",
// "rust-analyzer.cargo.target": "loongarch64-unknown-none",
"rust-analyzer.cargo.features": [
"gicv3 pl011 iommu pci pt_layout_qemu"
"gicv3 pl011 iommu pci"
]
}
50 changes: 41 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 13 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
log = "0.4"
spin = "0.9"
spin = "0.10.0"
bitflags = "2.1"
bit_field = "0.10"
numeric-enum-macro = "0.2"
Expand All @@ -20,6 +20,7 @@ qemu-exit = "3.0.2"
cortex-a = "8.1.1"
cfg-if = "1.0"
bitvec = { version="1.0.1", default-features = false, features = ["atomic", "alloc"] }
heapless = { version = "0.8.0 "}

[dependencies.fdt-rs]
version = "0.4.5"
Expand All @@ -31,15 +32,15 @@ psci = { version = "0.1.0", default-features = false, features = ["smc"]}

[target.'cfg(target_arch = "riscv64")'.dependencies]
sbi-rt = { version = "0.0.3", features = ["legacy"] }
sbi-spec = "0.0.8"
sbi-spec = { version = "0.0.8", features = ["legacy"]}
riscv = "0.13.0"
riscv_h = { package = "riscv", git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }
riscv-decode = "0.2.1"
riscv-peripheral = "0.2.1"
riscv-pac = "0.2.0"

[target.'cfg(target_arch = "loongarch64")'.dependencies]
loongArch64 = "0.2.4"
loongArch64 = "0.2.5"

[target.'cfg(target_arch = "x86_64")'.dependencies]
x86 = "0.52.0"
Expand All @@ -62,20 +63,8 @@ pl011 = []
xuartps = []
imx_uart = []
uart_16550 = []

# pagetable layout
pt_layout_qemu = []
pt_layout_rk3568 = []
pt_layout_rk3588 = []
pt_layout_zcu102 = []

# cpu
mpidr_rockchip = []

# uart infos
uart_base_rk3568 = []
uart_base_rk3588 = []
uart_base_ok6254 = []
sifive_ccache = []
eic7700_sysreg = []

############## riscv64 #############
# irqchip driver
Expand All @@ -84,13 +73,20 @@ aia = []
aclint = []
# extensions
sstc = []
# platform specific
eic770x_soc = []

########### loongarch64 ############
# irqchip driver
loongson_7a2000 = []
# uart driver
loongson_uart = []
# cpu (not used for now)
loongson_3a5000 = []
loongson_3a6000 = []


[profile.dev]
# panic = "abort" # avoid cargo test failure, this is a bug of cargo
debug = 2
opt-level = 0
2 changes: 2 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ hvisor 是一个用 Rust 实现的 Type-1 裸机虚拟机监控器,采用分
### riscv64

- [x] QEMU virt riscv64
- [x] Milk-V Megrez
- [x] Sifive Hifive Premier P550
- [ ] FPGA 香山(昆明湖)on S2C Prodigy S7-19PS-2
- [ ] FPGA RocketChip on Xilinx Ultrascale+ MPSoC ZCU102

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ hvisor is a Type-1 bare-metal virtual machine monitor implemented in Rust, featu
### riscv64

- [x] QEMU virt riscv64
- [x] Milk-V Megrez
- [x] Sifive Hifive Premier P550
- [ ] FPGA XiangShan(KunMingHu) on S2C Prodigy S7-19PS-2
- [ ] FPGA RocketChip on Xilinx Ultrascale+ MPSoC ZCU102

### loongarch64

- [x] Loongson 3A5000 (7A2000 bridge chip)
- [ ] Loongson 3A6000 (7A2000 bridge chip)
- [x] Loongson 3A6000 (7A2000 bridge chip)

## Getting Started

Expand Down
25 changes: 24 additions & 1 deletion platform/aarch64/imx8mp/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,33 @@
//
// Authors:
//
use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{
arch::{mmu::MemoryType, zone::HvArchZoneConfig},
config::*,
};

pub const BOARD_NAME: &str = "imx8mp";

pub const BOARD_NCPUS: usize = 4;
pub const BOARD_UART_BASE: u64 = 0x30890000;

#[rustfmt::skip]
pub static BOARD_MPIDR_MAPPINGS: [u64; BOARD_NCPUS] = [
0x0, // cpu0
0x1, // cpu1
0x2, // cpu2
0x3, // cpu3
];

/// The physical memory layout of the board.
/// Each address should align to 2M (0x200000).
/// Addresses must be in ascending order.
#[rustfmt::skip]
pub const BOARD_PHYSMEM_LIST: &[(u64, u64, MemoryType)] = &[
// ( start, end, type)
( 0x0, 0x40000000, MemoryType::Device),
( 0x40000000, 0x100000000, MemoryType::Normal),
];

pub const ROOT_ZONE_DTB_ADDR: u64 = 0xa0000000;
pub const ROOT_ZONE_KERNEL_ADDR: u64 = 0xa0400000;
Expand Down Expand Up @@ -103,6 +125,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicv_size: 0,
gits_base: 0,
gits_size: 0,
is_aarch32: 0,
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
26 changes: 25 additions & 1 deletion platform/aarch64/ok6254-c/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,33 @@
// Authors:
//

use crate::{arch::zone::HvArchZoneConfig, config::*};
use crate::{
arch::{mmu::MemoryType, zone::HvArchZoneConfig},
config::*,
};

pub const BOARD_NAME: &str = "ok6254";
pub const BOARD_NCPUS: usize = 4;
pub const BOARD_UART_BASE: u64 = 0x2800000;


#[rustfmt::skip]
pub static BOARD_MPIDR_MAPPINGS: [u64; BOARD_NCPUS] = [
0x0, // cpu0
0x1, // cpu1
0x2, // cpu2
0x3, // cpu3
];

/// The physical memory layout of the board.
/// Each address should align to 2M (0x200000).
/// Addresses must be in ascending order.
#[rustfmt::skip]
pub const BOARD_PHYSMEM_LIST: &[(u64, u64, MemoryType)] = &[
// ( start, end, type)
( 0x0, 0x80000000, MemoryType::Device),
( 0x80000000, 0x100000000, MemoryType::Normal),
];

pub const ROOT_ZONE_DTB_ADDR: u64 = 0x88000000; // DTB load address
pub const ROOT_ZONE_KERNEL_ADDR: u64 = 0x82000000; // kernel load address
Expand Down Expand Up @@ -119,6 +142,7 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
gicv_size: 0x00000,
gits_base: 0x1820000,
gits_size: 0x10000,
is_aarch32: 0,
};

pub const ROOT_ZONE_IVC_CONFIG: [HvIvcConfig; 0] = [];
1 change: 0 additions & 1 deletion platform/aarch64/ok6254-c/cargo/features
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
gicv3
uart_16550
uart_base_ok6254
Loading