From 7ac42bbc10f8b483355196e211d07bd0d02e7724 Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 12:28:35 +0800 Subject: [PATCH 1/9] feat(ci): add x86_64 NimbOS support and upgrade guest images to v0.0.20 --- .github/workflows/qemu-x86_64.toml | 21 ++++++ .github/workflows/test-qemu.yml | 43 ++++++------ Cargo.lock | 102 +++-------------------------- modules/axconfig/src/lib.rs | 24 ++++--- xtask/src/image.rs | 94 ++++++++++++++++---------- 5 files changed, 125 insertions(+), 159 deletions(-) create mode 100644 .github/workflows/qemu-x86_64.toml diff --git a/.github/workflows/qemu-x86_64.toml b/.github/workflows/qemu-x86_64.toml new file mode 100644 index 00000000..df08899c --- /dev/null +++ b/.github/workflows/qemu-x86_64.toml @@ -0,0 +1,21 @@ +args = [ + "-m", + "128M", + "-smp", + "1", + "-machine", + "q35", + "-device", + "virtio-blk-pci,drive=disk0", + "-drive", + "id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img", + "-nographic", + "-accel", + "kvm", + "-cpu", + "host", +] +fail_regex = [] +success_regex = ["usertests passed!"] +to_bin = false +uefi = false diff --git a/.github/workflows/test-qemu.yml b/.github/workflows/test-qemu.yml index 7a5f3234..8b220f89 100644 --- a/.github/workflows/test-qemu.yml +++ b/.github/workflows/test-qemu.yml @@ -11,16 +11,15 @@ jobs: - arch: aarch64 vmconfigs: configs/vms/arceos-aarch64-qemu-smp1.toml vmconfigs_name: ArceOS - vmimage_name: qemu_arceos_aarch64 - # vmrootfs_name: qemu_arceos_aarch64 + vmimage_name: qemu_aarch64_arceos # - arch: riscv64 # vmconfigs: configs/vms/arceos-riscv64-qemu-smp1.toml # vmconfigs_name: ArceOS # vmimage_name: qemu_arceos_riscv64 - # - arch: x86_64 - # vmconfigs: configs/vms/arceos-x86_64-qemu-smp1.toml - # vmconfigs_name: ArceOS - # vmimage_name: qemu_arceos_x86_64 + - arch: x86_64 + vmconfigs: configs/vms/nimbos-x86_64-qemu-smp1.toml + vmconfigs_name: NimbOS + vmimage_name: qemu_x86_64_nimbos fail-fast: false runs-on: - self-hosted @@ -49,26 +48,26 @@ jobs: echo "Updated kernel_path in $config" done - - name: Download rootfs + - name: Download IMAGES run: | - if [ -n "${{ matrix.vmrootfs_name }}" ]; then - ROOTFS_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.19/${{ matrix.vmrootfs_name }}.tar.gz" - ROOTFS_DIR="/tmp/axvisor/rootfs/${{ matrix.vmrootfs_name }}" - ROOTFS_IMG_PATH="${ROOTFS_DIR}/rootfs.img" - mkdir -p "${ROOTFS_DIR}" - - echo "Downloading rootfs from ${ROOTFS_URL}" - curl -L "${ROOTFS_URL}" -o "${ROOTFS_DIR}/${{ matrix.vmrootfs_name }}.tar.gz" - - echo "Extracting rootfs to ${ROOTFS_DIR}" - tar -xzf "${ROOTFS_DIR}/${{ matrix.vmrootfs_name }}.tar.gz" -C "${ROOTFS_DIR}" - - echo "Patching qemu-aarch64.toml file..." + IMAGES_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.19/${{ matrix.vmimage_name }}.tar.gz" + IMAGES_DIR="/tmp/axvisor/images/${{ matrix.vmimage_name }}" + ROOTFS_IMG_PATH="${IMAGES_DIR}/rootfs.img" + mkdir -p "${IMAGES_DIR}" + echo "Downloading rootfs from ${IMAGES_URL}" + curl -L "${IMAGES_URL}" -o "${IMAGES_DIR}/${{ matrix.vmimage_name }}.tar.gz" + + # Extract the tar.gz file + echo "Extracting archive to ${IMAGES_DIR}" + tar -xzf "${IMAGES_DIR}/${{ matrix.vmimage_name }}.tar.gz" -C "${IMAGES_DIR}" + + # Check if rootfs.img exists after extraction + if [ -f "${ROOTFS_IMG_PATH}" ]; then + echo "Found rootfs.img, patching qemu-aarch64.toml file..." sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml" - echo "Rootfs setup completed" else - echo "Removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..." + echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..." sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml" diff --git a/Cargo.lock b/Cargo.lock index 0c12ac54..db2e6dcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -224,22 +224,6 @@ dependencies = [ "chrono", ] -[[package]] -name = "arm_vcpu" -version = "0.1.1" -dependencies = [ - "aarch64-cpu", - "axaddrspace", - "axdevice_base", - "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", - "axvisor_api", - "log", - "numeric-enum-macro", - "percpu", - "spin 0.10.0", -] - [[package]] name = "arm_vcpu" version = "0.1.1" @@ -249,7 +233,7 @@ dependencies = [ "axaddrspace", "axdevice_base", "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", + "axvcpu", "axvisor_api", "log", "numeric-enum-macro", @@ -257,23 +241,6 @@ dependencies = [ "spin 0.10.0", ] -[[package]] -name = "arm_vgic" -version = "0.1.0" -dependencies = [ - "aarch64-cpu", - "aarch64_sysreg", - "axaddrspace", - "axdevice_base", - "axerrno", - "axvisor_api", - "bitmaps", - "log", - "memory_addr", - "spin 0.9.8", - "tock-registers 0.10.1", -] - [[package]] name = "arm_vgic" version = "0.1.0" @@ -431,22 +398,6 @@ dependencies = [ "x86_64", ] -[[package]] -name = "axdevice" -version = "0.1.0" -dependencies = [ - "arm_vgic 0.1.0 (git+https://github.com/arceos-hypervisor/arm_vgic.git)", - "axaddrspace", - "axdevice_base", - "axerrno", - "axvmconfig", - "cfg-if", - "log", - "memory_addr", - "range-alloc", - "spin 0.9.8", -] - [[package]] name = "axdevice" version = "0.1.0" @@ -1109,17 +1060,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axvcpu" -version = "0.1.2" -dependencies = [ - "axaddrspace", - "axerrno", - "axvisor_api", - "memory_addr", - "percpu", -] - [[package]] name = "axvcpu" version = "0.1.2" @@ -1141,15 +1081,15 @@ dependencies = [ "arm-gic-driver", "axaddrspace", "axconfig", - "axdevice 0.1.0 (git+https://github.com/arceos-hypervisor/axdevice.git)", + "axdevice", "axdevice_base", "axerrno", "axhvc", "axruntime", "axstd", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", + "axvcpu", "axvisor_api", - "axvm 0.1.0 (git+https://github.com/arceos-hypervisor/axvm.git?branch=next)", + "axvm", "bitflags 2.10.0", "byte-unit", "cfg-if", @@ -1201,42 +1141,18 @@ dependencies = [ "syn 2.0.110", ] -[[package]] -name = "axvm" -version = "0.1.0" -dependencies = [ - "arm_vcpu 0.1.1 (git+https://github.com/arceos-hypervisor/arm_vcpu?branch=next)", - "arm_vgic 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "axaddrspace", - "axdevice 0.1.0 (git+https://github.com/arceos-hypervisor/axdevice.git)", - "axdevice_base", - "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", - "axvmconfig", - "cfg-if", - "cpumask", - "log", - "memory_addr", - "page_table_entry", - "page_table_multiarch", - "percpu", - "riscv_vcpu", - "spin 0.9.8", - "x86_vcpu", -] - [[package]] name = "axvm" version = "0.1.0" source = "git+https://github.com/arceos-hypervisor/axvm.git?branch=next#0393f27dea948433e53285a400e356cdfd4c4fa3" dependencies = [ - "arm_vcpu 0.1.1 (git+https://github.com/arceos-hypervisor/arm_vcpu?branch=next)", + "arm_vcpu", "arm_vgic 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "axaddrspace", - "axdevice 0.1.0 (git+https://github.com/arceos-hypervisor/axdevice.git)", + "axdevice", "axdevice_base", "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", + "axvcpu", "axvmconfig", "cfg-if", "cpumask", @@ -4606,7 +4522,7 @@ checksum = "13f38f28fe6c02bb3ced43087c9667b23d18adf729becdc5adf1253f7df83904" dependencies = [ "axaddrspace", "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", + "axvcpu", "axvisor_api", "bit_field", "bitflags 2.10.0", @@ -6620,7 +6536,7 @@ dependencies = [ "axaddrspace", "axdevice_base", "axerrno", - "axvcpu 0.1.2 (git+https://github.com/arceos-hypervisor/axvcpu.git?branch=next)", + "axvcpu", "axvisor_api", "bit_field", "bitflags 2.10.0", diff --git a/modules/axconfig/src/lib.rs b/modules/axconfig/src/lib.rs index 75506b3b..77f60e76 100644 --- a/modules/axconfig/src/lib.rs +++ b/modules/axconfig/src/lib.rs @@ -24,15 +24,21 @@ pub const TICKS_PER_SEC: usize = 100; #[doc = ""] pub mod devices { #[doc = " MMIO regions with format (`base_paddr`, `size`)."] - pub const MMIO_REGIONS: &[(usize, usize)] = &[]; + pub const MMIO_REGIONS: &[(usize, usize)] = &[ + (0xb000_0000, 0x1000_0000), // PCI config space + (0xfe00_0000, 0xc0_0000), // PCI devices + (0xfec0_0000, 0x1000), // IO APIC + (0xfed0_0000, 0x1000), // HPET + (0xfee0_0000, 0x1000), // Local APIC + ]; #[doc = " End PCI bus number."] - pub const PCI_BUS_END: usize = 0; + pub const PCI_BUS_END: usize = 0xff; #[doc = " Base physical address of the PCIe ECAM space."] - pub const PCI_ECAM_BASE: usize = 0; + pub const PCI_ECAM_BASE: usize = 0xb000_0000 ; #[doc = " PCI device memory ranges."] pub const PCI_RANGES: &[(usize, usize)] = &[]; #[doc = " Timer interrupt num (PPI, physical timer)."] - pub const TIMER_IRQ: usize = 26; + pub const TIMER_IRQ: usize = 0xf0; #[doc = " VirtIO MMIO regions with format (`base_paddr`, `size`)."] pub const VIRTIO_MMIO_REGIONS: &[(usize, usize)] = &[]; } @@ -41,17 +47,17 @@ pub mod devices { #[doc = ""] pub mod plat { #[doc = " Number of CPUs."] - pub const CPU_NUM: usize = 16; + pub const CPU_NUM: usize = 1; #[doc = " Platform family (deprecated)."] pub const FAMILY: &str = ""; #[doc = " Kernel address space base."] - pub const KERNEL_ASPACE_BASE: usize = 0x0000_0000_0000; + pub const KERNEL_ASPACE_BASE: usize = 0xffff_8000_0000_0000; #[doc = " Kernel address space size."] - pub const KERNEL_ASPACE_SIZE: usize = 0xffff_ffff_f000; + pub const KERNEL_ASPACE_SIZE: usize = 0x0000_7fff_ffff_f000; #[doc = " No need."] - pub const KERNEL_BASE_PADDR: usize = 0x0; + pub const KERNEL_BASE_PADDR: usize = 0x20_0000 ; #[doc = " Base virtual address of the kernel image."] - pub const KERNEL_BASE_VADDR: usize = 0x8000_0000_0000; + pub const KERNEL_BASE_VADDR: usize = 0xffff_8000_0020_0000; #[doc = " Offset of bus address and phys address. some boards, the bus address is"] #[doc = " different from the physical address."] pub const PHYS_BUS_OFFSET: usize = 0; diff --git a/xtask/src/image.rs b/xtask/src/image.rs index c4bcbbba..66f4d08c 100644 --- a/xtask/src/image.rs +++ b/xtask/src/image.rs @@ -30,7 +30,7 @@ use std::io::Read; use tokio::io::{AsyncWriteExt, BufWriter}; /// Base URL for downloading images -const IMAGE_URL_BASE: &str = "https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.19/"; +const IMAGE_URL_BASE: &str = "https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.20/"; /// Image management command line arguments. #[derive(Parser)] @@ -112,45 +112,66 @@ impl Image { arch: "aarch64", }; - pub const QEMU_ARCEOS_AARCH64: Self = Self { - name: "qemu_arceos_aarch64", + pub const QEMU_AARCH64_ARCEOS: Self = Self { + name: "qemu_aarch64_arceos", description: "ArceOS for QEMU aarch64 virtualization", - sha256: "3bddc02f9ddfd4918b34334688ba391a86591e11cc69996cb1d25d3aad7e677b", + sha256: "56c1f517444dcd6668f0d4bc280543d6f236728c4ec5b81e7e5b5a06cf012690", arch: "aarch64", }; - - pub const QEMU_ARCEOS_RISCV64: Self = Self { - name: "qemu_arceos_riscv64", - description: "ArceOS for QEMU riscv64 virtualization", - sha256: "a2ea268bf97dda3531366db46f3e5a80891ae7b8d84641fb4ec4b76349d4e782", - arch: "riscv64", - }; - - pub const QEMU_ARCEOS_X86_64: Self = Self { - name: "qemu_arceos_x86_64", - description: "ArceOS for QEMU x86_64 virtualization", - sha256: "36637e2eb3d7b0b2b364e34f6656429e90e84e73e801c5705e17d9ec76564e84", - arch: "x86_64", - }; - - pub const QEMU_LINUX_AARCH64: Self = Self { - name: "qemu_linux_aarch64", + + pub const QEMU_AARCH64_LINUX: Self = Self { + name: "qemu_aarch64_linux", description: "Linux for QEMU aarch64 virtualization", - sha256: "83e8829fb3b0a10e1b7de68a3f6e55675430a06f2d06ae878ee9f8b498b35a51", + sha256: "ffccd4f89ee84def89ab66e23249d30723fd4a9af7896d7ef4d6f6d75d34225b", arch: "aarch64", }; - - pub const QEMU_LINUX_RISCV64: Self = Self { - name: "qemu_linux_riscv64", + + pub const QEMU_AARCH64_NIMBOS: Self = Self { + name: "qemu_aarch64_nimbos", + description: "NIMBOS for QEMU aarch64 virtualization", + sha256: "283681356af35e141bcf050dd56aa698966477289c21ac49941bb68d9a9ad1b8", + arch: "aarch64", + }; + + pub const QEMU_RISCV64_ARCEOS: Self = Self { + name: "qemu_riscv64_arceos", + description: "ArceOS for QEMU riscv64 virtualization", + sha256: "19248561c242a06a893a6a4debfc05ba5ca3e438347814c10351eecef88e54be", + arch: "riscv64", + }; + + pub const QEMU_RISCV64_LINUX: Self = Self { + name: "qemu_riscv64_linux", description: "Linux for QEMU riscv64 virtualization", - sha256: "27bf9ebb224514211387f12dbbb563ffdbd59e1ba1f7e40593315f374e5a13fa", + sha256: "34a355907bf3b05ea3949207fd98aad05d91c21d3b724d345f54576ef6e12eba", + arch: "riscv64", + }; + + pub const QEMU_RISCV64_NIMBOS: Self = Self { + name: "qemu_riscv64_nimbos", + description: "NIMBOS for QEMU riscv64 virtualization", + sha256: "064f75df290905687221b2554dd4e4efc077a6a95cafcbf7f98e2181441c24e3", arch: "riscv64", }; - pub const QEMU_LINUX_X86_64: Self = Self { - name: "qemu_linux_x86_64", + pub const QEMU_X86_64_ARCEOS: Self = Self { + name: "qemu_x86_64_arceos", + description: "ArceOS for QEMU x86_64 virtualization", + sha256: "ee9bdd4f6ae3ef2ee807ac712b82318329eeb6d1cffdf737f98a393ad730b5d9", + arch: "x86_64", + }; + + pub const QEMU_X86_64_LINUX: Self = Self { + name: "qemu_x86_64_linux", description: "Linux for QEMU x86_64 virtualization", - sha256: "19a3edb499c210cb3f35414855ebacd9115ce7264ce078dab723d1920c40332d", + sha256: "1a27da24b02f836b259462d5c73dc550553ea708d24af299378137beedc46c51", + arch: "x86_64", + }; + + pub const QEMU_X86_64_NIMBOS: Self = Self { + name: "qemu_x86_64_nimbos", + description: "NIMBOS for QEMU x86_64 virtualization", + sha256: "55d73898f9f98fca80e15387b1e5149ba6bbf74d3631281ea1ece75de3529078", arch: "x86_64", }; @@ -191,12 +212,15 @@ impl Image { Self::ORANGEPI_LINUX, Self::PHYTIUMPI_ARCEOS, Self::PHYTIUMPI_LINUX, - Self::QEMU_ARCEOS_AARCH64, - Self::QEMU_ARCEOS_RISCV64, - Self::QEMU_ARCEOS_X86_64, - Self::QEMU_LINUX_AARCH64, - Self::QEMU_LINUX_RISCV64, - Self::QEMU_LINUX_X86_64, + Self::QEMU_AARCH64_ARCEOS, + Self::QEMU_RISCV64_ARCEOS, + Self::QEMU_X86_64_ARCEOS, + Self::QEMU_AARCH64_LINUX, + Self::QEMU_RISCV64_LINUX, + Self::QEMU_X86_64_LINUX, + Self::QEMU_AARCH64_NIMBOS, + Self::QEMU_RISCV64_NIMBOS, + Self::QEMU_X86_64_NIMBOS, Self::ROC_RK3568_PC_ARCEOS, Self::ROC_RK3568_PC_LINUX, Self::TAC_E400_PLC_ARCEOS, From 2d53bfd9b834ada91c52eb778f2667e3bca5cbb6 Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 12:43:11 +0800 Subject: [PATCH 2/9] fix: CI issue --- .github/workflows/test-qemu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-qemu.yml b/.github/workflows/test-qemu.yml index 8b220f89..0fb7e9bc 100644 --- a/.github/workflows/test-qemu.yml +++ b/.github/workflows/test-qemu.yml @@ -50,7 +50,7 @@ jobs: - name: Download IMAGES run: | - IMAGES_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.19/${{ matrix.vmimage_name }}.tar.gz" + IMAGES_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.20/${{ matrix.vmimage_name }}.tar.gz" IMAGES_DIR="/tmp/axvisor/images/${{ matrix.vmimage_name }}" ROOTFS_IMG_PATH="${IMAGES_DIR}/rootfs.img" mkdir -p "${IMAGES_DIR}" From fcca869537f6c2d4eadcd8c66be5d3e0db839b9d Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 12:46:52 +0800 Subject: [PATCH 3/9] fix: CI issue --- configs/board/qemu-x86_64.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/board/qemu-x86_64.toml b/configs/board/qemu-x86_64.toml index 2f15df4b..1f5d32cd 100644 --- a/configs/board/qemu-x86_64.toml +++ b/configs/board/qemu-x86_64.toml @@ -1,6 +1,8 @@ cargo_args = [] features = [ + "axstd/myplat", "ept-level-4", + "fs", ] log = "Info" target = "x86_64-unknown-none" From 50e9b800aebf539bf5e91e57aba47f8f877e89ec Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 12:50:32 +0800 Subject: [PATCH 4/9] update --- .github/workflows/qemu-x86_64.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qemu-x86_64.toml b/.github/workflows/qemu-x86_64.toml index df08899c..79241b6a 100644 --- a/.github/workflows/qemu-x86_64.toml +++ b/.github/workflows/qemu-x86_64.toml @@ -10,8 +10,8 @@ args = [ "-drive", "id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img", "-nographic", - "-accel", - "kvm", +# "-accel", +# "kvm", "-cpu", "host", ] From 6b8ccdac58dbdfd32f1c7148f5d349786a2fb525 Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 12:57:15 +0800 Subject: [PATCH 5/9] fix(ci): disable KVM acceleration for GitHub Actions runner --- .github/workflows/qemu-x86_64.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/qemu-x86_64.toml b/.github/workflows/qemu-x86_64.toml index 79241b6a..97134da9 100644 --- a/.github/workflows/qemu-x86_64.toml +++ b/.github/workflows/qemu-x86_64.toml @@ -13,7 +13,8 @@ args = [ # "-accel", # "kvm", "-cpu", - "host", + "max" +# "host", ] fail_regex = [] success_regex = ["usertests passed!"] From fbf790c244ad31ccf7b76d44cd57c31ca2bc804d Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 13:34:35 +0800 Subject: [PATCH 6/9] fix(ci): enable KVM acceleration for GitHub Actions runner --- .github/workflows/qemu-x86_64.toml | 9 ++++----- modules/axconfig/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/qemu-x86_64.toml b/.github/workflows/qemu-x86_64.toml index 97134da9..da39907f 100644 --- a/.github/workflows/qemu-x86_64.toml +++ b/.github/workflows/qemu-x86_64.toml @@ -10,13 +10,12 @@ args = [ "-drive", "id=disk0,if=none,format=raw,file=${workspaceFolder}/tmp/rootfs.img", "-nographic", -# "-accel", -# "kvm", + "-accel", + "kvm", "-cpu", - "max" -# "host", + "host", ] -fail_regex = [] +fail_regex = ["System will reboot, press any key to continue ..."] success_regex = ["usertests passed!"] to_bin = false uefi = false diff --git a/modules/axconfig/src/lib.rs b/modules/axconfig/src/lib.rs index 77f60e76..d7aa3e1b 100644 --- a/modules/axconfig/src/lib.rs +++ b/modules/axconfig/src/lib.rs @@ -47,7 +47,7 @@ pub mod devices { #[doc = ""] pub mod plat { #[doc = " Number of CPUs."] - pub const CPU_NUM: usize = 1; + pub const CPU_NUM: usize = 16; #[doc = " Platform family (deprecated)."] pub const FAMILY: &str = ""; #[doc = " Kernel address space base."] From 7784d74202c7cdd3ac0859370de0680a4734298a Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 14:07:35 +0800 Subject: [PATCH 7/9] fix ci issue --- .github/workflows/test-qemu.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-qemu.yml b/.github/workflows/test-qemu.yml index 0fb7e9bc..0663c932 100644 --- a/.github/workflows/test-qemu.yml +++ b/.github/workflows/test-qemu.yml @@ -50,17 +50,9 @@ jobs: - name: Download IMAGES run: | - IMAGES_URL="https://github.com/arceos-hypervisor/axvisor-guest/releases/download/v0.0.20/${{ matrix.vmimage_name }}.tar.gz" - IMAGES_DIR="/tmp/axvisor/images/${{ matrix.vmimage_name }}" + IMAGES_DIR="/tmp/axvisor/${{ matrix.vmimage_name }}" ROOTFS_IMG_PATH="${IMAGES_DIR}/rootfs.img" - mkdir -p "${IMAGES_DIR}" - echo "Downloading rootfs from ${IMAGES_URL}" - curl -L "${IMAGES_URL}" -o "${IMAGES_DIR}/${{ matrix.vmimage_name }}.tar.gz" - - # Extract the tar.gz file - echo "Extracting archive to ${IMAGES_DIR}" - tar -xzf "${IMAGES_DIR}/${{ matrix.vmimage_name }}.tar.gz" -C "${IMAGES_DIR}" - + # Check if rootfs.img exists after extraction if [ -f "${ROOTFS_IMG_PATH}" ]; then echo "Found rootfs.img, patching qemu-aarch64.toml file..." From fdbd03b91e869be0811440344040629a4a5e7fbf Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 14:23:00 +0800 Subject: [PATCH 8/9] Fix(ci): Correct rootfs image path handling in qemu tests --- .github/workflows/test-qemu.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-qemu.yml b/.github/workflows/test-qemu.yml index 0663c932..cbda4f91 100644 --- a/.github/workflows/test-qemu.yml +++ b/.github/workflows/test-qemu.yml @@ -46,25 +46,22 @@ jobs: img_name="qemu-${{ matrix.arch }}" sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config" echo "Updated kernel_path in $config" - done - - name: Download IMAGES - run: | - IMAGES_DIR="/tmp/axvisor/${{ matrix.vmimage_name }}" - ROOTFS_IMG_PATH="${IMAGES_DIR}/rootfs.img" + ROOTFS_IMG_PATH="/tmp/axvisor/$img/rootfs.img" - # Check if rootfs.img exists after extraction - if [ -f "${ROOTFS_IMG_PATH}" ]; then - echo "Found rootfs.img, patching qemu-aarch64.toml file..." - sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml" - echo "Rootfs setup completed" - else - echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..." - sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" - sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" - sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml" - echo "Rootfs device configuration removed" - fi + # Check if rootfs.img exists after extraction + if [ -f "${ROOTFS_IMG_PATH}" ]; then + echo "Found rootfs.img, patching qemu-aarch64.toml file..." + sed -i 's|file=${workspaceFolder}/tmp/rootfs.img|file='"${ROOTFS_IMG_PATH}"'|' ".github/workflows/qemu-${{ matrix.arch }}.toml" + echo "Rootfs setup completed" + else + echo "No rootfs.img found, removing rootfs device configuration from qemu-${{ matrix.arch }}.toml..." + sed -i '/-device/,/virtio-blk-device,drive=disk0/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" + sed -i '/-drive/,/id=disk0,if=none,format=raw,file=${workspaceFolder}\/tmp\/rootfs.img/d' ".github/workflows/qemu-${{ matrix.arch }}.toml" + sed -i 's/root=\/dev\/vda rw //' ".github/workflows/qemu-${{ matrix.arch }}.toml" + echo "Rootfs device configuration removed" + fi + done - name: Run tests run: | From 9f6de59b9dccdfdc06beb36618dbb792ab4d3c23 Mon Sep 17 00:00:00 2001 From: YanLien Date: Thu, 27 Nov 2025 14:51:40 +0800 Subject: [PATCH 9/9] feat(ci): Conditionally update kernel path based on storage mode --- .github/workflows/test-qemu.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-qemu.yml b/.github/workflows/test-qemu.yml index cbda4f91..26389cac 100644 --- a/.github/workflows/test-qemu.yml +++ b/.github/workflows/test-qemu.yml @@ -44,8 +44,21 @@ jobs: config=$(echo "$config" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') cargo xtask image download $img img_name="qemu-${{ matrix.arch }}" - sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config" - echo "Updated kernel_path in $config" + image_location=$(sed -n 's/^image_location[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' "$config") + + case "$image_location" in + "fs") + echo "Filesystem storage mode - no config update needed" + ;; + "memory") + sed -i 's|^kernel_path[[:space:]]*=.*|kernel_path = "/tmp/axvisor/'"$img"'/'"$img_name"'"|' "$config" + echo "Memory storage mode - updating kernel_path" + ;; + *) + echo "Unknown image_location: $image_location" + exit 1 + ;; + esac ROOTFS_IMG_PATH="/tmp/axvisor/$img/rootfs.img"