Skip to content

RFC VBS/VSM-on-KVM: VBS integration for KVM VM planes

Sriram Nambakam kvm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest42 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/42Fix merge issue - Remove duplicate definition for kvm_arch_has_irq_bypassarch/x86/include/asm/kvm_host.h+0 -50 replies
2/42Fix compilationarch/x86/kvm/irq_comm.c+2 -20 replies
3/42Fix compile errorarch/x86/kvm/vmx/vmx.c+1 -10 replies
4/42Fix compile errorsarch/x86/kvm/svm/avic.c arch/x86/kvm/svm/sev.c+2 -20 replies
5/42Initial support for VM Planes - Add kernel config for CONFIG_VM_PLANES - Parse vm plane config from initrd for plane configuration - Make hypercalls to allocate memory for the vm planes.arch/x86/include/asm/cpu.h arch/x86/kernel/cpu/common.c include/linux/vm_planes.h +4 more+506 -00 replies
6/42Use vcpu count from the plane configurationinclude/linux/vm_planes.h init/vm_planes.c+25 -130 replies
7/42skip processing plane configuration for plane 0 - plane 0 is the boot planeinit/vm_planes.c+4 -10 replies
8/42Add plane config param to specify kernel image formatinclude/linux/vm_planes.h init/vm_planes.c+29 -00 replies
9/42Activate the VM Planes through the Hypervisor - Using KVM as the VMMarch/x86/include/asm/cpu.h arch/x86/kernel/cpu/common.c include/linux/vm_planes.h +1 more+212 -130 replies
10/42allow the command line to be specified for kernels in other planesinclude/linux/vm_planes.h init/vm_planes.c+24 -10 replies
11/42Various changes to support VM Planes.arch/x86/include/asm/cpu.h arch/x86/kernel/cpu/common.c arch/x86/kvm/x86.c +4 more+266 -2130 replies
12/42Add a Virtualization Based Security (VBS) framework. - Add backends for AMD SEV-SNP, Intel TDX, Arm CCA and KVM Planes. - Support VTL on Hyper-V in addition to Planes on KVM.include/linux/vbs.h security/Kconfig security/Makefile +10 more+1916 -00 replies
13/42Add a inter-plane communication mechanism through KVM. - model this to use a single page similar to SEV-SNPsecurity/vbs/kvm_planes.c+51 -510 replies
14/42KVM: Add per-plane memory attribute support for cross-plane EPT protectionarch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.h arch/x86/kvm/mmu/tdp_mmu.c +1 more+62 -20 replies
15/42KVM: x86: Add KVM_HC_VBS_VTL_CALL hypercall for VBS inter-plane callsarch/x86/kvm/x86.c include/uapi/linux/kvm_para.h security/vbs/kvm_planes.c+6 -90 replies
16/42vbs: Add HEKI kernel sealing and fix KVM plane memory attribute guardssecurity/vbs/Kconfig security/vbs/Makefile security/vbs/core.c +3 more+435 -10 replies
17/42vbs: Add module authentication via VBS/HEKIkernel/module/main.c security/vbs/heki.h security/vbs/kvm_planes.c+178 -70 replies
18/42vbs: Add kexec validation and make module auth non-fatalkernel/kexec_core.c kernel/kexec_file.c kernel/module/main.c +2 more+67 -50 replies
19/42Merge branch 'master' into vm-planesarch/x86/kvm/svm/svm.c arch/x86/kvm/x86.c kernel/kexec_file.c+3 -30 replies
20/42kvm: x86: fix merged plane API/stat build regressionsarch/x86/kvm/debugfs.c arch/x86/kvm/hyperv.c arch/x86/kvm/kvm_cache_regs.h +9 more+291 -540 replies
21/42KVM: x86: exit VM planes and VBS hypercalls to userspacearch/x86/kvm/x86.c+6 -50 replies
22/42kexec: block legacy kexec_load when VBS is activekernel/kexec.c+10 -00 replies
23/42kvm: x86: fix merged plane API/stat build regressionsinclude/uapi/linux/kvm.h+0 -230 replies
24/42KVM: planes: expose memory-attribute setting to in-kernel callersinclude/linux/kvm_host.h virt/kvm/kvm_main.c+19 -40 replies
25/42vm_planes: drop unused per-plane vcpu_countinclude/linux/vm_planes.h init/vm_planes.c+0 -120 replies
26/42drivers/virt: add VBS secure-plane park loopdrivers/virt/Kconfig drivers/virt/Makefile drivers/virt/vbs_park.c+152 -00 replies
27/42KVM: planes: add arch-neutral in-kernel plane switch helperarch/x86/kvm/svm/sev.c include/linux/kvm_host.h virt/kvm/kvm_main.c+34 -70 replies
28/42KVM: x86: add VBS VTL call/return and cross-plane set-mem-attrs hypercallsarch/x86/kvm/x86.c include/linux/kvm_host.h include/uapi/linux/kvm_para.h+156 -20 replies
29/42init/vm_planes: set up planes from rootfs_initcall and load ELF payloadsinclude/linux/vm_planes.h init/Kconfig init/Makefile +2 more+54 -490 replies
30/42security/vbs: run backend probe and HEKI seal at rootfs_initcallsecurity/vbs/Makefile security/vbs/core.c security/vbs/probe.c+17 -60 replies
31/42security/vbs: pin the VTL call hypercall to CPU0security/vbs/kvm_planes.c+48 -190 replies
32/42security/vbs: add secure-plane monitor backendsecurity/vbs/Makefile security/vbs/secure_monitor.c+267 -00 replies
33/42drivers/virt: rename VBS park loop to secure_monitordrivers/virt/Kconfig drivers/virt/Makefile drivers/virt/secure_monitor.c +2 more+52 -3100 replies
34/42x86/realmode: skip the sub-1M trampoline for the VBS secure planearch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu/mmu.c arch/x86/kvm/mmu/spte.h +5 more+202 -160 replies
35/42KVM: x86: deny normal-plane access to secure-plane memorydrivers/virt/secure_monitor.c+76 -30 replies
36/42KVM: plane: handle KVM_CHECK_EXTENSION on the plane fdvirt/kvm/kvm_main.c+9 -00 replies
37/42KVM: selftests: run plane tests with a split IRQ chiptools/testing/selftests/kvm/Makefile.kvm tools/testing/selftests/kvm/include/kvm_util.h tools/testing/selftests/kvm/lib/kvm_util.c +2 more+45 -1060 replies
38/42kvm: x86: drop obsolete kvm_cache_regs.harch/x86/kvm/kvm_cache_regs.h+0 -2490 replies
39/42kvm: arch: finalize plane hooks and kvm_arch_vcpu_create signaturearch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c arch/mips/include/asm/kvm_host.h +3 more+27 -20 replies
40/42kvm: x86: use kvm_vcpu scheduling-state accessors and struct stat fieldsarch/x86/kvm/svm/svm.c arch/x86/kvm/vmx/nested.c+3 -30 replies
41/42kvm: x86: finalize per-plane APIC state and CPUID placementarch/x86/include/asm/kvm_host.h arch/x86/kvm/cpuid.c arch/x86/kvm/hyperv.c +3 more+20 -940 replies
42/42kvm: planes: reconcile core plane state, UAPI and hypercall exitDocumentation/virt/kvm/api.rst arch/x86/kvm/svm/sev.c arch/x86/kvm/x86.c +3 more+86 -1570 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH v1 00/42] VBS/VSM-on-KVM: VBS integration for KVM VM planes

This RFC demonstrates how KVM VM Planes can be used to implement Virtualization-Based Security (VBS) using Virtual Trust Levels (VTLs). It provides a concrete implementation for discussion and is intended to solicit feedback on the architecture, kernel interfaces, and division of responsibility between KVM, the normal guest kernel, and a secure kernel.

The complete implementation is available in three repositories under the safe-tee organization:

Linux and KVM support:
https://github.com/safe-tee/linux/tree/kvm-planes-v7.2-rc5

QEMU support:
https://github.com/safe-tee/qemu/tree/qemu-planes-v11.1.0-rc1

Build, test, and integration tooling:
https://github.com/safe-tee/lvbs

Current build and run instructions are maintained in the lvbs repository:

Build the Plane 0 kernel, Plane 1 secure kernel, VM image, and run QEMU:
https://github.com/safe-tee/lvbs/blob/main/docs/how-to/how-to-build.md

The VBS core is implemented under security/vbs and exposes a transport-independent interface through include/linux/vbs.h. The normal guest kernel runs in Plane 0 (VTL0) and requests security services from a higher-trust kernel running in Plane 1 (VTL1). For KVM VM Planes, these requests are transported through a shared calling page and a KVM hypercall-mediated plane switch.

The RFC demonstrates loading and starting the secure kernel, communication between VTL0 and VTL1, and hypervisor-enforced kernel integrity (HEKI). The secure plane can protect VTL0 memory independently of VTL0, seal kernel text and read-only data, participate in module validation and permission changes, and validate kexec images.

