Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/actions/setup-qemu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
run: |
./configure \
--prefix=${{ inputs.install-path }} \
--target-list=aarch64-softmmu,riscv64-softmmu,riscv64-linux-user \
--target-list=aarch64-softmmu,riscv64-softmmu,riscv64-linux-user,x86_64-softmmu \
--enable-kvm \
--enable-nettle \
--enable-user \
Expand Down
64 changes: 52 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# there is no actual running in this job
build:
name: build
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
Expand All @@ -88,57 +88,78 @@ jobs:
- arch: aarch64
board: "qemu-gicv3"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "qemu-gicv2"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "zcu102"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "imx8mp"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "rk3568"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "rk3588"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "ok6254-c"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
- arch: aarch64
board: "phytium-pi"
rustc_target: aarch64-unknown-none
runs-on: ubuntu-latest
# riscv64
- arch: riscv64
board: "qemu-aia"
rustc_target: riscv64gc-unknown-none-elf
runs-on: ubuntu-latest
- arch: riscv64
board: "qemu-plic"
rustc_target: riscv64gc-unknown-none-elf
runs-on: ubuntu-latest
- arch: riscv64
board: "hifive-premier-p550"
rustc_target: riscv64gc-unknown-none-elf
runs-on: ubuntu-latest
- arch: riscv64
board: "megrez"
rustc_target: riscv64gc-unknown-none-elf
runs-on: ubuntu-latest
- arch: riscv64
board: "ur-dp1000"
rustc_target: riscv64gc-unknown-none-elf
runs-on: ubuntu-latest
# loongarch64
- arch: loongarch64
board: "ls3a5000"
rustc_target: loongarch64-unknown-none
runs-on: ubuntu-latest
- arch: loongarch64
board: "ls3a6000"
rustc_target: loongarch64-unknown-none
# # x86_64
# - arch: x86_64
# board: "qemu"
# rustc_target: x86_64-unknown-none
# - arch: x86_64
# board: "nuc14mnk"
# rustc_target: x86_64-unknown-none
runs-on: ubuntu-latest
# x86_64
- arch: x86_64
board: "qemu"
rustc_target: x86_64-unknown-none
runs-on: ubuntu-latest
- arch: x86_64
board: "nuc14mnk"
rustc_target: x86_64-unknown-none
runs-on: ubuntu-latest
- arch: x86_64
board: "ecx-2300f-peg"
rustc_target: x86_64-unknown-none
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -166,7 +187,7 @@ jobs:
systemtest:
# if: false # we need to update corresponding scripts for the new board abstraction
name: systemtest
runs-on: ubuntu-22.04
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
Expand All @@ -175,10 +196,20 @@ jobs:
- arch: aarch64
rustc_target: aarch64-unknown-none
board: "qemu-gicv3"
runs-on: ubuntu-22.04
qemu_version: "9.0.2"
# riscv64
- arch: riscv64
rustc_target: riscv64gc-unknown-none-elf
board: "qemu-plic"
runs-on: ubuntu-22.04
qemu_version: "9.0.2"
# x86_64
- arch: x86_64
rustc_target: x86_64-unknown-none
board: "qemu"
runs-on: ["self-hosted", "X64"]
qemu_version: "9.2.3"
# Because other features need to be customized scripts
steps:
- name: Checkout Repository
Expand All @@ -190,9 +221,10 @@ jobs:
components: rust-src

- name: Setup QEMU from Source
if: matrix.arch != 'x86_64'
uses: ./.github/actions/setup-qemu
with:
qemu-version: '9.0.2'
qemu-version: ${{ matrix.qemu_version }}
install-path: '/opt/qemu'

- name: Setup ARM aarch64-none-linux-gnu
Expand All @@ -209,18 +241,26 @@ jobs:
version: '13.2.0'
install-path: '/opt/riscv64-unknown-linux-gnu'


- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y qemu-system-aarch64 qemu-system-riscv64 gdb-multiarch llvm-dev libclang-dev wget expect device-tree-compiler p7zip-full gcc-aarch64-linux-gnu gcc-riscv64-linux-gnu
cargo install --version 0.3.0 --locked cargo-binutils

- name: x86_64 Dependencies
if: matrix.arch == 'x86_64'
run: |
sudo apt-get install -y qemu-system-x86-64 grub-common xorriso grub-efi-amd64 mtools ovmf
sudo chmod 777 /dev/kvm
sed -i 's/ecam_base:.*,/ecam_base: 0xb0000000,/' ./platform/x86_64/qemu/board.rs

- name: Set up environment variables
run: |
echo "ARCH=${{ matrix.arch }}" >> $GITHUB_ENV
echo "BOARD=${{ matrix.board }}" >> $GITHUB_ENV
- name: Run System Test
run: make stest
run: |
make stest

license-checker:
name: license-checker
Expand Down
11 changes: 8 additions & 3 deletions platform/aarch64/qemu-gicv3/test/systemtest/trootfs_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ deploy_artifacts() {

}

umount_rootfs() {
echo "=== Umounting rootfs ==="
if mountpoint -q "${ROOTFS_DIR}"; then
sudo umount "${ROOTFS_DIR}"
fi
}

# ========================
# Main Execution Flow
# ========================
Expand All @@ -77,6 +84,7 @@ deploy_artifacts() {
# Setup environment
mount_rootfs
prepare_sources
trap umount_rootfs EXIT TERM

# Build process
if ! build_hvisor_tool; then
Expand All @@ -87,7 +95,4 @@ deploy_artifacts() {
# Deployment
deploy_artifacts

# Cleanup
echo "=== Unmounting rootfs ==="
sudo umount "${ROOTFS_DIR}"
) || exit 1
11 changes: 8 additions & 3 deletions platform/riscv64/qemu-plic/test/systemtest/trootfs_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ deploy_artifacts() {

}

umount_rootfs() {
echo "=== Umounting rootfs ==="
if mountpoint -q "${ROOTFS_DIR}"; then
sudo umount "${ROOTFS_DIR}"
fi
}

# ========================
# Main Execution Flow
# ========================
Expand All @@ -77,6 +84,7 @@ deploy_artifacts() {
# Setup environment
mount_rootfs
prepare_sources
trap umount_rootfs EXIT TERM

# Build process
if ! build_hvisor_tool; then
Expand All @@ -87,7 +95,4 @@ deploy_artifacts() {
# Deployment
deploy_artifacts

# Cleanup
echo "=== Unmounting rootfs ==="
sudo umount "${ROOTFS_DIR}"
) || exit 1
54 changes: 30 additions & 24 deletions platform/x86_64/ecx-2300f-peg/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
// Authors:
//
use crate::pci_dev;
use crate::{arch::zone::HvArchZoneConfig, config::*, memory::GuestPhysAddr};
use crate::{
arch::zone::HvArchZoneConfig, config::*, memory::GuestPhysAddr, pci::vpci_dev::VpciDevType,
};

pub const MEM_TYPE_RESERVED: u32 = 5;

Expand Down Expand Up @@ -117,7 +119,8 @@ const ROOT_ZONE_SETUP_ADDR: GuestPhysAddr = 0xa000;
const ROOT_ZONE_VMLINUX_ENTRY_ADDR: GuestPhysAddr = 0x10_0000;
const ROOT_ZONE_SCREEN_BASE_ADDR: GuestPhysAddr = 0x8000_0000;

pub const ROOT_ZONE_IRQS: [u32; 32] = [0; 32];
pub const IRQ_WAKEUP_VIRTIO_DEVICE: usize = 0x6;
pub const ROOT_ZONE_IRQS_BITMAP: &[BitmapWord] = &get_irqs_bitmap(&[0; 32]);
pub const ROOT_ZONE_IOAPIC_BASE: usize = 0xfec0_0000;
pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
ioapic_base: ROOT_ZONE_IOAPIC_BASE,
Expand All @@ -135,6 +138,8 @@ pub const ROOT_ARCH_ZONE_CONFIG: HvArchZoneConfig = HvArchZoneConfig {
};

pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [HvPciConfig {
bus_range_begin: 0x0,
bus_range_end: 0x1f,
ecam_base: 0xe0000000,
ecam_size: 0x400000,
io_base: 0x0,
Expand All @@ -146,32 +151,33 @@ pub const ROOT_PCI_CONFIG: [HvPciConfig; 1] = [HvPciConfig {
mem64_base: 0x0,
mem64_size: 0x0,
pci_mem64_base: 0x0,
domain: 0x0,
}];

pub const ROOT_PCI_MAX_BUS: usize = 3;
pub const ROOT_PCI_DEVS: [HvPciDevConfig; 19] = [
pci_dev!(0x0, 0x0, 0x0), // host bridge
pci_dev!(0x0, 0x1, 0x0), // PCI bridge
pci_dev!(0x0, 0x1, 0x1), // PCI bridge
// pci_dev!(0x0, 0x2, 0x0), // display controller
pci_dev!(0x0, 0x8, 0x0), // system peripheral
pci_dev!(0x0, 0x12, 0x0), // signal processing controller
pci_dev!(0x0, 0x14, 0x0), // USB controller
pci_dev!(0x0, 0x14, 0x2), // RAM memory
pci_dev!(0x0, 0x14, 0x5), // SD host controller
pci_dev!(0x0, 0x15, 0x0), // serial bus controller
pci_dev!(0x0, 0x16, 0x0), // communication controller
pci_dev!(0x0, 0x16, 0x3), // serial controller
pci_dev!(0x0, 0x17, 0x0), // SATA controller
pci_dev!(0x0, 0x1d, 0x0), // PCI bridge
// pci_dev!(0x0, 0x1f, 0x0), // ISA bridge
pci_dev!(0x0, 0x1f, 0x3), // audio device
pci_dev!(0x0, 0x1f, 0x4), // SMBus
pci_dev!(0x0, 0x1f, 0x5), // serial bus controller
// pci_dev!(0x0, 0x1f, 0x6), // ethernet controller
pci_dev!(0x2, 0x0, 0x0), // VGA controller
pci_dev!(0x2, 0x0, 0x1), // audio device
pci_dev!(0x3, 0x0, 0x0), // ethernet controller
pci_dev!(0x0, 0x0, 0x0, 0x0, VpciDevType::Physical), // host bridge
pci_dev!(0x0, 0x0, 0x1, 0x0, VpciDevType::Physical), // PCI bridge
pci_dev!(0x0, 0x0, 0x1, 0x1, VpciDevType::Physical), // PCI bridge
// pci_dev!(0x0, 0x0, 0x2, 0x0, VpciDevType::Physical), // display controller
pci_dev!(0x0, 0x0, 0x8, 0x0, VpciDevType::Physical), // system peripheral
pci_dev!(0x0, 0x0, 0x12, 0x0, VpciDevType::Physical), // signal processing controller
pci_dev!(0x0, 0x0, 0x14, 0x0, VpciDevType::Physical), // USB controller
pci_dev!(0x0, 0x0, 0x14, 0x2, VpciDevType::Physical), // RAM memory
pci_dev!(0x0, 0x0, 0x14, 0x5, VpciDevType::Physical), // SD host controller
pci_dev!(0x0, 0x0, 0x15, 0x0, VpciDevType::Physical), // serial bus controller
pci_dev!(0x0, 0x0, 0x16, 0x0, VpciDevType::Physical), // communication controller
pci_dev!(0x0, 0x0, 0x16, 0x3, VpciDevType::Physical), // serial controller
pci_dev!(0x0, 0x0, 0x17, 0x0, VpciDevType::Physical), // SATA controller
pci_dev!(0x0, 0x0, 0x1d, 0x0, VpciDevType::Physical), // PCI bridge
// pci_dev!(0x0, 0x0, 0x1f, 0x0, VpciDevType::Physical), // ISA bridge
pci_dev!(0x0, 0x0, 0x1f, 0x3, VpciDevType::Physical), // audio device
pci_dev!(0x0, 0x0, 0x1f, 0x4, VpciDevType::Physical), // SMBus
pci_dev!(0x0, 0x0, 0x1f, 0x5, VpciDevType::Physical), // serial bus controller
// pci_dev!(0x0, 0x0, 0x1f, 0x6, VpciDevType::Physical), // ethernet controller
pci_dev!(0x0, 0x2, 0x0, 0x0, VpciDevType::Physical), // VGA controller
pci_dev!(0x0, 0x2, 0x0, 0x1, VpciDevType::Physical), // audio device
pci_dev!(0x0, 0x3, 0x0, 0x0, VpciDevType::Physical), // ethernet controller
];

#[cfg(all(feature = "graphics"))]
Expand Down
16 changes: 15 additions & 1 deletion platform/x86_64/ecx-2300f-peg/linker.ld
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ENTRY(arch_entry)
BASE_ADDRESS = 0xffffff8000200000;
CPU_NUM = 16;

SECTIONS
{
Expand Down Expand Up @@ -41,6 +42,17 @@ SECTIONS
*(.sbss .sbss.*)
}

. = ALIGN(4K);
_percpu_start = .;
_percpu_end = _percpu_start + SIZEOF(.percpu);
.percpu 0x0 (NOLOAD) : AT(_percpu_start) {
_percpu_load_start = .;
*(.percpu .percpu.*)
_percpu_load_end = .;
. = _percpu_load_start + ALIGN(64) * CPU_NUM;
}
. = _percpu_end;

. = ALIGN(4K);
ebss = .;
ekernel = .;
Expand All @@ -50,4 +62,6 @@ SECTIONS
}
. = ALIGN(4K);
__core_end = .;
}
}

__hv_end = __core_end + HV_EXTENDED_SIZE;
29 changes: 25 additions & 4 deletions platform/x86_64/ecx-2300f-peg/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,31 @@ $(hvisor_bin): elf boot
$(OBJCOPY) $(hvisor_elf) --strip-all -O binary $@
cp $(hvisor_elf) $(image_dir)/iso/boot
mkdir -p $(image_dir)/iso/boot/kernel
cp $(zone0_boot) $(image_dir)/iso/boot/kernel
cp $(zone0_setup) $(image_dir)/iso/boot/kernel
cp $(zone0_vmlinux) $(image_dir)/iso/boot/kernel

if [ -f $(zone0_boot) ]; then \
cp $(zone0_boot) $(image_dir)/iso/boot/kernel; \
else \
echo "Warning: $(zone0_boot) not found, skipping"; \
fi

if [ -f $(zone0_setup) ]; then \
cp $(zone0_setup) $(image_dir)/iso/boot/kernel; \
else \
echo "Warning: $(zone0_setup) not found, skipping"; \
fi

if [ -f $(zone0_vmlinux) ]; then \
cp $(zone0_vmlinux) $(image_dir)/iso/boot/kernel; \
else \
echo "Warning: $(zone0_vmlinux) not found, skipping"; \
fi

mkdir -p $(image_dir)/virtdisk
grub-mkrescue /usr/lib/grub/x86_64-efi -o $(image_dir)/virtdisk/hvisor.iso $(image_dir)/iso

if command -v xorriso >/dev/null 2>&1; then \
grub-mkrescue /usr/lib/grub/x86_64-efi -o $(image_dir)/virtdisk/hvisor.iso $(image_dir)/iso; \
else \
echo "Warning: xorriso not installed, skipping ISO creation"; \
fi

include $(image_dir)/bootloader/boot.mk
Loading
Loading