Repository navigation
Conversation
poemonsense
reviewed
Sep 21, 2026
poemonsense
left a comment
Member
There was a problem hiding this comment.
I think we should not let existing linux build rules depend on VIRTUALIZATION. Instead, we should create a standalone workloads/qemu directory that creates virtualization workloads with an input binary.
The user should build a target virt image by specifying an existing bin or elf file as input to qemu.
In that way, VIRTUALIZATION does not affect any existing workloads and is transparent to the underlying input files.
Basically, this qemu workload should also be configurable (e.g., mem_size).
| @@ -0,0 +1,19 @@ | |||
| BR2_riscv=y | |||
Member
There was a problem hiding this comment.
should name this file to xiangshan_virt_host_defconfig
|
|
||
| ## Virtualization | ||
|
|
||
| Build CoreMark-PRO as a nested KVM guest and run the Host firmware with QEMU: |
Member
There was a problem hiding this comment.
We should not change these existing workloads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
VIRTUALIZATION=1, which packages a Linux workload as a nested KVM Guestrunning inside a Linux Host, so virtual workloads are built and run through the
same outer NEMU / QEMU
nemuflow as regular workloads. Simulator sources areuntouched.
Runtime flow
qemu-system-riscv64 -machine virt,aia=none -bios none -accel kvm -cpu host ...and boots the Guest kernel + initramfs directly.
nemu-notify 256/257(so nested traps are not mistaken for a terminal outerexit), runs the workload's normal init/inittab commands, and prints
VIRT_WORKLOAD_EXIT=<status>as the single exit marker.QEMU, and execs
/bin/nemu-trap <status>, so the outer simulator reports thereal workload status (
Hit GOOD TRAP; non-zero propagates as failure). Astart timeout plus a strict single-marker check turn "Guest never started" or
"multiple markers" into a failed run instead of a false pass.
Supporting changes: the GCPT
GCPT_PAYLOAD_FDT_ADDRpatch handsmhartid/FDTto the payload on checkpoint restore (Host FDT at
0x80200000);INITRAMFS_OFFSET_ALIGNMENT_MBinscripts/build-firmware-linux.sh(virtualHost uses 2 MiB); workload
rules.mkroutelinux/<case>to the virtualartifacts instead of DTB firmware when
VIRTUALIZATION=1;linux/hellouses theLinux exit syscall under virtualization.
Coverage
All Linux workloads: hello, CoreMark, CoreMark-PRO, RVV-Bench,
litmus-tests-riscv, kvmtool, SPEC CPU2006/2017/2026 cases, GAPBS, RocksDB,
SPECjbb2015, stress-ng, Geekbench 5/6.
Testing
make spec2006-images PLATFORM=nemu VIRTUALIZATION=1packages all defaultcases and exports matching
bin/,dt/,manifest/artifacts (12 cases).PLATFORM=nemuandPLATFORM=qemudry runs parse without target conflicts;Python and shell syntax checks pass.
VIRT_WORKLOAD_EXIT=0->VIRT_HOST: workload exit 0->Hit GOOD TRAP):pending on this branch.