Skip to content

docker/riscv/trixie: add domU guest creation support#19

Merged
baptleduc merged 7 commits into
xcp-ng:mainfrom
baptleduc:pv-console-domU
May 11, 2026
Merged

docker/riscv/trixie: add domU guest creation support#19
baptleduc merged 7 commits into
xcp-ng:mainfrom
baptleduc:pv-console-domU

Conversation

@baptleduc
Copy link
Copy Markdown
Contributor

@baptleduc baptleduc commented May 4, 2026

Adds support for creating and running domU guests in the RISC-V QEMU environment.

Features:

  • Add install Makefile target that installs Xen tools + hypervisor directly to INITRD_DIR with correct prefix (/usr), replacing the previous dist-based approach with path gymnastics
  • Simplify initrd-tools rcS script by using direct env variables name.
  • Add build-image-debug target to build Docker image with dtc cross-compiled for RISC-V (opt-in via DEBUG_XL=1)
  • Add build-time validation: error early if KERNEL or VMLINUX paths don't exist
  • Disable unsupported sstc CPU extension
  • Fix domU config: add cpus = "1", add keep_bootcon to kernel cmdline for better console output

Test

@baptleduc baptleduc requested a review from a team as a code owner May 4, 2026 15:31
@baptleduc baptleduc self-assigned this May 4, 2026
@baptleduc baptleduc force-pushed the pv-console-domU branch 3 times, most recently from 3e3c103 to f6e8614 Compare May 4, 2026 15:41
baptleduc added 2 commits May 4, 2026 17:42
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Copy link
Copy Markdown
Collaborator

@casasnovas casasnovas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@baptleduc baptleduc marked this pull request as draft May 5, 2026 14:38
@baptleduc
Copy link
Copy Markdown
Contributor Author

lgtm!

Sorry I found some fixes that need to be made.

@TSnake41
Copy link
Copy Markdown
Member

TSnake41 commented May 5, 2026

Are there plans to upstream such CI pipelines to Xen Project (at least, in the future) ? Similar bits already exist upstream (and I guess will be expected to be there for supporting/upstreaming RISC-V toolstack).

For instance, there is https://github.com/xen-project/xen/blob/8596535982ea2054f31d6c9a06bb40c44f8eb42d/automation/scripts/qemu-smoke-dom0less-arm64.sh for testing arm64 dom0less on ARM64 among many other things (including testing PCI Passthrough and toolstack).

baptleduc added 5 commits May 5, 2026 18:27
Silent docker volume mount failure when path invalid
$(wildcard) check now aborts early with a clear error message.

Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Cross-compile dtc for riscv64 in a dedicated build stage and include
the binary in the dom0 initrd only when DEBUG_XL=1 (build-image-debug).
libfdt and libc dependencies are already present in the initrd.

Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Replace broken dist-* targets and mixed $(MAKE) calls with uniform
XEN_MAKE usage. Split install into install-xen/install-tools, fix
SUBSYSTEM -> SUBSYSTEMS typo that caused all subsystems to build.

Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
Comment thread docker/riscv/trixie/image/Makefile
Comment thread docker/riscv/trixie/image/Makefile
Comment thread docker/riscv/trixie/image/Makefile
Comment on lines -77 to -80
run-rebuild: ## Rebuild Xen hypervisor, then boot
$(DOCKER) -p 1234:1234 $(IMAGE) \
/bin/bash -c "make build-xen && make $(INITRD) && make go"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless as target run calls make $(INITRD) which calls make install

@baptleduc baptleduc requested a review from casasnovas May 5, 2026 16:35
@baptleduc baptleduc marked this pull request as ready for review May 5, 2026 16:35
@casasnovas
Copy link
Copy Markdown
Collaborator

As we discussed last Thursday I am not sure why the builds are longer, but for the record you mentioned them going from about a minute to a minutes and ~5s, so it could be explained by the fact the number of threads are multiplied by two in the slower case (given each rule will call XEN_MAKE with -j$(nproc), potentially overloading your scheduler) as well as two parallel make processes having to read/parse the Makefile + build/walk the dependency tree. Either way it is not obvious from looking at it and the slowlyness is rather small so probably best to not spend too much time on this.

@baptleduc
Copy link
Copy Markdown
Contributor Author

As we discussed last Thursday I am not sure why the builds are longer, but for the record you mentioned them going from about a minute to a minutes and ~5s, so it could be explained by the fact the number of threads are multiplied by two in the slower case (given each rule will call XEN_MAKE with -j$(nproc), potentially overloading your scheduler) as well as two parallel make processes having to read/parse the Makefile + build/walk the dependency tree. Either way it is not obvious from looking at it and the slowlyness is rather small so probably best to not spend too much time on this.

Thanks for your review anyway !

@baptleduc baptleduc merged commit cc6014a into xcp-ng:main May 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants