Linux-HyperV List
 help / color / mirror / Atom feed
* [RFC PATCH 00/12] Introduce LVBS support for Hyper-V guests
@ 2026-09-01 16:55 Thara Gopinath
  2026-09-01 16:55 ` [RFC PATCH 01/12] drivers: hv: Add HYPERV_VSM kconfig option Thara Gopinath
                   ` (11 more replies)
  0 siblings, 12 replies; 34+ messages in thread
From: Thara Gopinath @ 2026-09-01 16:55 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, tglx, mingo, bp, dave.hansen, hpa,
	ardb, ilias.apalodimas
  Cc: James.Bottomley, "longli, javierm, lszubowi, francescopompo2,
	tgopinath, x86, linux-hyperv, linux-kernel, linux-efi,
	Thara Gopinath

Introduction
=============
Microsoft Hyper-V implements Virtualization-Based Security (VBS) through
Virtual Secure Mode (VSM), which uses Virtual Trust Levels (VTLs) to
establish isolated execution environments enforced by the hypervisor. The
primary operating system executes in VTL0, while security-sensitive
components can execute in higher trust levels such as VTL1.

Linux Virtualization-Based Security (LVBS) extends this model to Linux
Hyper-V guests by introducing a secure kernel running in VTL1 alongside the
primary Linux kernel running in VTL0. The hypervisor enforces isolation
between the two trust levels, allowing security-sensitive functionality to
execute independently of the primary operating system.

This RFC series introduces the foundational infrastructure required to
support LVBS and boot a secure kernel in VTL1 from VTL0. Before any LVBS
service can exist, VTL0 has to stand VTL1 up, load the secure kernel and
boot all CPUs in VTL1.

This series intentionally focuses on establishing the VTL1 execution
environment and does not yet introduce higher-level LVBS services. Future
RFCs will build on this foundation by adding support for VTL0 to request
secure services from VTL1, attestation support, memory protection services,
and other security capabilities.

The goal of this RFC is to gather feedback on the overall LVBS
architecture, VTL1 boot model, processor bring-up sequence, and Linux
kernel integration before additional functionality is introduced.

Threat Model
=============
The security of the whole construction rests on the early boot path
being trusted. On a VSM-capable Hyper-V guest, the VTL0 kernel is
launched via Secure Boot, so the kernel image that enables VTL1
and loads the secure kernel is itself measured and signature-checked
before it runs. Enabling VTL1 and populating it from VTL0 during
early boot is therefore no weaker than Secure Boot itself: an attacker
who can subvert this stage can already subvert the kernel before VTL1
exists.

For the same reason, a Unified Kernel Image (UKI) is the preferred
delivery vehicle for LVBS. A UKI bundles the kernel, initrd,
cmdline, and (optionally) devicetree into a single PE binary that is
signed and verified as one unit by Secure Boot. This extends the
signature-verified boundary to cover the initrd, which is where the
secure kernel image is staged before VTL0 hands it to VTL1. Without
a UKI (or an equivalent measured-initrd scheme), an unsigned initrd
would be an obvious weak spot in the chain.

The series is based on hyperv-next (tag hyperv-next-signed-20260826) and
boot-tested on an x86_64 Hyper-V VTL0 guest with litebox [1] as the VTL1
secure kernel.

[1] https://github.com/microsoft/litebox

Comments and feedback are greatly appreciated.

