iommufd: TSM-backed virtual IOMMUs for confidential guests
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v10 Latest18 patches 2 repliesIn review
- v913 patches 23 repliesSuperseded
- v815 patches 31 repliesSuperseded
Changes in v10 from the cover letter
https://lore.kernel.org/all/[email protected]
* Split the PCI/TSM get/put helpers from removal of the legacy bind/unbind interface.
* Split the TSM lookup/reference helpers from their IOMMUFD callers
* Replace allocated PCI/TSM contexts with get/put helpers that update the DSM user count on PF0. Remove unused context accessors and pci_tsm_is_configured().
* Add a tagged union for the physical IOMMU and TSM pointers in a vIOMMU.
Patches in v10 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | MAINTAINERS: Update TSM file coverage and repositoryMAINTAINERS | +2 | 0 replies | |
| 2/18 | virt: coco: tsm: Require PCI operations when registering a TSMdrivers/ | +4 | 0 replies | |
| 3/18 | virt: coco: tsm: Remove the device from lookup before PCI teardowndrivers/ | +13 | 0 replies | |
| 4/18 | virt: coco: tsm: Complete PCI registration before publishing the devicedrivers/ | +12 | 0 replies | |
| 5/18 | virt: coco: tsm: Register the TSM class before device driversdrivers/ | +1 | 0 replies | |
| 6/18 | iommufd/device: Associate KVM file pointer with iommufd_devicedrivers/ drivers/ drivers/ +2 more | +14 | 0 replies | |
| 7/18 | iommufd/viommu: Keep a reference to the KVM filedrivers/ include/ | +11 | 0 replies | |
| 8/18 | iommufd: Add a vDEVICE operation ioctl frameworkdrivers/ drivers/ drivers/ +3 more | +78 | 0 replies | |
| 9/18 | PCI/TSM: Remove the legacy guest request interfacedrivers/ include/ | +1 | 0 replies | |
| 10/18 | PCI/TSM: Add helpers to prevent disconnect while in useDocumentation/ drivers/ include/ | +85 | 0 replies | |
| 11/18 | PCI/TSM: Remove the legacy bind and unbind interfaceDocumentation/ drivers/ include/ | +2 | 0 replies | |
| 12/18 | iommufd/viommu: Select vIOMMU operations before allocationdrivers/ drivers/ drivers/ +9 more | +133 | 0 replies | |
| 13/18 | PCI/TSM: Add helpers to look up and reference a device's TSMdrivers/ drivers/ drivers/ +2 more | +81 | 0 replies | |
| 14/18 | iommufd/viommu: Identify physical IOMMU backing with a tagdrivers/ drivers/ include/ | +18 | 0 replies | |
| 15/18 | iommufd/viommu: Allow PCI TSM backends to provide vIOMMU operationsdrivers/ drivers/ include/ +2 more | +84 | 1 reply | |
| 16/18 | iommufd/viommu: Allow vIOMMUs without a parent HWPTDocumentation/ drivers/ drivers/ +2 more | +76 | 0 replies | |
| 17/18 | PCI/TSM: Wait for DSM users before removing PF0drivers/ include/ | +71 | 0 replies | |
| 18/18 | PCI/TSM: Wait for vIOMMUs to release the TSM before unregisteringdrivers/ drivers/ drivers/ +2 more | +281 | 1 reply |
Reviews trailers per patch
7 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Lu Baolu | Kevin Tian | Jason Gunthorpe | Jacob Pan |
|---|---|---|---|---|
| 1/18 | ||||
| 2/18 | R-b | |||
| 3/18 | R-b | |||
| 4/18 | ||||
| 5/18 | ||||
| 6/18 | R-b | R-b | ||
| 7/18 | R-b | R-b | R-b | R-b |
| 8/18 | R-b | |||
| 9/18 | R-b | R-b | ||
| 10/18 | ||||
| 11/18 | ||||
| 12/18 | R-b | |||
| 13/18 | ||||
| 14/18 | ||||
| 15/18 | ||||
| 16/18 | ||||
| 17/18 | ||||
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v10 00/18] iommufd: TSM-backed virtual IOMMUs for confidential guests
This series adds IOMMUFD and PCI/TSM infrastructure for assigning PCI devices to confidential guests. A TEE Security Manager (TSM) can provide a virtual IOMMU (vIOMMU), and an IOMMUFD vDEVICE object represents a physical device within that virtual IOMMU.
The series adds a common framework for operations on vDEVICE objects and updates lifetime management to keep the VM and device-security resources available while those objects are in use.
The Arm CCA backend is provided in a separate series, together with operations for TEE Device Interface Security Protocol (TDISP) state changes and access to cached device-attestation objects.
The full series, including the Arm CCA backend, is available at:
https://git.gitlab.arm.com/linux-arm/linux-cca.git
branch: cca/topics/7.4/cca-da-integration-v2
Notes:
* Codex was used to assist with commit message formatting and code rearrangement.
Changes from v9:
https://lore.kernel.org/all/[email protected]
* Split the PCI/TSM get/put helpers from removal of the legacy bind/unbind interface.
* Split the TSM lookup/reference helpers from their IOMMUFD callers
* Replace allocated PCI/TSM contexts with get/put helpers that update the DSM user count on PF0. Remove unused context accessors and pci_tsm_is_configured().
* Add a tagged union for the physical IOMMU and TSM pointers in a vIOMMU.
Changes from v8:
https://lore.kernel.org/all/[email protected]
* Drop the patch taking an additional KVM file reference for the iommufd_device lifetime.
* Rename the IOMMU_VDEVICE_OP reserved field to __reserved and return -EOPNOTSUPP when it is nonzero. Keep the ioctl table entries ordered.
* Collect Reviewed-by tags.
* Address review feedback.
Changes from v7:
https://lore.kernel.org/all/[email protected]
* Replace IOMMU_VDEVICE_TSM_REQ with the common IOMMU_VDEVICE_OP ioctl framework. Keep operation definitions and callbacks in the Arm CCA backend series.
* Replace architecture-specific request dispatch, TSM result codes and buffer-residue returns with operation-specific request/response formats, a zero-success return convention and resp_len for response lengths.
* Hold a KVM file reference for the full iommufd_device lifetime and require matching device/vIOMMU KVM associations for vDEVICE allocation.
* Hold TSM device and user references as well as the backend module reference for the vIOMMU lifetime. Make unregister reject new users and wait for existing users before tearing down PCI connections.
* Coordinate DSM removal with TSM unregister so the completion used to wait for users remains valid throughout teardown.
* Complete PCI registration before publishing the TSM device and roll back PCI registration if publication fails. Require PCI operations when registering a TSM.
* Temporarily disable AMD vIOMMU allocation while its interfaces are updated.
Changes from v6:
https://lore.kernel.org/all/[email protected]
* Replace the IOMMUFD provider registry with per-device TSM operation lookup.
* Move vIOMMU allocation size and initialization into the selected vIOMMU ops.
* Select parent HWPT policy from the vIOMMU ops flags.
* Pin a vIOMMU's TSM backend module through vIOMMU destruction.
Changes from v5:
https://lore.kernel.org/all/[email protected]
* Replace the TSM bind/unbind interface with reference-counted contexts.
* Add the IOMMUFD vIOMMU provider abstraction.
* Route TSM guest requests through vIOMMU ops.
Changes from v4:
https://lore.kernel.org/all/[email protected]
* Switch VFIO/iommufd to use struct file *kvm_file instead of relying on kvm->users_count references.
* Define TSM request scope values globally in iommufd.
* Rename the ioctl to IOMMU_VDEVICE_TSM_REQ.
* Address other review feedback.
Changes from v2:
https://lore.kernel.org/all/[email protected]
* Bump the series revision to v4 to keep it in sync with the dependent CCA DA patchsets. There was no v3 posting.
* Drop [PATCH v2 1/3] iommufd/viommu: Allow associating a KVM VM fd with a vIOMMU
* Add two new patches to associate a struct kvm * with iommufd objects:
iommufd/device: Associate a kvm pointer to iommufd_device iommufd/viommu: Associate a kvm pointer to iommufd_viommu
* Address review feedback
Changes from v1:
https://lore.kernel.org/all/[email protected]
* Rebase onto the latest kernel
* Address review feedback
* Drop the TSM map ioctl; the KVM prefault patch will be used instead to ensure that private memory is preallocated
Aneesh Kumar K.V (Arm) (16):
MAINTAINERS: Update TSM file coverage and repository
virt: coco: tsm: Require PCI operations when registering a TSM
virt: coco: tsm: Remove the device from lookup before PCI teardown
virt: coco: tsm: Complete PCI registration before publishing the
device
virt: coco: tsm: Register the TSM class before device drivers
iommufd: Add a vDEVICE operation ioctl framework PCI/TSM: Remove the legacy guest request interface PCI/TSM: Add helpers to prevent disconnect while in use PCI/TSM: Remove the legacy bind and unbind interface iommufd/viommu: Select vIOMMU operations before allocation PCI/TSM: Add helpers to look up and reference a device's TSM iommufd/viommu: Identify physical IOMMU backing with a tag iommufd/viommu: Allow PCI TSM backends to provide vIOMMU operations iommufd/viommu: Allow vIOMMUs without a parent HWPT PCI/TSM: Wait for DSM users before removing PF0
PCI/TSM: Wait for vIOMMUs to release the TSM before unregistering
Nicolin Chen (1):
iommufd/viommu: Keep a reference to the KVM file
Shameer Kolothum (1):
iommufd/device: Associate KVM file pointer with iommufd_device
Documentation/ABI/testing/sysfs-bus-pci | 15 +- Documentation/userspace-api/iommufd.rst | 45 +- MAINTAINERS | 2 + drivers/crypto/ccp/sev-dev-tsm.c | 5 +- drivers/iommu/amd/iommu.c | 3 +- drivers/iommu/amd/iommufd.c | 18 +- drivers/iommu/amd/iommufd.h | 11 +- drivers/iommu/amd/nested.c | 4 +- .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 38 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 +- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 16 +- .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 25 +- drivers/iommu/iommufd/device.c | 7 +- drivers/iommu/iommufd/hw_pagetable.c | 17 +- drivers/iommu/iommufd/iommufd_private.h | 3 + drivers/iommu/iommufd/main.c | 3 + drivers/iommu/iommufd/selftest.c | 34 +- drivers/iommu/iommufd/viommu.c | 178 ++++++-- drivers/pci/tsm.c | 417 +++++++++--------- drivers/vfio/iommufd.c | 3 +- drivers/virt/coco/tsm-core.c | 230 ++++++++-- include/linux/iommu.h | 20 +- include/linux/iommufd.h | 39 +- include/linux/pci-tsm.h | 120 ++--- include/linux/tsm.h | 46 +- include/uapi/linux/iommufd.h | 36 +- 26 files changed, 858 insertions(+), 484 deletions(-)
base-commit: 65e4fd942f72a9dba0e4e257290c4fa1aa756854
Signature · 1 line
2.43.0