From 8c7a3cf83bfb1a50c5323f4b32a1f530aceb2dc8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker Date: Tue, 3 Dec 2024 16:27:43 +0000 Subject: [PATCH 1/2] configs/cca-3world: Fix documentation Fix some errors in the documentation, and show how to boot the kernel alone, which is very useful for development because much faster. Signed-off-by: Jean-Philippe Brucker --- config/cca-3world.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/config/cca-3world.yaml b/config/cca-3world.yaml index 5dbada5..c6359f6 100644 --- a/config/cca-3world.yaml +++ b/config/cca-3world.yaml @@ -66,10 +66,6 @@ description: >- launch the kernel. Continue to be patient, and eventually you will land at a login prompt. Login as "root" (no password). - This config also builds kvm-unit-tests, which can be run in the realm instead - of Linux. It is also possible to launch Linux without using EDK2 as the guest - FW. - When the linux kernel 9p issue will be fixed, the shared directory approach can be used. Simply boot the host with the SHARE rtvar. This only works for DT-based environments though: @@ -79,14 +75,22 @@ description: >- $ shrinkwrap run cca-3world.yaml --rtvar ROOTFS=rootfs.ext2 --rtvar SHARE=. Then, once the host has booted, log in as "root" (no password) and mount the - shared folder to "/cca" and change dir to it. The realmn guest can then be + shared folder to "/cca" and change dir to it. The realm guest can then be launched as previously: .. code-block:: shell # mkdir /cca # mount -t 9p -o trans=virtio,version=9p2000.L FM /cca # cd /cca - # ./lkvm run --realm --disable-sve --irqchip=gicv3-its --firmware KVMTOOL_EFI.fd -c 1 -m 512 --no-pvtime --force-pci --disk guest-disk.img --measurement-algo=sha256 + # ./lkvm run --realm --disable-sve --irqchip=gicv3-its --firmware KVMTOOL_EFI.fd -c 1 -m 512 --no-pvtime --force-pci --disk guest-disk.img --measurement-algo=sha256 --restricted_mem + + It is also possible to launch Linux without using EDK2 as the guest FW: + + .. code-block:: shell + # ./lkvm run --realm --disable-sve --irqchip=gicv3-its -c 1 -m 512 --no-pvtime --force-pci --console virtio --kernel Image --disk guest-disk.img -p "console=hvc0 root=/dev/vda2" --measurement-algo=sha256 --restricted_mem + + This config also builds kvm-unit-tests, which can be run in the realm instead + of Linux. concrete: true -- GitLab From 6543b99d8c0961891dae64c88d71245506701e42 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Brucker Date: Wed, 27 Nov 2024 14:19:51 +0000 Subject: [PATCH 2/2] configs: Update kvm-unit-tests Update kvm-unit-tests and make it easier to use the final product. Rather than archiving the kvm-unit-tests directory, share it as is with the guest. I've had issues uncompressing the archive from inside the guest, because the buildroot tar didn't recognize the format: tar: invalid tar magic Update the generated config.mak so we can run the test script from within the guest. Signed-off-by: Jean-Philippe Brucker --- config/cca-3world.yaml | 7 ++++++- config/kvm-unit-tests.yaml | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config/cca-3world.yaml b/config/cca-3world.yaml index c6359f6..dbbf185 100644 --- a/config/cca-3world.yaml +++ b/config/cca-3world.yaml @@ -90,7 +90,12 @@ description: >- # ./lkvm run --realm --disable-sve --irqchip=gicv3-its -c 1 -m 512 --no-pvtime --force-pci --console virtio --kernel Image --disk guest-disk.img -p "console=hvc0 root=/dev/vda2" --measurement-algo=sha256 --restricted_mem This config also builds kvm-unit-tests, which can be run in the realm instead - of Linux. + of Linux: + + .. code-block:: shell + # cd /cca/kvm-unit-tests/arm + # export PATH=/cca:$PATH + # ./run-realm-tests concrete: true diff --git a/config/kvm-unit-tests.yaml b/config/kvm-unit-tests.yaml index a2f2cb9..5712251 100644 --- a/config/kvm-unit-tests.yaml +++ b/config/kvm-unit-tests.yaml @@ -10,7 +10,7 @@ build: kvm-unit-tests: repo: remote: https://gitlab.arm.com/linux-arm/kvm-unit-tests-cca - revision: cca/rmm-v1.0-eac5 + revision: cca/rmm-v1.0-rel0 toolchain: aarch64-linux-gnu- @@ -22,7 +22,11 @@ build: build: - ./configure ${param:join_equal} - make -j${param:jobs} - - tar -caf ${param:builddir}/kvm-unit-tests.tgz -C ${param:sourcedir} . + - sed -i -e "/PRETTY_PRINT_STACKS/s/yes/no/" + -e "/ERRATATXT/s/=.*/=errata.txt/" + -e "/HOST/s/=.*/=aarch64/" + -e "/ARCH/s/=.*/=arm64/" + ${param:sourcedir}/config.mak artifacts: - KVM_UNIT_TESTS: ${param:builddir}/kvm-unit-tests.tgz + KVM_UNIT_TESTS: ${param:sourcedir} -- GitLab