This mail series contains only the 42 VBS and integration patches authored by me. It does not duplicate the prerequisite VM Planes patches from Joerg Roedel and Paolo Bonzini. The Linux branch linked above contains the full integrated tree, including their patches and related KVM work from Melody Wang and Tom Lendacky, used for development and testing.

This is prototype code and is not yet intended for production use. In particular, the KVM backend currently routes VTL calls through CPU 0 and the VM Planes configuration requires a split in-kernel IRQ chip. Feedback on the overall model, the VBS interface, and how this work should be split for upstream review would be appreciated.

Acknowledgments
===============

This work stands on top of, and is indebted to, several prior efforts:

- Joerg Roedel, whose KVM VM Planes tree provides the in-kernel plane infrastructure that the VBS/VSM secure plane relies on.

- Paolo Bonzini, whose "[RFC PATCH 00/29] KVM: VM planes" introduced the VM plane concept to KVM as a common in-kernel model for AMD VMPLs, Intel TDX partitions, Hyper-V VTLs, and Arm CCA planes. Joerg Roedel's work carries that model forward.
https://lwn.net/Articles/1016113/

- The prior Linux VBS (LVBS) and Hypervisor-Enforced Kernel Integrity (HEKI) work by James Morris, Thara Gopinath, Wei Liu, Madhavan Venkataraman, and Mickaël Salaün, posted as "[RFC PATCH v2 00/19] Hypervisor-Enforced Kernel Integrity (HEKI)". The kernel-sealing model used here follows their design.

- James Bottomley and James Morris, for their ongoing work on VSM-on-KVM, which informed the design and direction of this series.

Sriram Nambakam (42):
Fix merge issue - Remove duplicate definition for
kvm_arch_has_irq_bypass
Fix compilation
Fix compile error
Fix compile errors
Initial support for VM Planes - Add kernel config for CONFIG_VM_PLANES
- Parse vm plane config from initrd for plane configuration - Make hypercalls to allocate memory for the vm planes.
Use vcpu count from the plane configuration
skip processing plane configuration for plane 0 - plane 0 is the boot
plane
Add plane config param to specify kernel image format Activate the VM Planes through the Hypervisor - Using KVM as the VMM allow the command line to be specified for kernels in other planes Various changes to support VM Planes.
Add a Virtualization Based Security (VBS) framework. - Add backends
for AMD SEV-SNP, Intel TDX, Arm CCA and KVM Planes. - Support VTL on Hyper-V in addition to Planes on KVM.
Add a inter-plane communication mechanism through KVM. - model this to
use a single page similar to SEV-SNP
KVM: Add per-plane memory attribute support for cross-plane EPT
protection
KVM: x86: Add KVM_HC_VBS_VTL_CALL hypercall for VBS inter-plane calls
vbs: Add HEKI kernel sealing and fix KVM plane memory attribute guards
vbs: Add module authentication via VBS/HEKI
vbs: Add kexec validation and make module auth non-fatal Merge branch 'master' into vm-planes
kvm: x86: fix merged plane API/stat build regressions
KVM: x86: exit VM planes and VBS hypercalls to userspace
kexec: block legacy kexec_load when VBS is active
kvm: x86: fix merged plane API/stat build regressions
KVM: planes: expose memory-attribute setting to in-kernel callers
vm_planes: drop unused per-plane vcpu_count
drivers/virt: add VBS secure-plane park loop
KVM: planes: add arch-neutral in-kernel plane switch helper
KVM: x86: add VBS VTL call/return and cross-plane set-mem-attrs
hypercalls
init/vm_planes: set up planes from rootfs_initcall and load ELF
payloads
security/vbs: run backend probe and HEKI seal at rootfs_initcall security/vbs: pin the VTL call hypercall to CPU0 security/vbs: add secure-plane monitor backend drivers/virt: rename VBS park loop to secure_monitor x86/realmode: skip the sub-1M trampoline for the VBS secure plane
KVM: x86: deny normal-plane access to secure-plane memory
KVM: plane: handle KVM_CHECK_EXTENSION on the plane fd
KVM: selftests: run plane tests with a split IRQ chip
kvm: x86: drop obsolete kvm_cache_regs.h
kvm: arch: finalize plane hooks and kvm_arch_vcpu_create signature
kvm: x86: use kvm_vcpu scheduling-state accessors and struct stat
fields
kvm: x86: finalize per-plane APIC state and CPUID placement
kvm: planes: reconcile core plane state, UAPI and hypercall exit

Signature · 1 line
2.55.0