microvm: storageVM encryption support for all VMs#1408
Merged
brianmcgillion merged 10 commits intotiiuae:mainfrom Oct 17, 2025
Merged
microvm: storageVM encryption support for all VMs#1408brianmcgillion merged 10 commits intotiiuae:mainfrom
brianmcgillion merged 10 commits intotiiuae:mainfrom
Conversation
hros-tii
commented
Sep 15, 2025
mbssrc
reviewed
Oct 1, 2025
mbssrc
reviewed
Oct 1, 2025
mbssrc
reviewed
Oct 1, 2025
mbssrc
reviewed
Oct 1, 2025
mbssrc
reviewed
Oct 1, 2025
mbssrc
reviewed
Oct 1, 2025
Collaborator
|
Great work! For testing, we should include performance and boot-time tests |
The abrmd duplicates functionality of the in-kernel RM which is in the kernel since version 4.12. It is not useful to have both enabled. Quoting the README of tpm2-abrmd: > The reason we have both is that the in-kernel RM was only added very > recently (4.12) and we have TPM2 users in environments with kernels > going back to the 3.x series. So the user space RM will be around at > least till everyone is using the kernel RM. > ... > Eventually, all of the required features will end up in the kernel > RM and it will become the default. In addition, the abrmd cannot be used by qemu, unlike the kernel RM. Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
This commit adds two methods to provide a TPM to a microvm: 1. passthrough of the host TPM or, 2. emulated TPM hosted in admin VM The default configuration enables the passthrough for the system VMs and the emulation for app VMs. The storage VM has a new option: storagevm.encryption.enable. When this is set, the persistent storage is backed by a disk image instead of a virtiofs mapped directory. The disk image is encrypted inside the VM using the TPM device available to the VM (through one of the 2 methods) and decrypted when the VM boots. The host option `virtualization.storagevm-encryption.enable` enables the encrypted storage for all the VMs. Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
Signed-off-by: Hugo Ros <Hugo.Ros@tii.ae>
mbssrc
approved these changes
Oct 16, 2025
|
Tested on
|
brianmcgillion
approved these changes
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
This commit adds two methods to provide a TPM to a microvm:
MicroVMs have a new option:
storagevm.encryption.enable. When this is set, the persistent storage is backed by a disk image instead of a virtiofs mapped directory. The disk image is encrypted inside the VM using the TPM device available to the VM (through one of the 2 methods) and decrypted when the VM boots.The host option
virtualization.storagevm-encryption.enableenables the encrypted storage for all the VMs.Type of Change
Checklist
make-checksand it passesx86_64Gen11Testing Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
/!\ Before flashing, reset the TPM in the BIOS /!\
nixos-rebuild ... switchTest Steps To Verify:
lenovo-x1-extras-debugtarget.admin-vm)lsblkto verify that the guestStorage partition is encrypted:chrome-vm)