Page MenuHomeFreeBSD

tests/ci: switch vmm detection to nested virtualization check
ClosedPublic

Authored by bofh on Fri, May 2, 12:08 PM.
Tags
None
Referenced Files
F116940857: D50115.diff
Mon, May 12, 6:32 AM
Unknown Object (File)
Wed, May 7, 7:43 AM
Unknown Object (File)
Fri, May 2, 5:31 PM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bofh requested review of this revision.Fri, May 2, 12:08 PM
tests/ci/Makefile
126–127

variable name seems odd, why not just VMGUEST?

Rename variable to VMGUEST

bofh marked an inline comment as done.Fri, May 2, 5:20 PM
This revision is now accepted and ready to land.Fri, May 2, 5:25 PM
This revision was automatically updated to reflect the committed changes.