Thara Gopinath (12):
  drivers: hv: Add HYPERV_VSM kconfig option
  drivers: hv: hv_common: Allocate Hyper-V output arg page when VSM is
    enabled
  drivers: hv: Reserve memory for VSM secure kernel during early boot
  firmware: efi: libstub: x86-stub: Enable VSM awareness in efi os
    indications variable
  include: hyperv: hvgdk_mini.h: Add VTL-specific structures and bits
  drivers: hv: Add VSM boot driver and enable VTL1 at the partition
    level
  drivers: hv: hv_vsm_boot: load secure kernel image from firmware
  arch: x86: hyperv: Build initial vCPU context for VTL1 secure kernel
  drivers: hv: hv_vsm_boot: Enable VTL1 on the boot processor
  arch: x86: hyperv: hv_vtl_vsm: Introduce vtlcall
  drivers: hv: hv_vsm_boot: Boot primary processor in VTL1
  drivers: hv: hv_vsm_boot: Boot secondary processors in VTL1

 arch/x86/hyperv/Makefile                |   1 +
 arch/x86/hyperv/hv_vtl_vsm.c            | 287 +++++++++++
 arch/x86/hyperv/mshv-asm-offsets.c      |   8 +
 arch/x86/hyperv/mshv_vtl_asm.S          |  75 +++
 arch/x86/include/asm/mshyperv.h         |   9 +
 drivers/firmware/efi/libstub/x86-stub.c |  57 +++
 drivers/hv/Kconfig                      |   9 +
 drivers/hv/Makefile                     |   3 +-
 drivers/hv/hv_common.c                  |   3 +-
 drivers/hv/hv_vsm.h                     |  19 +
 drivers/hv/hv_vsm_boot.c                | 630 ++++++++++++++++++++++++
 drivers/hv/hv_vsm_securekernel.c        | 188 +++++++
 include/hyperv/hvgdk_mini.h             |  46 ++
 include/hyperv/vsm.h                    |  43 ++
 14 files changed, 1376 insertions(+), 2 deletions(-)
 create mode 100644 arch/x86/hyperv/hv_vtl_vsm.c
 create mode 100644 drivers/hv/hv_vsm.h
 create mode 100644 drivers/hv/hv_vsm_boot.c
 create mode 100644 drivers/hv/hv_vsm_securekernel.c
 create mode 100644 include/hyperv/vsm.h


base-commit: be0cfab740e58b70047ef6e7e3d578f00ed5d258
-- 
2.34.1


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2026-09-04 13:23 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 16:55 [RFC PATCH 00/12] Introduce LVBS support for Hyper-V guests Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 01/12] drivers: hv: Add HYPERV_VSM kconfig option Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 02/12] drivers: hv: hv_common: Allocate Hyper-V output arg page when VSM is enabled Thara Gopinath
2026-09-01 17:12   ` sashiko-bot
2026-09-01 22:56     ` Wei Liu
2026-09-01 16:55 ` [RFC PATCH 03/12] drivers: hv: Reserve memory for VSM secure kernel during early boot Thara Gopinath
2026-09-01 17:10   ` sashiko-bot
2026-09-02  0:59   ` Wei Liu
2026-09-02 13:38     ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 04/12] firmware: efi: libstub: x86-stub: Enable VSM awareness in efi os indications variable Thara Gopinath
2026-09-01 17:09   ` sashiko-bot
2026-09-02  1:09   ` Wei Liu
2026-09-02 14:23     ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 05/12] include: hyperv: hvgdk_mini.h: Add VTL-specific structures and bits Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 06/12] drivers: hv: Add VSM boot driver and enable VTL1 at the partition level Thara Gopinath
2026-09-01 17:24   ` sashiko-bot
2026-09-02  1:16   ` Wei Liu
2026-09-02 14:28     ` Thara Gopinath
2026-09-02  4:43   ` Wei Liu
2026-09-04 13:23     ` Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 07/12] drivers: hv: hv_vsm_boot: load secure kernel image from firmware Thara Gopinath
2026-09-01 17:20   ` sashiko-bot
2026-09-02  4:37   ` Wei Liu
2026-09-02 16:22     ` Thara Gopinath
2026-09-02 22:58       ` Wei Liu
2026-09-01 16:55 ` [RFC PATCH 08/12] arch: x86: hyperv: Build initial vCPU context for VTL1 secure kernel Thara Gopinath
2026-09-01 17:25   ` sashiko-bot
2026-09-01 16:55 ` [RFC PATCH 09/12] drivers: hv: hv_vsm_boot: Enable VTL1 on the boot processor Thara Gopinath
2026-09-01 17:36   ` sashiko-bot
2026-09-01 16:55 ` [RFC PATCH 10/12] arch: x86: hyperv: hv_vtl_vsm: Introduce vtlcall Thara Gopinath
2026-09-01 16:55 ` [RFC PATCH 11/12] drivers: hv: hv_vsm_boot: Boot primary processor in VTL1 Thara Gopinath
2026-09-01 17:35   ` sashiko-bot
2026-09-01 16:55 ` [RFC PATCH 12/12] drivers: hv: hv_vsm_boot: Boot secondary processors " Thara Gopinath
2026-09-01 17:44   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox