Page MenuHomeFreeBSD

Add vmgenc(4): tiny driver for ACPI VM generation counter
AbandonedPublic

Authored by cem on Dec 17 2019, 8:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 3:57 AM
Unknown Object (File)
Dec 11 2023, 3:18 PM
Unknown Object (File)
Nov 12 2023, 6:16 AM
Unknown Object (File)
Nov 8 2023, 9:14 AM
Unknown Object (File)
Nov 6 2023, 1:23 AM
Unknown Object (File)
Nov 5 2023, 4:13 AM
Unknown Object (File)
Nov 3 2023, 2:19 PM
Unknown Object (File)
Oct 8 2023, 5:13 AM
Subscribers

Details

Reviewers
jhb
markj
jkim
Summary

The VM generation counter is a 128-bit value exposed by the BIOS via ACPI.
The value changes to another unique identifier whenever a VM is duplicated.
Additionally, ACPI provides notification events when such events occur.

The driver decodes the pointer to the UUID, exports the value to userspace
via OPAQUE sysctl blob, and forwards the ACPI notifications in the form of
an EVENTHANDLER invocation as well as userspace devctl events.

Test Plan

I need to load this up in a hypervisor that supports the feature to try it out
still (untested). It might be nice to support this host-side in Bhyve as well
(future work).

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28228
Build 26352: arc lint + arc unit

Event Timeline

Uppercase the _CID so we actually match in ACPI_ID_PROBE

This appears to be something internal to ACPICA/acpi(4) -- acpidump shows the
string in the same case as the design document, "VM_Gen_Counter." By the time
it reaches the layers we match on, though, it is uppercase. Now attach works.

UUID contents themselves are not obviously correct, needs more investivation. E.g.,

$ sudo dmidecode --string system-uuid
71797332-c5ef-7743-aa2a-f1c1569ad5d0
$ sysctl -x dev.vmgenc.0.guid
dev.vmgenc.0.guid: Format: Length:16 Dump:0x496f5808ccbd936269b46a9f0a429d70