diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_index.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_index.md new file mode 100644 index 0000000000..7c41e2dacb --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_index.md @@ -0,0 +1,75 @@ +--- +title: Run an auxiliary plane in an Arm CCA Realm +description: Learn how to build a planes-enabled Arm CCA software stack, boot plane 0 Linux in a Realm, and run a test microkernel in an auxiliary plane on an Arm FVP. + +minutes_to_complete: 180 + +who_is_this_for: This advanced topic is for firmware, kernel, and virtualization developers who want to experiment with Arm CCA planes in an emulated environment. + +learning_objectives: + - Build a planes-enabled Arm CCA software stack with Shrinkwrap. + - Boot plane 0 Linux in a Realm on an Arm Fixed Virtual Platform (FVP). + - Run a test microkernel in an auxiliary plane from plane 0. + - Validate that the plane entry test reaches the expected result. + +prerequisites: + - An AArch64 or x86_64 computer running Ubuntu 24.04 LTS with at least 30 GB of free disk space. + - A user account with `sudo` access to install host packages, or a host where the listed packages are already installed. + - Completion of the [Run an application in a Realm using the Arm Confidential Compute Architecture (CCA)](/learning-paths/servers-and-cloud-computing/cca-container/) Learning Path. + - Familiarity with Linux kernel builds, Rust builds, Docker, and the Linux command line. + +author: Arm + +draft: true +generate_summary_faq: true +rerun_summary: false +rerun_faqs: false + +### Tags +skilllevels: Advanced +subjects: Containers and Virtualization +armips: + - Neoverse + - Cortex-A +operatingsystems: + - Linux +tools_software_languages: + - CCA + - RME + - FVP + - Docker + - Shrinkwrap + - Linux + - Rust + - OpenHCL + - OpenVMM + - kvmtool + +further_reading: + - resource: + title: Arm Confidential Compute Architecture + link: https://www.arm.com/architecture/security-features/arm-confidential-compute-architecture + type: website + - resource: + title: Learn the architecture - Realm Management Extension + link: https://developer.arm.com/documentation/den0126 + type: documentation + - resource: + title: Realm Management Monitor specification + link: https://developer.arm.com/documentation/den0137/latest/ + type: documentation + - resource: + title: Shrinkwrap documentation + link: https://shrinkwrap.docs.arm.com/en/latest/index.html + type: documentation + - resource: + title: OpenVMM and OpenHCL project + link: https://github.com/microsoft/openvmm + type: website + +### FIXED, DO NOT MODIFY +# ================================================================================ +weight: 1 # _index.md always has weight of 1 to order correctly +layout: "learningpathall" # All files under learning paths have this same wrapper +learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content. +--- diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_next-steps.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_next-steps.md new file mode 100644 index 0000000000..1b533c07ad --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/_next-steps.md @@ -0,0 +1,9 @@ +--- +# ================================================================================ +# FIXED, DO NOT MODIFY THIS FILE +# ================================================================================ +weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation. +title: "Next Steps" # Always the same, html page title. +layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing. +--- + diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/build-stack.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/build-stack.md new file mode 100644 index 0000000000..a123ba00b5 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/build-stack.md @@ -0,0 +1,221 @@ +--- +# User change +title: "Build the planes-enabled stack" + +weight: 3 + +# Do not modify these elements +layout: "learningpathall" +--- + +## Install host packages + +Use Ubuntu 24.04 LTS for the host system. Install the packages needed by the CCA development platform, Shrinkwrap, Docker, and the prototype builds: + +```console +sudo apt update +sudo apt upgrade +sudo apt install build-essential cmake ninja-build python3-venv ccache git \ + parted e2fsprogs docker.io netcat-openbsd telnet net-tools docker-buildx \ + curl flex libssl-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu +``` + +These commands require `sudo` access. If you are using a shared host where you do not have passwordless `sudo`, ask the administrator to install the packages or use a host where they are already +present. + +Add your user to the `docker` group: + +```console +sudo usermod -aG docker $USER +newgrp docker +``` + +Check that Docker is available: + +```console +docker ps +``` + +## Clone and initialize the CCA development platform + +Clone the CCA development platform repository: + +```console +mkdir -p $HOME/cca-planes-workbook +cd $HOME/cca-planes-workbook +git clone --branch planes https://github.com/EllieRoe/CCA-dev-platform.git CCA-dev-platform +cd CCA-dev-platform +``` + +This command must complete without prompting for GitHub credentials before the Learning Path is ready for publication. If GitHub prompts for credentials, the repository is still unavailable through +public HTTPS access. + +Set up the build environment: + +```console +source setup.source_me +``` + +This command creates a Python virtual environment, installs the Python packages needed by Shrinkwrap, and sets the `SHRINKWRAP_*` environment variables. The package installation step needs network +access to Python package indexes unless the host already has a populated virtual environment. + +## Verify the planes Shrinkwrap overlays + +The `planes` branch provides the two overlays used by this Learning Path: + +- `config/cca-planes-lp.yaml` keeps the base CCA Learning Path filesystem and + tooling changes, while excluding the `kvmtool.yaml` layer that applies + `config/lkvm.patch`. +- `config/planes.yaml` selects the prototype RMM, host Linux, and `kvmtool` + branches, and enables Permission Indirection and Permission Overlay in the FVP + parameters. + +Check that both overlays are present: + +```console +test -f config/cca-planes-lp.yaml +test -f config/planes.yaml +``` + +If either command fails, update the CCA development platform checkout to a +`planes` branch commit that includes both overlay files. + +{{% notice Warning %}} +Testing on Ubuntu 24.04 showed that `--overlay cca-lp.yaml --overlay planes.yaml` fails while applying `config/lkvm.patch` to `net/uip/tcp.c` in the planes-enabled `kvmtool` branch. Shrinkwrap appends +list values from later overlays, so adding another `kvmtool.prebuild` list in `planes.yaml` does not remove the inherited patch command. Use a planes-specific Learning Path overlay that excludes the +`kvmtool.yaml` layer, or update the CCA development platform so the patch is skipped for the planes branch. +{{% /notice %}} + +Validate the merged Shrinkwrap configuration before starting the full build: + +```console +shrinkwrap build cca-3world.yaml --overlay cca-planes-lp.yaml --overlay planes.yaml \ + --btvar GUEST_ROOTFS='${artifact:BUILDROOT}' --dry-run +``` + +The dry run prints the generated build script. If it reports a missing overlay, a malformed macro, or an unresolved repository setting, fix the overlay before you continue. + +Build the CCA stack with the planes Learning Path overlay and the planes feature overlay: + +```console +shrinkwrap build cca-3world.yaml --overlay cca-planes-lp.yaml --overlay planes.yaml \ + --btvar GUEST_ROOTFS='${artifact:BUILDROOT}' +``` + +## Build the plane 0 Linux kernel + +Clone the OpenHCL Linux source and check out the branch used by the planes demo: + +```console +cd $HOME/cca-planes-workbook +git clone --branch planes \ + http://atg-devlab-chimera.cambridge.arm.com:8080/fenimore-prototyping/openhcl-linux.git \ + openhcl-linux +cd openhcl-linux +``` + +The OpenHCL prototype notes recommend Arm GNU Toolchain 13.3.Rel1 for consistent results. The package installation step above installs Ubuntu's `aarch64-linux-gnu` GCC 13.3 cross compiler, which is +the compiler used by the commands below. + +Configure the kernel for a Realm guest, 9P file sharing, and OpenHCL support: + +```console +export ARCH=arm64 +export CROSS_COMPILE=aarch64-linux-gnu- +make defconfig +./scripts/config --file .config --enable CONFIG_VIRT_DRIVERS --enable CONFIG_ARM_CCA_GUEST +./scripts/config --file .config --enable CONFIG_NET_9P --enable CONFIG_NET_9P_FD +./scripts/config --file .config --enable CONFIG_NET_9P_VIRTIO --enable CONFIG_NET_9P_FS +./scripts/config --file .config --enable CONFIG_HYPERV --enable CONFIG_HYPERV_MSHV +./scripts/config --file .config --enable CONFIG_MSHV --enable CONFIG_MSHV_VTL +./scripts/config --file .config --enable CONFIG_HYPERV_VTL_MODE +make olddefconfig +make Image -j$(nproc) +``` + +## Build the test microkernel and VMM + +Clone the OpenVMM/OpenHCL source and check out the branch used by the planes demo: + +```console +cd $HOME/cca-planes-workbook +git clone --branch cca-support \ + http://atg-devlab-chimera.cambridge.arm.com:8080/fenimore-prototyping/openhcl.git \ + openvmm +cd openvmm +``` + +Install Rust 1.85.0 with `rustup`. The OpenVMM prototype branch is validated +with this Rust toolchain: + +```console +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ + sh -s -- --default-toolchain=1.85.0 -y +source "$HOME/.cargo/env" +``` + +Install the Rust source component and the targets used by the test microkernel +and the VMM: + +```console +rustup component add rust-src --toolchain 1.85.0 +rustup target add aarch64-unknown-linux-gnu --toolchain 1.85.0 +rustup target add aarch64-unknown-none --toolchain 1.85.0 +``` + +Build the binaries: + +```console +unset ARCH +unset CROSS_COMPILE +RUSTC_BOOTSTRAP=1 cargo +1.85.0 build -p simple_tmk \ + --config openhcl/minimal_rt/aarch64-config.toml +RUSTC_BOOTSTRAP=1 cargo +1.85.0 build -p tmk_vmm \ + --target aarch64-unknown-linux-gnu +``` + +## Add the plane 0 kernel and test binaries to the root filesystem + +Resize the root filesystem to make room for the prototype binaries: + +```console +export CCA_PLANES_WORKDIR=$HOME/cca-planes-workbook +export PLANE0_IMAGE=$CCA_PLANES_WORKDIR/openhcl-linux/arch/arm64/boot/Image +export SIMPLE_TMK=$CCA_PLANES_WORKDIR/openvmm/target/aarch64-minimal_rt-none/debug/simple_tmk +export TMK_VMM=$CCA_PLANES_WORKDIR/openvmm/target/aarch64-unknown-linux-gnu/debug/tmk_vmm + +cd $CCA_PLANES_WORKDIR/CCA-dev-platform +cd "$SHRINKWRAP_PACKAGE/cca-3world" +TOOLS_PATH="$SHRINKWRAP_BUILD/build/cca-3world/buildroot/host/sbin" +$TOOLS_PATH/e2fsck -fp rootfs.ext2 +$TOOLS_PATH/resize2fs rootfs.ext2 1G +``` + +Create `/cca` in the root filesystem image: + +```console +$TOOLS_PATH/debugfs -w -R "mkdir /cca" rootfs.ext2 +``` + +Copy the files needed by plane 0: + +```console +$TOOLS_PATH/debugfs -w -R "write guest-disk.img /cca/guest-disk.img" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write KVMTOOL_EFI.fd /cca/KVMTOOL_EFI.fd" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write Image /cca/Image" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write lkvm /cca/lkvm" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write $PLANE0_IMAGE /cca/Image_ohcl" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write $SIMPLE_TMK /cca/simple_tmk" rootfs.ext2 +$TOOLS_PATH/debugfs -w -R "write $TMK_VMM /cca/tmk_vmm" rootfs.ext2 +``` + +Check that the files were copied and that the root filesystem is consistent: + +```console +$TOOLS_PATH/debugfs -R "ls -l /cca" rootfs.ext2 +$TOOLS_PATH/e2fsck -fn rootfs.ext2 +``` + +## What you've accomplished + +You have built the planes-enabled CCA stack, the plane 0 Linux kernel, and the TMK test binaries. Next, boot the FVP and start the Realm. diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/overview.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/overview.md new file mode 100644 index 0000000000..af5e0287c4 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/overview.md @@ -0,0 +1,30 @@ +--- +# User change +title: "Understand CCA planes" + +weight: 2 + +# Do not modify these elements +layout: "learningpathall" +--- + +## Understand CCA planes + +Arm Confidential Compute Architecture (CCA) protects confidential workloads by running them in Realms. Planes extend this model by dividing a Realm into multiple isolated execution environments. + +Plane 0 is the initial Realm execution environment. Plane N is an auxiliary plane that plane 0 software can enter by using the Realm Service Interface (RSI). In this Learning Path, plane 0 runs a Linux kernel with support for the OpenHCL prototype. Plane 0 then starts a small VMM process, `tmk_vmm`, which enters plane 1 and runs the `simple_tmk` test microkernel. + +The prototype stack has the following components: + +- An Arm FVP with Realm Management Extension (RME), Permission Indirection, and Permission Overlay support enabled. +- Trusted Firmware-A (TF-A) and the Realm Management Monitor (RMM) built with CCA v1.1 experimental features enabled. +- Host Linux and `kvmtool` with support for creating a Realm that has an auxiliary plane. +- Plane 0 Linux with CCA guest support, 9P filesystem support, and OpenHCL driver support. +- `tmk_vmm` and `simple_tmk`, built from OpenVMM/OpenHCL sources. + +Plane 0 prepares memory and processor state for the auxiliary plane. When `tmk_vmm` runs, it uses the CCA backend to call into the plane support exposed by plane 0 Linux. The RMM handles the transition from plane 0 to plane 1, and returns control to plane 0 on a plane exit. + +## What you've learned + +You have seen the role of each component in the prototype flow. Next, set up the host machine and build the software stack. + diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/publication-readiness.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/publication-readiness.md new file mode 100644 index 0000000000..9658a26959 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/publication-readiness.md @@ -0,0 +1,131 @@ +--- +# User change +title: "Prepare the Learning Path for publication" + +weight: 6 + +# Do not modify these elements +layout: "learningpathall" +--- + +## Publication readiness + +This Learning Path is a draft. Complete the following tasks before publication: + +- Publish `https://github.com/EllieRoe/CCA-dev-platform.git` with unauthenticated HTTPS clone access, or replace the source-build steps with a public prebuilt Docker image. +- Push the CCA-dev-platform `planes` branch through commit + `edfca45414f8ea0a90f08ff9d9cee99b85c8e3e0`, or an equivalent commit that + provides `config/cca-planes-lp.yaml` and `config/planes.yaml`, including the + MEC FVP run parameters required by `ENABLE_FEAT_MEC=1` and + `RMM_V1_COMPAT=1` for the pinned TF-RMM revision. +- Run `shrinkwrap build ... --dry-run` with the published overlay and fix any Shrinkwrap macro escaping issues. +- Run a real Shrinkwrap build through the `kvmtool` phase and confirm that `config/lkvm.patch` is not applied to the planes-enabled branch. +- Publish or identify the public OpenHCL Linux branch used for the plane 0 kernel. The current prototype uses the internal `openhcl-linux` `planes` branch. +- Publish or identify the public OpenVMM/OpenHCL branch used for `simple_tmk` and `tmk_vmm`. The current prototype uses the internal `openhcl` `cca-support` branch. +- Confirm that the OpenVMM/OpenHCL branch is reachable from a clean host. The public upstream OpenVMM repository does not currently expose an obvious CCA planes branch for this draft. +- Replace internal prototype repository URLs and branch names with public URLs. +- Replace the captured internal `tmk_vmm` output with the final public demo + output, or remove the post-test CCA register-read panic from the prototype. +- Test the full flow on a clean Ubuntu 24.04 LTS host. +- Remove `draft: true` from `_index.md` after the content is runnable from public inputs. + +## Tested state + +Testing on 29 June 2026 used Ubuntu 24.04.4 LTS and the `planes` branch of `CCA-dev-platform`. + +The HTTPS clone command prompted for GitHub credentials: + +```console +git clone --branch planes https://github.com/EllieRoe/CCA-dev-platform.git CCA-dev-platform +``` + +SSH access to the same repository initially reached commit `a7c5ec548bbf148ace0bea889cba92ef33c33f76` on the `planes` branch. + +The required planes overlays were absent at that commit. CCA-dev-platform commit +`401dfd13882e994df38fa741266b14ccda2d407c` adds the overlays, commit +`70c5e946294e81da8fbe4d9a4bc079526e31925e` adds the MEC FVP run parameters +required to boot the TF-A build, and commit +`edfca45414f8ea0a90f08ff9d9cee99b85c8e3e0` enables `RMM_V1_COMPAT=1` for the +pinned TF-RMM revision: + +```console +test -f config/cca-planes-lp.yaml +test -f config/planes.yaml +``` + +With those overlays available, the documented Shrinkwrap dry run generated a build script: + +```console +shrinkwrap build cca-3world.yaml --overlay cca-planes-lp.yaml --overlay planes.yaml \ + --btvar GUEST_ROOTFS='${artifact:BUILDROOT}' --dry-run +``` + +The generated script selected `linux-cca` branch `cca/planes/rfc-v1`, `kvmtool-cca` branch `cca/planes/rfc-v1`, TF-RMM commit `9a98e8fcb1645b9917b2abd79212e6e3062e09fd`, and TF-A +parameter `GIC_ENABLE_V4_EXTN=1`. The generated script did not contain `config/lkvm.patch`. + +The full Shrinkwrap build completed successfully with the generated overlays: + +```console +shrinkwrap build cca-3world.yaml --overlay cca-planes-lp.yaml --overlay planes.yaml \ + --btvar GUEST_ROOTFS='${artifact:BUILDROOT}' +``` + +The build completed the `buildroot` and `guest-disk` artifact stages. + +The internal OpenHCL Linux source resolved branch `planes` to commit `b407f1ab33b2092f054cf3d5087ee6933a80d5f4`. The plane 0 kernel build completed and produced +`arch/arm64/boot/Image`. + +The internal OpenVMM/OpenHCL source resolved branch `cca-support` to commit `e09ae82bb0b9ea55ec52c490e000539088dad8ab`. The `simple_tmk` and `tmk_vmm` builds completed with Rust 1.85.0, +`rust-src`, `aarch64-unknown-linux-gnu`, and `aarch64-unknown-none`. + +The root filesystem resize completed from 256 MiB to 1 GiB. The copy step completed with `debugfs`, and `e2fsck -fn rootfs.ext2` passed after copying the plane 0 files into `/cca`. The `tp-desktop` +test host did not have passwordless `sudo`, so the Learning Path uses `debugfs` instead of mounting the root filesystem image. + +The FVP boot test used FVP `FVP_Base_RevC_AEMvA_11.31_28` from the existing `armlimited/cca-learning-path:cca-simulation-kitten-1-x86_64` Docker image because the model was not installed in the +`tp-desktop` host `PATH`. The first boot attempt failed in BL31 with `feat_mec not supported by the PE`. After adding the MEC FVP run parameters to `cca-planes-lp.yaml` and running +`shrinkwrap run` with both overlays, the FVP reached the Linux login prompt. + +The first Realm start attempt failed before the Realm launched because BL31 +logged `RMM init failed: -2`, and the host kernel did not report an RMI ABI. +After enabling `RMM_V1_COMPAT=1`, the host kernel reported +`RMI ABI version 1.1` and kvmtool started the Realm. + +The Realm command was tested with `--disk /cca/guest-disk.img`. Without the +disk, plane 0 Linux mounted the 9P share as the root filesystem and panicked +while running `/virt/init`. With the disk argument present, plane 0 Linux +detected `vda1` and `vda2`, mounted `/dev/vda2` as ext4, ran `/sbin/init`, and +reached the login prompt. + +Plane 0 login as `root` was tested. The documented 9P mount command mounted +`cca_mount` on `/root/mount`, the hugetlbfs command mounted `none` on +`/root/huge` with `pagesize=32M`, and `simple_tmk` and `tmk_vmm` were visible +through the 9P mount. + +The `tmk_vmm` command was tested from `/root/mount` with the CCA backend and +`simple_tmk`. The log showed the plane 1 memory permission setup, multiple +`rsi_plane_enter` calls, `tmk: hello world`, and `tmk_vmm::run: test complete`. +The shell reported exit code 0. The internal `cca-support` branch also emitted +a post-test Rust panic from `openhcl/virt_mshv_vtl/src/processor/cca/mod.rs` +line 386, where the CCA `registers()` accessor is still implemented as +`todo!()`. + +## Optional Docker flow + +If the final demo is packaged as a Docker image, replace the build page with a shorter setup flow: + +```console +docker pull armswdev/cca-learning-path:cca-planes-openhcl- +docker run --rm -it armswdev/cca-learning-path:cca-planes-openhcl- +``` + +The image should contain: + +- A planes-enabled FVP launch script. +- A planes-enabled CCA host root filesystem. +- `Image_ohcl` for plane 0 Linux. +- `simple_tmk` and `tmk_vmm`. +- Any helper scripts needed to mount 9P and hugetlbfs in plane 0. + +## Source handling + +Use public sources in the final Learning Path. Do not copy private links, private branch names, or restricted diagrams into the public Learning Paths repository. diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-auxiliary-plane.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-auxiliary-plane.md new file mode 100644 index 0000000000..0cb02f2084 --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-auxiliary-plane.md @@ -0,0 +1,69 @@ +--- +# User change +title: "Run the auxiliary plane test" + +weight: 5 + +# Do not modify these elements +layout: "learningpathall" +--- + +## Start the test microkernel + +Run `tmk_vmm` from plane 0: + +```console +cd /root/mount +export RUST_BACKTRACE=1 +./tmk_vmm --hv cca --tmk ./simple_tmk +``` + +The VMM prepares memory for the auxiliary plane, asks the plane 0 kernel to set the required permissions, and enters the test microkernel. + +The output is similar to: + +```output +mshv_rsi_set_mem_perm: plane=1, base_addr=0x9a000000, top_addr=0x9c000000 +rsi_plane_enter: plane=1 +INFO tmk: hello world +rsi_plane_enter: plane=1 +INFO tmk_vmm::run: test complete +``` + +## Validate the result + +Confirm these conditions before treating the run as successful: + +- The OpenHCL CCA backend selects the `cca` hypervisor path. +- The test microkernel reaches its success path. +- `tmk_vmm` prints `test complete`. +- Control returns to plane 0 after the auxiliary plane exits. + +{{% notice Note %}} +The internal WIP branch tested for this draft printed `test complete` and +returned exit code 0, then an unnamed thread emitted a Rust panic from an +unimplemented CCA register-read path. Replace this note with the final expected +output before publication. +{{% /notice %}} + +If the command fails before entering the auxiliary plane, check that `/root/huge` is mounted with 32 MB pages and that the `hugepagesz=32M hugepages=1` kernel parameters were passed to plane 0 Linux. + +If the command reports that CCA support is unavailable, check that the stack was built with planes-enabled RMM, host kernel, and `kvmtool` components. + +## Shut down + +Shut down plane 0 Linux: + +```console +poweroff +``` + +When you return to the CCA host prompt, shut down the host: + +```console +poweroff +``` + +## What you've accomplished + +You have run the test VMM in plane 0 and used it to start a test microkernel in an auxiliary plane. diff --git a/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-plane0.md b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-plane0.md new file mode 100644 index 0000000000..e2981606da --- /dev/null +++ b/content/learning-paths/servers-and-cloud-computing/cca-planes-openhcl/run-plane0.md @@ -0,0 +1,76 @@ +--- +# User change +title: "Boot plane 0 Linux" + +weight: 4 + +# Do not modify these elements +layout: "learningpathall" +--- + +## Run the FVP + +Make sure that `FVP_Base_RevC-2xAEMvA` is available in your `PATH`. + +Start the CCA stack on the FVP: + +```console +shrinkwrap run cca-3world.yaml --overlay cca-planes-lp.yaml --overlay planes.yaml \ + --rtvar ROOTFS=$(realpath "$SHRINKWRAP_PACKAGE/cca-3world/rootfs.ext2") +``` + +Log in to the CCA host as `root`. No password is required. + +## Start a Realm with plane 0 Linux + +Change to the directory that contains the CCA demo files: + +```console +cd /cca +``` + +Start the Realm with the plane 0 kernel, guest root disk, 9P sharing, and a +32 MB huge page for the auxiliary plane payload: + +```console +./lkvm run --realm --disable-sve --irqchip=gicv3-its \ + -c 1 -m 512 --no-pvtime --force-pci --console virtio \ + --kernel /cca/Image_ohcl --disk /cca/guest-disk.img --9p /cca/,cca_mount \ + -p "console=hvc0 root=/dev/vda2 hugepagesz=32M hugepages=1" \ + --measurement-algo=sha256 --restricted_mem +``` + +The plane 0 Linux kernel boots inside the Realm. Log in as `root` when the login prompt appears. + +## Prepare shared files and huge pages + +Create a mount point for the 9P share: + +```console +mkdir -p /root/mount +mount -t 9p -o trans=virtio cca_mount /root/mount +``` + +Create the hugetlbfs mount used by `tmk_vmm`: + +```console +mkdir -p /root/huge +mount -t hugetlbfs -o pagesize=32768kB,size=32768kB none /root/huge +``` + +Confirm that the test binaries are visible from plane 0: + +```console +ls /root/mount/simple_tmk /root/mount/tmk_vmm +``` + +The output should show both files: + +```output +/root/mount/simple_tmk +/root/mount/tmk_vmm +``` + +## What you've accomplished + +You have booted plane 0 Linux inside a CCA Realm and prepared the shared filesystem and huge page needed by the auxiliary plane test.