From dba57c90b186081ea3462571a8fb3d3a98429bae Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 12:05:11 +0000 Subject: [PATCH 1/6] feat(qemu): update CloudVM to latest version This fixes an error during QEMU boot where `growpart` couldn't find `sed`, `grep` and other such tools. --- MODULE.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index e3b36799..fb5cc7d9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -337,8 +337,8 @@ download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "downlo urls = ["https://cloud.debian.org/images/cloud/bookworm/{1}/debian-12-generic-{0}-{1}.qcow2".format(cpu, version)], ) for cpu, version, integrity in ( - ("amd64", "20240901-1857", "sha256-p9rCK1tT7V/uDBI70LR3UoT8vK1aaJ9rWpL0jgXp+1I="), - ("arm64", "20240901-1857", "sha256-gxjqgasbjKLrLUtVJYz/MTiPbttisBz3Y4HglSRRspo="), + ("amd64", "20241125-1942", "sha256-xT8iVb7Gv+gTbtJJGicwbIXG+HNeqxSeFPfI4hMDeY0="), + ("arm64", "20241125-1942", "sha256-0HZJrXlPsGgbEw79BtGDK39Ioed+XjAma/0WID+sPCM="), ) ] -- GitLab From 5c1230d7a9a1fa4b3e45e1a7d7f3fbc294de0d82 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 12:06:22 +0000 Subject: [PATCH 2/6] perf(qemu): use `virtio-net-pci` on `arm64` It's supposed to be faster. --- labgrid/toolchain/config/qemu/arm64/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/toolchain/config/qemu/arm64/config.yaml b/labgrid/toolchain/config/qemu/arm64/config.yaml index 1bfe6b2d..fca78676 100644 --- a/labgrid/toolchain/config/qemu/arm64/config.yaml +++ b/labgrid/toolchain/config/qemu/arm64/config.yaml @@ -13,7 +13,7 @@ targets: cpu: "max" memory: "2G" bios: "efi" - nic: "user,model=e1000,hostfwd=tcp::2223-:22" + nic: "user,model=virtio-net-pci,hostfwd=tcp::2223-:22" extra_args: !template "-snapshot -drive file=$LG_QEMU_QCOW2_IMAGE,format=qcow2 -cdrom $LG_QEMU_VIRT_IMAGE" ShellDriver: prompt: " login: " -- GitLab From 3796d8dd8904c789de23a3594d3cbdefccc0c49e Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 13:50:55 +0000 Subject: [PATCH 3/6] perf(qemu): use faster pointer authentication algorithm on `arm64` See: https://www.qemu.org/docs/master/system/arm/cpu-features.html#tcg-vcpu-features --- labgrid/toolchain/config/qemu/arm64/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/toolchain/config/qemu/arm64/config.yaml b/labgrid/toolchain/config/qemu/arm64/config.yaml index fca78676..c5eec42b 100644 --- a/labgrid/toolchain/config/qemu/arm64/config.yaml +++ b/labgrid/toolchain/config/qemu/arm64/config.yaml @@ -10,7 +10,7 @@ targets: QEMUDriver: qemu_bin: "qemu" machine: "virt" - cpu: "max" + cpu: "max,pauth-impdef=on" memory: "2G" bios: "efi" nic: "user,model=virtio-net-pci,hostfwd=tcp::2223-:22" -- GitLab From cd5ba3f57c771a881cb69ba09c532f61ac6bdb15 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 15:15:10 +0000 Subject: [PATCH 4/6] perf(qemu): enable virtualization on `arm64` See: https://www.qemu.org/docs/master/system/arm/virt.html#machine-specific-options --- labgrid/toolchain/config/qemu/arm64/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/toolchain/config/qemu/arm64/config.yaml b/labgrid/toolchain/config/qemu/arm64/config.yaml index c5eec42b..4d99d04b 100644 --- a/labgrid/toolchain/config/qemu/arm64/config.yaml +++ b/labgrid/toolchain/config/qemu/arm64/config.yaml @@ -9,7 +9,7 @@ targets: drivers: QEMUDriver: qemu_bin: "qemu" - machine: "virt" + machine: "virt,virtualization=on" cpu: "max,pauth-impdef=on" memory: "2G" bios: "efi" -- GitLab From ab8c3cef85ffdac9ac9aaa68c1b2b9aa0899bbb4 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 15:44:11 +0000 Subject: [PATCH 5/6] perf(qemu): increase number of vCPUs for `arm64` --- labgrid/toolchain/config/qemu/arm64/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/toolchain/config/qemu/arm64/config.yaml b/labgrid/toolchain/config/qemu/arm64/config.yaml index 4d99d04b..0c4098c0 100644 --- a/labgrid/toolchain/config/qemu/arm64/config.yaml +++ b/labgrid/toolchain/config/qemu/arm64/config.yaml @@ -14,7 +14,7 @@ targets: memory: "2G" bios: "efi" nic: "user,model=virtio-net-pci,hostfwd=tcp::2223-:22" - extra_args: !template "-snapshot -drive file=$LG_QEMU_QCOW2_IMAGE,format=qcow2 -cdrom $LG_QEMU_VIRT_IMAGE" + extra_args: !template "-snapshot -smp 4 -drive file=$LG_QEMU_QCOW2_IMAGE,format=qcow2 -cdrom $LG_QEMU_VIRT_IMAGE" ShellDriver: prompt: " login: " login_prompt: " login: " -- GitLab From 1294005c48a0f806ed2a11e6a7860fce11d3fcb6 Mon Sep 17 00:00:00 2001 From: Alex Tercete Date: Fri, 29 Nov 2024 14:48:58 +0000 Subject: [PATCH 6/6] revert(qemu): temporarily remove `arm64` test Refs: 95a511dd36fd266689bd803a391fc91fbf3b08a5 --- e2e/qemu/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/qemu/BUILD.bazel b/e2e/qemu/BUILD.bazel index 8cf836ca..220e81cd 100644 --- a/e2e/qemu/BUILD.bazel +++ b/e2e/qemu/BUILD.bazel @@ -1,7 +1,7 @@ load("@rules_diff//diff/file/test:defs.bzl", "diff_file_test") load("@rules_labgrid//labgrid/run:defs.bzl", "labgrid_run") -CPUS = ("amd64",) +CPUS = ("amd64", "arm64") [ labgrid_run( -- GitLab