Page MenuHomeFreeBSD

x86: gate smbios hypervisor identification behind vm_guest
ClosedPublic

Authored by kevans on Mar 17 2023, 12:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 27 2024, 10:05 AM
Unknown Object (File)
Nov 18 2024, 4:57 AM
Unknown Object (File)
Nov 2 2024, 7:33 AM
Unknown Object (File)
Sep 23 2024, 7:14 PM
Unknown Object (File)
Sep 14 2024, 7:09 PM
Unknown Object (File)
Sep 13 2024, 4:41 AM
Unknown Object (File)
Sep 13 2024, 4:40 AM
Unknown Object (File)
Sep 3 2024, 2:34 PM
Subscribers
None

Details

Summary

cpuid detection may have picked up a more specific guest type already,
and a follow-up check of smbios vendor/product may erroneously blow
away the previously detected type.

I considered moving these calls back into identify_hypervisor(), but
elected for the less invasive change; no objection to switching it.

Fixes: 2fee87562948 ("abstract out the vm detection via smbios..")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 50437
Build 47328: arc lint + arc unit

Event Timeline

kevans created this revision.

I'm seeing something weird on arm64 as well, so I wonder if a similar bug was introduce in its machdep.c too?
though I'm seeing it with a loaded module specifying the machine's UUID...
I'll have to chase it down tomorrow, since I need sleep tonight...

In any event, this change looks good to me.

This revision is now accepted and ready to land.Mar 17 2023, 4:01 AM

Though my issue is uuid, and is likely completely orthogonal to this...

sys/dev/smbios/smbios_subr.c
72

though I do wonder if this is the right assert for arm64...

sys/dev/smbios/smbios_subr.c
72

arm64 doesn't have any other way of detecting that we're a VM guest, so it won't actually hit these

No objections, but IMO it would be slightly cleaner to check the condition in identify_hypervisor_smbios() and immediately return, instead of asserting.

In D39140#890858, @kib wrote:

No objections, but IMO it would be slightly cleaner to check the condition in identify_hypervisor_smbios() and immediately return, instead of asserting.

Sure, I don't have strong feelings about it, so I'll just go ahead and do that.