Re: [PATCH v2] x86/bhyve: Detect FreeBSD Bhyve hypervisor
From: Ahmed S. Darwish
Date: Mon Aug 18 2025 - 05:37:47 EST
On Fri, 15 Aug 2025, David Woodhouse wrote:
>
> Or just not, in the case of jailhouse and bhyve? Since cpuid_feature()
> is hard-coded to true for x86_64 anyway, and they both depend on that
> (like acrn, which already only checks for X86_FEATURE_HYPERVISOR).
>
> And anyway, how is X86_FEATURE_HYPERVISOR even going to get set if
> there's no CPUID? Can that happen?
>
Correct, these early-boot feature detection code paths are all already
messed up. I will clean them as part of the CPUID parser work.
For example, in the CPUID parser patch queue next iteration (v5),
X86_FEATURE flags are integrated. There's also a Directed Acylic Graph
of X86_FEATURE and CPUID bits dependencies.
So, in the above case, the dependencies table will just have:
X86_FEATURE_HYPERVISOR ► X86_FEATURE_CPUID (and whatever else)
and all the circles of x86 vendor checking, CPUID max level checking,
other CPUID-bits checking, X86_FEATURE dependency checking, etc. will all
be removed from call sites.
I will show more of that at LPC Japan x86 track, and hopefully much
before that the CPUID parser v5 shall also be already posted to LKML.
Thanks!
Ahmed