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

Sriram Nambakam <[email protected]> Wed, 5 Aug 2026 04:02:42 -0700
Newsgroups org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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

-- 
2.55.0