linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/8] KVM: arm64: Reserve pKVM VM handle during initial VM setup
@ 2025-07-29 12:00 Fuad Tabba
  2025-07-29 12:00 ` [PATCH v1 1/8] KVM: arm64: Rename pkvm.enabled to pkvm.is_protected Fuad Tabba
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Fuad Tabba @ 2025-07-29 12:00 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel
  Cc: maz, oliver.upton, will, mark.rutland, joey.gouly, suzuki.poulose,
	yuzenghui, catalin.marinas, broonie, vdonnefort, qperret,
	sebastianene, keirf, smostafa, tabba

All VMs in pKVM identified by their handle, a unique per-VM ID. This
handle is shared between the host kernel and the hypvervisor, and used
to track the VM across both.

In pKVM, this handle is allocated when the VM is initialized at the
hypervisor, which is on the first vCPU run. However, the host starts
initializing the VM and setting up its data structures earlier. MMU
notifiers for the VMs are also registered before VM identification at
the hypervisor, which rely on the handle to identify the VM [1].

Additionally, in the future, the host needs to communicate with
TrustZone about the before the VM first run. Therefore, move handle
creation to when the VM is first initialized at the host.

This patch series is divided into two parts:

- Patches 1-4: Renaming, refactoring, and tidying up to lay the
  groundwork for moving handle initialization and to fix existing
  issues.
- Patches 5-8: Decouple handle creation from VM initialization at the
  hypervisor and move the handle creation to VM initialization at the
  host.

Based on Linux 6.16.

Cheers,
/fuad

[1] https://lore.kernel.org/all/20250303214947.GA30619@willie-the-truck/

Fuad Tabba (8):
  KVM: arm64: Rename pkvm.enabled to pkvm.is_protected
  KVM: arm64: Rename 'host_kvm' to 'kvm' in pKVM host code
  KVM: arm64: Clarify comments to distinguish pKVM mode from protected
    VMs
  KVM: arm64: Decouple hyp VM creation state from its handle
  KVM: arm64: Separate allocation and insertion of pKVM VM table entries
  KVM: arm64: Consolidate pKVM hypervisor VM initialization logic
  KVM: arm64: Introduce separate hypercalls for pKVM VM reservation and
    initialization
  KVM: arm64: Reserve pKVM handle during pkvm_init_host_vm()

 arch/arm64/include/asm/kvm_asm.h       |   2 +
 arch/arm64/include/asm/kvm_host.h      |   5 +-
 arch/arm64/include/asm/kvm_pkvm.h      |   1 +
 arch/arm64/kvm/arm.c                   |  12 +-
 arch/arm64/kvm/hyp/include/nvhe/pkvm.h |   4 +-
 arch/arm64/kvm/hyp/nvhe/hyp-main.c     |  14 ++
 arch/arm64/kvm/hyp/nvhe/pkvm.c         | 177 +++++++++++++++++++------
 arch/arm64/kvm/pkvm.c                  |  76 +++++++----
 8 files changed, 217 insertions(+), 74 deletions(-)


base-commit: 038d61fd642278bab63ee8ef722c50d10ab01e8f
-- 
2.50.1.487.gc89ff58d15-goog



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

end of thread, other threads:[~2025-08-08 12:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-29 12:00 [PATCH v1 0/8] KVM: arm64: Reserve pKVM VM handle during initial VM setup Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 1/8] KVM: arm64: Rename pkvm.enabled to pkvm.is_protected Fuad Tabba
2025-08-03  6:10   ` Wei-Lin Chang
2025-08-04  7:00     ` Fuad Tabba
2025-08-04 12:20       ` Wei-Lin Chang
2025-08-08 11:32   ` Kunwu Chan
2025-07-29 12:00 ` [PATCH v1 2/8] KVM: arm64: Rename 'host_kvm' to 'kvm' in pKVM host code Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 3/8] KVM: arm64: Clarify comments to distinguish pKVM mode from protected VMs Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 4/8] KVM: arm64: Decouple hyp VM creation state from its handle Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 5/8] KVM: arm64: Separate allocation and insertion of pKVM VM table entries Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 6/8] KVM: arm64: Consolidate pKVM hypervisor VM initialization logic Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 7/8] KVM: arm64: Introduce separate hypercalls for pKVM VM reservation and initialization Fuad Tabba
2025-07-29 12:00 ` [PATCH v1 8/8] KVM: arm64: Reserve pKVM handle during pkvm_init_host_vm() Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).