Skip to content

Commit afe1de4

Browse files
committed
doc: update VMGenID docs to mention ARM support
Mention that Linux support VMGenID for systems with DeviceTree support since version 6.10. Also, mention that we only support up to Linux 6.1, so users that want to make use of VMGenID on Linux 6.1 they need to backport DeviceTree support from 6.10. Signed-off-by: Babis Chalios <[email protected]>
1 parent ffbefbc commit afe1de4

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

docs/snapshotting/random-for-clones.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ and there’s also an input pool which gathers entropy from various sources
4343
available on the system, and is used to feed into or seed the other two
4444
components. A very detailed description is available [here][3].
4545

46-
### Linux kernels from 4.8 until 5.17 (included)
47-
4846
The details of this newer implementation are used to make the recommendations
4947
present in the document. There are in-kernel interfaces used to obtain random
5048
numbers as well, but they are similar to using `/dev/urandom` (or `getrandom`
@@ -103,15 +101,17 @@ not increase the current entropy estimation. There is also an `ioctl` interface
103101
which, given the appropriate privileges, can be used to add data to the input
104102
entropy pool while also increasing the count, or completely empty all pools.
105103

106-
### Linux kernels from 5.18 onwards
107-
108-
Since version 5.18, Linux has support for the
109-
[Virtual Machine Generation Identifier](https://learn.microsoft.com/en-us/windows/win32/hyperv_v2/virtual-machine-generation-identifier).
110-
The purpose of VMGenID is to notify the guest about time shift events, such as
111-
resuming from a snapshot. The device exposes a 16-byte cryptographically random
112-
identifier in guest memory. Firecracker implements VMGenID. When resuming a
113-
microVM from a snapshot Firecracker writes a new identifier and injects a
114-
notification to the guest. Linux,
104+
### Linux kernels with VMGenID support
105+
106+
Linux has support for the
107+
[Virtual Machine Generation Identifier](https://learn.microsoft.com/en-us/windows/win32/hyperv_v2/virtual-machine-generation-identifier)
108+
since 5.18 for ACPI systems. Since 6.10, Linux added support also for systems
109+
that use DeviceTree instead of ACPI. The purpose of VMGenID is to notify the
110+
guest about time shift events, such as resuming from a snapshot. The device
111+
exposes a 16-byte cryptographically random identifier in guest memory.
112+
Firecracker implements VMGenID. When resuming a microVM from a snapshot
113+
Firecracker writes a new identifier and injects a notification to the guest.
114+
Linux,
115115
[uses this value](https://elixir.bootlin.com/linux/v5.18.19/source/drivers/virt/vmgenid.c#L77)
116116
[as new randomness for its CSPRNG](https://elixir.bootlin.com/linux/v5.18.19/source/drivers/char/random.c#L908).
117117
Quoting the random.c implementation of the kernel:
@@ -133,9 +133,15 @@ to emit a uevent to user space when it handles the notification. User space can
133133
poll this uevent to know when it is safe to use `getrandom()`, et al. avoiding
134134
the race condition.
135135

136-
Please note that, Firecracker will always enable VMGenID. In kernels earlier
137-
than 5.18, where there is no VMGenID driver, the device will not have any effect
138-
in the guest.
136+
Firecracker supports VMGenID on ARM systems using the DeviceTree binding that
137+
was added for the device in Linux 6.10. However, the latest Linux kernel that
138+
Firecracker supports is 6.1. As a result, in order to use VMGenID on ARM
139+
systems, users need to use a 6.1 kernel with the DeviceTree binding support
140+
backported from 6.10. We provide a set of patches that apply cleanly on mainline
141+
Linux 6.1 [here](../../resources/patches/vmgenid_dt).
142+
143+
Please note that, Firecracker will always enable VMGenID. In kernels where there
144+
is no VMGenID driver, the device will not have any effect in the guest.
139145

140146
### User space considerations
141147

docs/snapshotting/snapshot-support.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -584,28 +584,25 @@ we also consider microVM A insecure if it resumes execution.
584584
(VMGenID) is a virtual device that allows VM guests to detect when they have
585585
resumed from a snapshot. It works by exposing a cryptographically random
586586
16-bytes identifier to the guest. The VMM ensures that the value of the
587-
indentifier changes every time the VM a time shift happens in the lifecycle of
587+
identifier changes every time the VM a time shift happens in the lifecycle of
588588
the VM, e.g. when it resumes from a snapshot.
589589

590-
Linux supports VMGenID since version 5.18. When Linux detects a change in the
591-
identifier, it uses its value to reseed its internal PRNG. Moreover,
592-
[since version 6.8](https://lkml.org/lkml/2023/5/31/414) Linux VMGenID driver
593-
also emits to userspace a uevent. User space processes can monitor this uevent
594-
for detecting snapshot resume events.
590+
Linux supports VMGenID since version 5.18 for systems with ACPI support. Linux
591+
6.10 added support also for systems that use DeviceTree instead of ACPI. When
592+
Linux detects a change in the identifier, it uses its value to reseed its
593+
internal PRNG.
595594

596-
Firecracker supports VMGenID device on x86 platforms. Firecracker will always
597-
enable the device. During snapshot resume, Firecracker will update the 16-byte
598-
generation ID and inject a notification in the guest before resuming its vCPUs.
595+
Firecracker supports VMGenID device both on x86 and Aarch64 platforms.
596+
Firecracker will always enable the device. During snapshot resume, Firecracker
597+
will update the 16-byte generation ID and inject a notification in the guest
598+
before resuming its vCPUs.
599599

600600
As a result, guests that run Linux versions >= 5.18 will re-seed their in-kernel
601601
PRNG upon snapshot resume. User space applications can rely on the guest kernel
602602
for randomness. State other than the guest kernel entropy pool, such as unique
603603
identifiers, cached random numbers, cryptographic tokens, etc **will** still be
604604
replicated across multiple microVMs resumed from the same snapshot. Users need
605605
to implement mechanisms for ensuring de-duplication of such state, where needed.
606-
On guests that run Linux versions >= 6.8, users can make use of the uevent that
607-
VMGenID driver emits upon resuming from a snapshot, to be notified about
608-
snapshot resume events.
609606

610607
## Vsock device limitation
611608

0 commit comments

Comments
 (0)