HomeFreeBSD

tests/ci: Switch vmm detection

Description

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

Details

Provenance
bofhAuthored on May 2 2025, 5:28 PM
Differential Revision
D50115: tests/ci: switch vmm detection to nested virtualization check
Parents
rG9ea78ef1d6f9: arm64: Use the DMAP region in pmap_mapbios
Branches
Unknown
Tags
Unknown