git: 5ea28c513979 - main - tests/ci: Switch vmm detection
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 02 May 2025 17:31:05 UTC
The branch main has been updated by bofh:
URL: https://cgit.FreeBSD.org/src/commit/?id=5ea28c51397906a7cabb06089974feb21e2a7979
commit 5ea28c51397906a7cabb06089974feb21e2a7979
Author: Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2025-05-02 17:28:51 +0000
Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2025-05-02 17:28:51 +0000
tests/ci: Switch vmm detection
Previously, the CI Makefile used `kldload -n vmm` to determine whether
the host supported bhyve virtualization. However, due to changes in how
QEMU/KVM exposes CPU features to guests, this check no longer reliably
indicates the presence of usable VMX/SVM support.
In particular, modern QEMU configurations expose the vmx CPUID bit by
default, allowing the vmm module to load even when nested virtualization
is disabled. This causes the old check to incorrectly succeed inside
virtualized environments where bhyve cannot function.
This patch replaces the check with a sysctl-based approach that inspects
kern.vm_guest. If the system identifies itself as running inside a guest
(!= "none"), we assume nested virtualization is unavailable and fallback
to QEMU.
This change ensures CI behaves correctly on platforms where the vmm
module loads but is not usable.
Approved by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50115
---
tests/ci/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/ci/Makefile b/tests/ci/Makefile
index e452d74679af..e51c97fa2b83 100644
--- a/tests/ci/Makefile
+++ b/tests/ci/Makefile
@@ -123,8 +123,8 @@ VM_MEM_SIZE=${QEMU_MAX_MEM_SIZE}g
.else
VM_MEM_SIZE=${VM_MEM}g
.endif
-KLDVMMISLOADED!=kldload -q -n vmm 2>/dev/null && echo "1" || echo "0"
-.if ${KLDVMMISLOADED} == "0"
+VMGUEST!=sysctl -n kern.vm_guest 2>/dev/null || true
+.if ${VMGUEST} != "none"
USE_QEMU?=1
.endif
KLDFILEMONISLOADED!=kldload -q -n filemon 2>/dev/null && echo "1" || echo "0"