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)
Jan 16 2024, 7:30 PM
Unknown Object (File)
Dec 27 2023, 1:38 AM
Unknown Object (File)
Dec 20 2023, 9:00 PM
Unknown Object (File)
Dec 18 2023, 5:57 PM
Unknown Object (File)
Dec 12 2023, 3:52 AM
Unknown Object (File)
Dec 11 2023, 5:42 PM
Unknown Object (File)
Sep 22 2023, 7:02 PM
Unknown Object (File)
Sep 4 2023, 5:30 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 Not Applicable
Unit
Tests Not Applicable

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.