Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d702ccc
a prototype of irq injection
aarkegz Dec 19, 2024
cc77eca
Merge branch 'master' into inject_interrupt
hky1999 Jan 9, 2025
9c5834c
support inject interrupts, with test codes on x86
aarkegz Jan 15, 2025
77353a8
Merge branch 'master' into inject_interrupt
aarkegz Jan 15, 2025
983c6df
[temp, to be squashed] mock timer
aarkegz Feb 7, 2025
c88ae96
a working version
aarkegz Mar 12, 2025
fe2e6e1
Merge branch 'master' into inject_interrupt
aarkegz Mar 17, 2025
612eb5f
fixing ce
aarkegz Mar 17, 2025
18447ad
a really working version
aarkegz Mar 19, 2025
0790058
impl `vmm::vcpu_num`
aarkegz Mar 26, 2025
a9c6c4a
update to newest dependencies
aarkegz Mar 26, 2025
f2c81af
Merge branch 'master' into inject_interrupt
aarkegz Apr 14, 2025
43dc1d1
fix Cargo.lock
aarkegz Apr 14, 2025
8acff23
feat(vmm): implement VGICv2 and integrate VirtIO
luodeb Mar 31, 2025
7da6227
fixes after merge debin/timer_api
aarkegz Apr 15, 2025
008c509
fix Cargo.lock
aarkegz Apr 16, 2025
844c4af
update hal impl
aarkegz Apr 16, 2025
9534ac6
temporary workaround for aarch64 tick rate
aarkegz Apr 17, 2025
5ef1dac
formatted
aarkegz Apr 17, 2025
634ef56
impl `alloc_contiguous_frames` for axvisor_api
aarkegz May 28, 2025
0c193a2
impl `dealloc_contiguous_frames` for axvisor_api
aarkegz May 28, 2025
f70ce1b
[wip] improve rk3588 scripts, wip in dtb parsing
hky1999 May 28, 2025
8a01606
[wip] on dtb parsing
hky1999 May 29, 2025
7f15074
[feat] introduce dtb parsing during vm config setup
hky1999 May 29, 2025
fc70c4b
[wip] data abort @1000a0
hky1999 Jun 1, 2025
526371e
[wip] add how to prepare linux kernel binary
hky1999 Jun 1, 2025
b441b8c
add place-holder implementation for new `axvisor_api`s
aarkegz Jun 5, 2025
9d23528
[feat] Support load ramdisk image from memory
Gallium70 Jun 6, 2025
1a9b3a3
[feat/rk3588] Add ramdisk image config for rk3588
Gallium70 Jun 6, 2025
a087449
[wip] boot Linux and arceos
hky1999 Jun 6, 2025
a29e940
[feat] add scripts of boot Linux and arceos on qemu
hky1999 Jun 7, 2025
5e13676
[feat] Remove unnecessary cooling-maps to allow automatic fan speed c…
Gallium70 Jun 7, 2025
634cac8
[fix] bad repo in Boot-on-qemu.md orz
hky1999 Jun 7, 2025
37a645c
Merge pull request #162 from Gallium70/rk3588_jd4
Gallium70 Jun 9, 2025
fd67bde
Merge remote-tracking branch 'origin/rk3588_jd4' into rk3588_jd4
Gallium70 Jun 9, 2025
b518194
[doc/rk3588] Update boot Linux VM instruction on custom kernel branch
Gallium70 Jun 9, 2025
0720a7e
[bug] Temporary fix for linux boot failure
Gallium70 Jun 7, 2025
2b69e6e
Merge branch 'rk3588_jd4' into rk3588_jd4_qemu
Gallium70 Jun 9, 2025
4f4bf97
[feat/rk3588] Add device tree and config for booting 2 VMs (Linux+Arc…
Gallium70 Jun 9, 2025
e6672fb
Remove absolute path in config and readme
Gallium70 Jun 9, 2025
6b6c981
[wip] introduce ivc channel with publisher subscriber model
hky1999 Jun 9, 2025
4e2e1c2
[feat] introduce IVCChannelHeader
hky1999 Jun 10, 2025
1e9b6f9
[feat] support simplex inter-VM communication channel
hky1999 Jun 10, 2025
41957ee
[MILESTONE] working version of 2 Linux VMs on QEMU
aarkegz Jun 11, 2025
46785a6
remove patches
aarkegz Jun 11, 2025
fba4186
[feat/rk3588] Add a minimal device tree and config for booting second…
Gallium70 Jun 11, 2025
1bcf4d4
Merge branch 'inject_interrupt_vgicv3' into rk3588_jd4_qemu
Gallium70 Jun 11, 2025
ec6a6c2
Merge remote-tracking branch 'origin/ivc' into inject_interrupt_vgicv…
aarkegz Jun 11, 2025
37af056
test with kernel 5.10.198
aarkegz Jun 12, 2025
454e98c
[feat] Delay boot of second VM to allow first VM to initialize clocks
Gallium70 Jun 13, 2025
4a4d315
[feat/vgic] Parse GIC SPIs from DTB and collect them to setup vGIC
Gallium70 Jun 13, 2025
ce993c0
[feat/rk3588] Update VM config to boot two Linux VMs
Gallium70 Jun 13, 2025
0407576
nasty sendipi handling
aarkegz Jun 13, 2025
94059c0
[feat] make IVCChannel as a emulated device type
hky1999 Jun 12, 2025
f52e792
[doc/rk3588] Update instructions on how to boot two Linux VMs on rk3588
Gallium70 Jun 13, 2025
83e9f2b
[wip] Update config to boot SMP VMs
Gallium70 Jun 13, 2025
64a39f6
nasty sendipi handling
Gallium70 Jun 13, 2025
0ea2756
[doc/rk3588] Update instruction to boot SMP VMs
Gallium70 Jun 13, 2025
e88d5af
[feat/rk3588] Use PREEMT_RT kernel for Linux VM2
Gallium70 Jun 15, 2025
60ed757
Assign arceos VM to 3rd physical core for 2-core Linux VM1
Gallium70 Jun 15, 2025
8105597
[wip] prepare to merge
hky1999 Jun 15, 2025
65c0a91
Merge branch 'ivc_wip' into inject_interrupt_vgicv3_ivc
hky1999 Jun 15, 2025
627f841
[wip] merge ivc branch, modify configuration
hky1999 Jun 15, 2025
bf095ea
[feat] reorder clocks for proper initialization in Linux kernel
Gallium70 Jun 17, 2025
ed4a058
[wip] Use gicv3 tester app and DTB for ArceOS VM2
Gallium70 Jun 17, 2025
21783c7
[feat/rk3588] Remove CMA ranges for PCIe, USB and SATA driver to work…
Gallium70 Jun 25, 2025
3bc6e21
[feat/rk3588] Linux VM1 use PREEMPT_RT kernel
Gallium70 Jun 25, 2025
95d58f2
[feat/rk3588] Linux VM2 SATA disk support
Gallium70 Jun 25, 2025
c308cfc
[doc] Fix typo
Gallium70 Jun 26, 2025
f900a6b
[doc/rk3588] Update kernel branch to PREEMT_RT
Gallium70 Jun 26, 2025
490a6c4
Merge remote-tracking branch 'origin/rk3588_jd4' into inject_interrup…
aarkegz Jul 1, 2025
3d199d2
cargo.lock updates after merging
aarkegz Jul 1, 2025
4e56916
update all dependencies to merged version
aarkegz Jul 16, 2025
1c01c83
rollback nimbos-riscv64.toml
aarkegz Jul 16, 2025
3485790
Update toml crate (#219)
YanLien Aug 15, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ rusty-tags.vi

# tools should be downloaded from github
tools/*

# initramfs
*.cpio.gz
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
force_explicit_abi = false
48 changes: 48 additions & 0 deletions Boot-on-qemu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Compile AxVisor

* get deps
```bash
./tool/dev_env.py
cd crates/arceos && git checkout rk3588_jd4_qemu
cd crates/axvm && git checkout ivc
cd crates/axvcpu && git checkout ivc
cd crates/arm_vcpu && git checkout ivc_and_4lpt
cd crates/axaddrspace && git checkout 4_level_paging
cd crates/axhvc && git checkout ivc
cd crates/axdevice && git checkout ivc
cd crates/axvmconfig && git checkout ivc
```

* build dtb

```bash
dtc -o configs/vms/qemu_gicv3.dtb -O dtb -I dts configs/vms/qemu_gicv3.dts
```

```bash
make ARCH=aarch64 PLATFORM=configs/platforms/aarch64-qemu-virt-hv.toml defconfig
make ARCH=aarch64 PLATFORM=configs/platforms/aarch64-qemu-virt-hv.toml LOG=debug VM_CONFIGS=configs/vms/linux-qemu-aarch64.toml:configs/vms/arceos-aarch64.toml GICV3=y NET=y SMP=2 run DISK_IMG=configs/vms/ubuntu-22.04-rootfs_ext4.img SECOND_SERIAL=y

telnet localhost 4321
```

## Test AxVisor IVC

* Compile arceos ivc tester as guest VM 2

repo: https://github.com/arceos-hypervisor/arceos/tree/ivc_tester

```bash
make ARCH=aarch64 A=examples/ivc_tester defconfig
make ARCH=aarch64 A=examples/ivc_tester build
# You can get `examples/ivc_tester/ivc_tester_aarch64-qemu-virt.bin`,
# whose path should be set to `kernel_path` field in `configs/vms/arceos-aarch64.toml`.
```

* Build and install axvisor-driver

```bash
git clone [email protected]:arceos-hypervisor/axvisor-tools.git --branch ivc
```

see its [README](https://github.com/arceos-hypervisor/axvisor-tools/blob/ivc/axvisor-driver/README.md) about how to compile it and how to subscribe messages from guest ArceOS's ivc publisher.
118 changes: 118 additions & 0 deletions Boot-on-rk3588.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Boot Two Linux VMs on the Firefly AIO-3588JD4 Board

## Setup TFTP Server

```bash
sudo apt-get install tftpd-hpa tftp-hpa
sudo chmod 777 /srv/tftp
```

Check if TFTP works

```bash
echo "TFTP Server Test" > /srv/tftp/testfile.txt
tftp localhost
tftp> get testfile.txt
tftp> quit
cat testfile.txt
```

You should see `TFTP Server Test` on your screen.

## Setup rootfs for VM2

### SATA disk

Burn the rootfs image to an **M.2 SATA** SSD with whatever tools you prefer (e.g. dd, rufus, Balena Etcher, or even a loop mount and rsync), and install it to the back of the board. Specify the proper partition identifier (e.g. `/dev/sda1`) in the DTS bootargs.

The kernel need built with SCSI disk, libata and AHCI platform support, or the corresponding kernel modules need to be put into the initramfs image. The default config in the Firefly SDK builds them as kernel modules but are not included in the initramfs image, hence the kernel failed to recognize the disk and mount the root partition.

### NFS-root (optional)

This works when directly attached storage is not available for VM2.

Setup an NFS server:

```bash
sudo apt install nfs-kernel-server
sudo mkdir -p /srv/nfs/firefly-rootfs
# Download rootfs image from firefly wiki, assume rootfs.img
# expand image and partition
sudo dd if=/dev/zero of=rootfs.img bs=1M count=0 seek=16384
# ... will show which loop device the image is mounted on, assume loopX
sudo losetup -f --show rootfs.img
sudo e2fsck -f /dev/loopX && sudo resize2fs /dev/loopX
sudo losetup -D /dev/loopX
# now mount the image file to rootfs path
sudo mount -t loop rootfs.img /srv/nfs/firefly-rootfs
# Add to NFS exports
sudo cat <<EOF >> /etc/exports
/srv/nfs 192.168.XXX.0/24(rw,async,no_subtree_check,fsid=0)
/srv/nfs/firefly-rootfs 192.168.XXX.0/24(rw,async,no_subtree_check,no_root_squash)
EOF
sudo exportfs -ar
```

Before compiling the DTS, edit the bootargs in `aio-rk3588-jd4-vm2.dts` and specify an NFS root as `root=/dev/nfs nfsroot=<server_ip>:<root-dir>` where `<server_ip>:<root-dir>` is your own NFS server IP and rootfs export path setup in the previous step.

## Compile device tree

```bash
dtc -o configs/vms/aio-rk3588-jd4-vm1.dtb -O dtb -I dts configs/vms/aio-rk3588-jd4-vm1.dts
dtc -o configs/vms/aio-rk3588-jd4-vm2.dtb -O dtb -I dts configs/vms/aio-rk3588-jd4-vm2.dts
```

## Prepare Linux kernel binary

Prepare RK3588 SDK following manufacturer's instruction, checkout the Linux kernel repository to this branch: https://github.com/arceos-hypervisor/firefly-linux-bsp/tree/axvisor-rk3588-jd4-rt89, then build the kernel. This branch has PREEMPT_RT patches and native SCS, SATA and AHCI support, bootable on both VMs.

Copy the kernel and ramdisk image to AxVisor directory:

```bash
scp [email protected]:/home/xxx/firefly_rk3588_SDK/kernel/arch/arm64/boot/Image configs/vms/Image.bin
scp [email protected]:/home/xxx/firefly_rk3588_SDK/kernel/ramdisk.img configs/vms/ramdisk.img
```

## Compile AxVisor

* get deps

```bash
./tool/dev_env.py
cd crates/arceos && git checkout rk3588_jd4
```

* compile

```bash
make ARCH=aarch64 PLATFORM=configs/platforms/aarch64-rk3588j-hv.toml SMP=4 defconfig
make ARCH=aarch64 PLATFORM=configs/platforms/aarch64-rk3588j-hv.toml SMP=4 VM_CONFIGS=configs/vms/linux-rk3588-aarch64-smp-vm1.toml:configs/vms/linux-rk3588-aarch64-smp-vm2.toml LOG=debug GICV3=y upload
```

* copy to tftp dir (make xxx upload will copy the image to `/srv/tftp/axvisor` automatically)

```bash
cp axvisor_aarch64-rk3588j.img /srv/tftp/axvisor
```

## rk3588 console

上电,在 uboot 中 ctrl+C

```bash
# 这是 tftp 服务器所在的主机 ip
setenv serverip 192.168.50.97
# 这是 rk3588 所在设备的 ip (Firefly Linux 自己 DHCP 拿到的地址)
setenv ipaddr 192.168.50.8
# 使用 tftp 加载镜像到指定内存地址并 boot
setenv serverip 192.168.50.97;setenv ipaddr 192.168.50.8;tftp 0x00480000 ${serverip}:axvisor;tftp 0x10000000 ${serverip}:rk3588_dtb.bin;bootm 0x00480000 - 0x10000000;
```

The VM2 will wait for several seconds before boot to allow VM1 to setup clocks of the whole SoC first.

The VM1 output goes to the RS232 on the board (ttyS1 in Linux and serial@feb40000 in the device tree), and the VM2 output goes to the USB Type-C (ttyS2/ttyFIQ0 in Linux and serial@feb5000 in the device tree).

## Known Issues

* Resets of the ethernet in VM2 is not working, and reconfigure the NIC (e.g. with NetworkManager) may cause the VM2 to hang. Currently the initramfs will attempt to autoconfig the eth port when NFS-root is used. You may override the configuration with `ip=` kernel bootarg.
* Execute `reboot` in either VM would reset the whole board, which may be unexpected for the other VM. You may `shutdown` VM2 first, then do shutdown or reboot in VM1.
Loading
Loading