All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v3 00/13] KVM: guest_memfd: Add a common framework for device memory providers
@ 2026-11-01  7:19 Aneesh Kumar K.V (Arm)
  2026-11-01  7:19 ` [RFC PATCH v3 01/13] KVM: guest_memfd: Let providers prepare memory regions Aneesh Kumar K.V (Arm)
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Aneesh Kumar K.V (Arm) @ 2026-11-01  7:19 UTC (permalink / raw)
  To: linux-coco
  Cc: Aneesh Kumar K.V (Arm), Ackerley Tng, Alex Williamson,
	David Woodhouse, David Hildenbrand, Jason Gunthorpe,
	Joerg Roedel (AMD), Kevin Tian, Paolo Bonzini, Robin Murphy,
	Sean Christopherson, Will Deacon, Alexey Kardashevskiy, Xu Yilun,
	Catalin Marinas, Suzuki K Poulose, Steven Price, Fred Griffoul,
	iommu, kvm, patches

Confidential device assignment needs guest_memfd to manage device MMIO as
well as RAM. Device resources such as PCI BARs supply PFNs directly, and
their protected mappings need architecture-specific map and unmap
operations.

This series adds the common guest_memfd support needed by device memory
providers. It builds on the resource-provider API [1] and the existing
folio and RAM PFN backing support.

The VFIO provider, IOMMUFD integration and Arm CCA implementation are
available together at:

  https://git.gitlab.arm.com/linux-arm/linux-cca.git cca/topics/cca-da-gmem-backend

This series depends on the resource-provider groundwork from:
[1] https://lore.kernel.org/all/20261022-gmem-alternative-providers-v2-0-5dd1dc6c660a@google.com

Notes:
* Codex assisted with implementation, review and series organization.

Changes from v2:
https://lore.kernel.org/all/20261017073149.1303738-1-aneesh.kumar@kernel.org
* Rebase on the v2 alternative-provider series and separate the common
  guest_memfd framework from the VFIO, IOMMUFD and Arm CCA integration.
* Introduce backing operations to separate folio, RAM PFN and device MMIO
  handling while sharing locking, invalidation and attribute updates.
* Replace prepare_conversion()/finish_conversion() with non-failing
  lock()/unlock() callbacks.
* Convert device memory through ordinary file-offset attribute updates.
  Derive GPA from memslot bindings and PA from provider PFNs, removing the
  device request object.
* Allow shared and private device PFN lookup in the common layer. Include
  both mapping types in generic invalidation and leave architecture
  mapping policy to the backend.
* Support device range revocation through the common revoke path without
  reclaiming MMIO PFNs or changing attributes.
* Add shared device mmap through the existing get_pfn() fault path. Keep
  VMA protections and flags in the core
* Require only get_pfn() for device providers; lookup_pfn_range() remains
  required for RAM PFN providers.

Changes from v1:
https://lore.kernel.org/all/20261010072504.536230-1-aneesh.kumar@kernel.org
* Require GUEST_MEMFD_FLAG_MMAP to allow VFIO BAR mmap while a provider is
  attached; disable it by default.
* Use the common guest_memfd_provider_operations for folio and PFN
  providers. Select operations through the resource mapping superblock
  and forward VFIO operations to the device driver.

Cc: Ackerley Tng <ackerleytng@google.com>
Cc: Alex Williamson <alex@shazbot.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: "Joerg Roedel (AMD)" <joro@8bytes.org>
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Will Deacon <will@kernel.org>
Cc: Alexey Kardashevskiy <aik@amd.com>
Cc: Xu Yilun <yilun.xu@linux.intel.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Steven Price <steven.price@arm.com>
Cc: Fred Griffoul <griffoul@gmail.com>
Cc: iommu@lists.linux.dev
Cc: kvm@vger.kernel.org
Cc: patches@lists.linux.dev


Aneesh Kumar K.V (Arm) (13):
  KVM: guest_memfd: Let providers prepare memory regions
  KVM: guest_memfd: Dispatch attribute conversion through backing
    operations
  KVM: guest_memfd: Let providers coordinate mapping changes
  KVM: guest_memfd: Dispatch revocation through backing operations
  KVM: guest_memfd: Split population by backing type
  KVM: guest_memfd: Support device-backed PFN providers
  KVM: guest_memfd: Support private/shared conversion of device memory
  KVM: guest_memfd: Track private device ranges after attribute updates
  KVM: guest_memfd: Expose device provider private state
  KVM: guest_memfd: Support range revocation of device mappings
  KVM: guest_memfd: Add shared device mmap through PFN providers
  KVM: guest_memfd: Remove device mappings on final close
  KVM: guest_memfd: Invalidate guest_memfd mappings before removing
    memslot bindings

 Documentation/virt/kvm/api.rst |  21 +-
 include/linux/guest_memfd.h    |  84 +++-
 include/linux/kvm_host.h       |   7 +
 virt/kvm/guest_memfd.c         | 690 ++++++++++++++++++++++++++-------
 4 files changed, 660 insertions(+), 142 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-01  7:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01  7:19 [RFC PATCH v3 00/13] KVM: guest_memfd: Add a common framework for device memory providers Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 01/13] KVM: guest_memfd: Let providers prepare memory regions Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 02/13] KVM: guest_memfd: Dispatch attribute conversion through backing operations Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 03/13] KVM: guest_memfd: Let providers coordinate mapping changes Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 04/13] KVM: guest_memfd: Dispatch revocation through backing operations Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 05/13] KVM: guest_memfd: Split population by backing type Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 06/13] KVM: guest_memfd: Support device-backed PFN providers Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 07/13] KVM: guest_memfd: Support private/shared conversion of device memory Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 08/13] KVM: guest_memfd: Track private device ranges after attribute updates Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 09/13] KVM: guest_memfd: Expose device provider private state Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 10/13] KVM: guest_memfd: Support range revocation of device mappings Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 11/13] KVM: guest_memfd: Add shared device mmap through PFN providers Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 12/13] KVM: guest_memfd: Remove device mappings on final close Aneesh Kumar K.V (Arm)
2026-11-01  7:19 ` [RFC PATCH v3 13/13] KVM: guest_memfd: Invalidate guest_memfd mappings before removing memslot bindings Aneesh Kumar K.V (Arm)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.