Emulation and crossbuild platforms

TopicTypeDescription
QEMU system modeEngineeringToday, Morello Linux runs on Morello hardware and Arm’s FVP emulator. Linux (both MMU- and MMU-less ) runs on QEMU for CHERI-RISC-V. CheriBSD’s Morello support is well tested and heavily used on QEMU for Morello, and is believed to be quite mature. As QEMU is widely available and used in the Linux community, ensuring that Morello Linux and, CHERI Linux (with both Morello and RISC-V support) works well on QEMU will ease integration into existing development environments and allow access to CHERI Linux’s Morello support for those unable to use FVP. QEMU will need to (in due course) be updated to the latest version to allow use of newer RISC-V extensions, such as vector support, that have gained CHERI support in the latest RISC-V International draft CHERI extension specification. As for LLVM, the aim should be to upstream CHERI support in QEMU to reduce future maintenance burden.
QEMU user modeEngineeringThis feature of QEMU is often used for the purposes of large-scale software cross building, so that host toolchain (e.g., make, compiler, linker) can run natively, while portions of a cross-built piece of software that depend on running on the target can be run in that way. User mode support integrates a rich understanding of not just the target architecture, but also OS system-call ABI, and so specific engineering work will be needed to enable pure-capability CHERI Linux processes under QEMU user mode. This work has been done for CheriBSD for Morello, but not yet CHERI-RISC-V, and will provide a reasonable template. General Linux user mode support is solid in upstream QEMU where FreeBSD support is largely a local addition.
bhyve hypervisorEngineeringCheriBSD includes the bhyve hypervisor with support for virtualization on Arm’s Morello. It is capable of booting Morello Linux and provides a more performant development environment than QEMU. Debugging support currently lags behind QEMU and improvement would better support work on CHERI Linux.
CheriBSD Linux ABIEngineeringDuring development of the current Arm Morello pure-capability usermode ABI, the CheriBSD team created a prototype adaptation of FreeBSD’s existing arm64 Linux process emulation updated for the new CHERI-enabled ABI. Continuing this work offers two important benefits: (1) Providing an independent second implementation of the ABI offering concrete feedback on the design and its implications with differing kernel designs, with practical validation, and (2) Providing early access to CHERI OS features unavailable via the Linux kernel during development – for example, being able to develop glibc support for heap temporal safety, and test Linux-compiled applications with it, before Linux kernel support is complete.