Page MenuHomeFreeBSD

cloud: Add GCE VM Product Name to magic string detection list
Needs ReviewPublic

Authored by wac_gmail.com on Sun, Jan 11, 10:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 29, 6:46 PM
Unknown Object (File)
Thu, Jan 29, 5:50 PM
Unknown Object (File)
Thu, Jan 29, 4:51 PM
Unknown Object (File)
Thu, Jan 29, 4:31 PM
Unknown Object (File)
Wed, Jan 28, 4:22 PM
Unknown Object (File)
Mon, Jan 26, 2:13 AM
Unknown Object (File)
Sun, Jan 25, 3:39 PM
Unknown Object (File)
Fri, Jan 23, 2:31 AM

Details

Reviewers
andrew
Summary

Recognize "Google Compute Engine" in smbios system information product name as an indicator of KVM-based virtualization. Working hypervisor detection is necessary on GCE in order to apply PCI_QUIRK_ENABLE_MSI_VM.

To avoid GCE's baremetal types, we check if smbios.system.serial which starts with "GoogleCloud-BM-" rather than just "GoogleCloud-" before the UUID.

Test Plan

Tested on c4a and c4 family VMs.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This is a much more GCE specific change for hypervisor detection. Works on arm64 and amd64 VM types.

And how does a "-metal" (ie: Bare metal) Google Compute Engine behave with this patch?

Currently bare metal is not supported with FreeBSD on Google Compute Engine, but there are plans to support it soon. However, this change would indeed cause future bare metal instances to be incorrectly marked as using KVM-based virtualization. From some internal investigation, it is not immediately clear if there are consistent differences between virtualized versus bare metal instances in terms of info in the SMBIOS tables.

When I get a chance I'll fire up some bare metal vms and see what I get out of dmidecode. On vacation this week so it'll be a little bit.

wac_gmail.com edited the summary of this revision. (Show Details)

I did a survey of GCE's bare metal machine series, as well as internal checking. All of them show smbios.system.serial of the form GoogleCloud-BM-${uuid}, as opposed to GoogleCloud-${uuid} for non-bare-metal VMs.

So I've updated the patch to do a strncmp on the start of smbios.system.serial to check for the baremetal telltale and set to VM_GUEST_NO if smbios.system.product is "Google Compute Engine" and the baremetal telltale is present.

sys/dev/smbios/smbios_subr.c
64

Seems to be missing a space before the "}". Please consider uploading diffs with -u 9999 so we can see more context.

Fixed the space typo. Thanks for the patience.