RFC ARM CCA Device Assignment support
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest38 patches 149 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/38 | tsm: Add tsm_bind/unbind helpersdrivers/ include/ | +21 | 0 replies | |
| 2/38 | tsm: Move tsm core outside the host directorydrivers/ drivers/ drivers/ +2 more | +6 | 0 replies | |
| 3/38 | tsm: Move dsm_dev from pci_tdi to pci_tsmdrivers/ include/ | +45 | 2 replies | |
| 4/38 | tsm: Support DMA Allocation from private memoryarch/ arch/ drivers/ +2 more | +22 | 19 replies | |
| 5/38 | tsm: Don't overload connectdrivers/ include/ | +121 | 1 reply | |
| 6/38 | iommufd: Add and option to request for bar mapping with IORESOURCE_EXCLUSIVEdrivers/ drivers/ drivers/ +3 more | +71 | 9 replies | |
| 7/38 | iommufd/viommu: Add support to associate viommu with kvm instancedrivers/ include/ include/ | +59 | 4 replies | |
| 8/38 | iommufd/tsm: Add tsm_op iommufd ioctlsdrivers/ drivers/ drivers/ +2 more | +82 | 3 replies | |
| 9/38 | iommufd/vdevice: Add TSM Guest request uAPIdrivers/ drivers/ drivers/ +5 more | +120 | 1 reply | |
| 10/38 | iommufd/vdevice: Add TSM map ioctlarch/ drivers/ drivers/ +3 more | +104 | 7 replies | |
| 11/38 | KVM: arm64: CCA: register host tsm platform devicearch/ arch/ | +19 | 32 replies | |
| 12/38 | coco: host: arm64: CCA host platform device driverdrivers/ drivers/ drivers/ +3 more | +258 | 6 replies | |
| 13/38 | coco: host: arm64: Create a PDEV with rmmarch/ arch/ drivers/ +3 more | +267 | 5 replies | |
| 14/38 | coco: host: arm64: Device communication supportarch/ arch/ drivers/ +2 more | +344 | 4 replies | |
| 15/38 | coco: host: arm64: Stop and destroy the physical devicearch/ arch/ drivers/ +2 more | +45 | 2 replies | |
| 16/38 | X.509: Make certificate parser publiccrypto/ include/ | +54 | 0 replies | |
| 17/38 | X.509: Parse Subject Alternative Name in certificatescrypto/ include/ | +11 | 0 replies | |
| 18/38 | X.509: Move certificate length retrieval into new helpercrypto/ include/ | +28 | 1 reply | |
| 19/38 | coco: host: arm64: set_pubkey supportarch/ arch/ drivers/ +2 more | +182 | 3 replies | |
| 20/38 | coco: host: arm64: Add support for creating a virtual devicearch/ arch/ drivers/ +3 more | +158 | 1 reply | |
| 21/38 | coco: host: arm64: Add support for virtual device communicationarch/ arch/ drivers/ +1 more | +45 | 2 replies | |
| 22/38 | coco: host: arm64: Stop and destroy virtual devicearch/ arch/ drivers/ +2 more | +95 | 1 reply | |
| 23/38 | coco: guest: arm64: Update arm CCA guest driverarch/ arch/ drivers/ +1 more | +29 | 3 replies | |
| 24/38 | arm64: CCA: Register guest tsm callbackarch/ arch/ arch/ +5 more | +144 | 2 replies | |
| 25/38 | cca: guest: arm64: Realm device lock supportarch/ arch/ drivers/ +3 more | +108 | 1 reply | |
| 26/38 | KVM: arm64: Add exit handler related to device assignmentarch/ arch/ arch/ | +76 | 1 reply | |
| 27/38 | coco: host: arm64: add RSI_RDEV_GET_INSTANCE_ID related exit handlerarch/ arch/ drivers/ +2 more | +63 | 0 replies | |
| 28/38 | coco: host: arm64: Add support for device communication exit handlerarch/ drivers/ drivers/ +1 more | +86 | 0 replies | |
| 29/38 | coco: guest: arm64: Add support for collecting interface reportsarch/ arch/ drivers/ | +50 | 0 replies | |
| 30/38 | coco: host: arm64: Add support for realm host interface (RHI)arch/ drivers/ drivers/ +2 more | +188 | 1 reply | |
| 31/38 | coco: guest: arm64: Add support for fetching interface report and certificate chain from hostarch/ arch/ drivers/ +1 more | +151 | 1 reply | |
| 32/38 | coco: guest: arm64: Add support for guest initiated TDI bind/unbindarch/ arch/ arch/ +2 more | +69 | 2 replies | |
| 33/38 | KVM: arm64: CCA: handle dev mem map/unmaparch/ arch/ arch/ +2 more | +262 | 0 replies | |
| 34/38 | coco: guest: arm64: Validate mmio range found in the interface reportarch/ arch/ drivers/ +2 more | +182 | 12 replies | |
| 35/38 | coco: guest: arm64: Add Realm device start and stop supportarch/ arch/ drivers/ +2 more | +97 | 2 replies | |
| 36/38 | KVM: arm64: CCA: enable DA in realm create parametersarch/ arch/ | +3 | 1 reply | |
| 37/38 | coco: guest: arm64: Add support for fetching device measurementsarch/ arch/ drivers/ +1 more | +68 | 2 replies | |
| 38/38 | coco: guest: arm64: Add support for fetching device infoarch/ arch/ drivers/ +2 more | +179 | 4 replies |
Reviews trailers per patch
3 of 38 patches have a Reviewed-by or Acked-by.
| Patch | Dan Williams | Ilpo Järvinen | Jonathan Cameron | Wilfred Mallawa |
|---|---|---|---|---|
| 1/38 | ||||
| 2/38 | ||||
| 3/38 | ||||
| 4/38 | ||||
| 5/38 | ||||
| 6/38 | ||||
| 7/38 | ||||
| 8/38 | ||||
| 9/38 | ||||
| 10/38 | ||||
| 11/38 | ||||
| 12/38 | ||||
| 13/38 | ||||
| 14/38 | ||||
| 15/38 | ||||
| 16/38 | R-b | R-b | R-b | |
| 17/38 | A-b | R-b | R-b | R-b |
| 18/38 | R-b | R-b | ||
| 19/38 | ||||
| 20/38 | ||||
| 21/38 | ||||
| 22/38 | ||||
| 23/38 | ||||
| 24/38 | ||||
| 25/38 | ||||
| 26/38 | ||||
| 27/38 | ||||
| 28/38 | ||||
| 29/38 | ||||
| 30/38 | ||||
| 31/38 | ||||
| 32/38 | ||||
| 33/38 | ||||
| 34/38 | ||||
| 35/38 | ||||
| 36/38 | ||||
| 37/38 | ||||
| 38/38 |
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 [RFC PATCH v1 00/38] ARM CCA Device Assignment support
This patch series implements support for Device Assignment in the ARM CCA architecture. The code changes are based on Alp12 specification published here [1].
The code builds on the TSM framework patches posted at [2]. We add extension to that framework so that TSM is now used in both the host and the guest.
A DA workflow can be summarized as below:
Host:
step 1.
echo ${DEVICE} > /sys/bus/pci/devices/${DEVICE}/driver/unbind echo vfio-pci > /sys/bus/pci/devices/${DEVICE}/driver_override echo ${DEVICE} > /sys/bus/pci/drivers_probe
step 2.
echo 1 > /sys/bus/pci/devices/$DEVICE/tsm/connect
Now in the guest we follow the below steps
step 1:
echo ${DEVICE} > /sys/bus/pci/devices/${DEVICE}/driver/unbind
step 2: Move the device to TDISP LOCK state
echo 1 > /sys/bus/pci/devices/${DEVICE}/tsm/lock
step 3: Moves the device to TDISP RUN state echo 1 > /sys/bus/pci/devices/${DEVICE}/tsm/accept
step 4: Load the driver again.
echo ${DEVICE} > /sys/bus/pci/drivers_probe
I'm currently working against TSM v3, as TSM v4 lacks the necessary callbacks—bind, unbind, and guest_req—required for guest interactions.
The implementation also makes use of RHI interfaces that fall outside the current RHI specification [5]. Once the spec is finalized, the code will be aligned accordingly.
For now, I’ve retained validate_mmio and vdev_req exit handling within KVM. This will transition to a guest_req-based mechanism once the specification is updated.
At that point, all device assignment (DA)-specific VM exits will exit directly to the VMM, and will use the guest_req ioctl to handle exit reasons. As part of this change, the handlers realm_exit_vdev_req_handler, realm_exit_vdev_comm_handler, and realm_exit_dev_mem_map_handler will be removed.
Full patchset for the kernel and kvmtool can be found at [3] and [4]
[1] https://developer.arm.com/-/cdn-downloads/permalink/Architectures/Armv9/DEN0137_1.1-alp12.zip
[2] https://lore.kernel.org/all/[email protected]
[3] https://git.gitlab.arm.com/linux-arm/linux-cca.git cca/tdisp-upstream-post-v1
[4] https://git.gitlab.arm.com/linux-arm/kvmtool-cca.git cca/tdisp-upstream-post-v1
[5] https://developer.arm.com/documentation/den0148/latest/
Aneesh Kumar K.V (Arm) (35):
tsm: Add tsm_bind/unbind helpers
tsm: Move tsm core outside the host directory
tsm: Move dsm_dev from pci_tdi to pci_tsm
tsm: Support DMA Allocation from private memory
tsm: Don't overload connect
iommufd: Add and option to request for bar mapping with
IORESOURCE_EXCLUSIVE
iommufd/viommu: Add support to associate viommu with kvm instance iommufd/tsm: Add tsm_op iommufd ioctls
iommufd/vdevice: Add TSM Guest request uAPI iommufd/vdevice: Add TSM map ioctl
KVM: arm64: CCA: register host tsm platform device
coco: host: arm64: CCA host platform device driver
coco: host: arm64: Create a PDEV with rmm
coco: host: arm64: Device communication support
coco: host: arm64: Stop and destroy the physical device
coco: host: arm64: set_pubkey support
coco: host: arm64: Add support for creating a virtual device
coco: host: arm64: Add support for virtual device communication
coco: host: arm64: Stop and destroy virtual device
coco: guest: arm64: Update arm CCA guest driver
arm64: CCA: Register guest tsm callback
cca: guest: arm64: Realm device lock support
KVM: arm64: Add exit handler related to device assignment
coco: host: arm64: add RSI_RDEV_GET_INSTANCE_ID related exit handler
coco: host: arm64: Add support for device communication exit handler
coco: guest: arm64: Add support for collecting interface reports
coco: host: arm64: Add support for realm host interface (RHI)
coco: guest: arm64: Add support for fetching interface report and
certificate chain from host
coco: guest: arm64: Add support for guest initiated TDI bind/unbind
KVM: arm64: CCA: handle dev mem map/unmap
coco: guest: arm64: Validate mmio range found in the interface report
coco: guest: arm64: Add Realm device start and stop support
KVM: arm64: CCA: enable DA in realm create parameters
coco: guest: arm64: Add support for fetching device measurements
coco: guest: arm64: Add support for fetching device info
Lukas Wunner (3):
X.509: Make certificate parser public
X.509: Parse Subject Alternative Name in certificates X.509: Move certificate length retrieval into new helper
arch/arm64/include/asm/kvm_rme.h | 3 +
arch/arm64/include/asm/mem_encrypt.h | 6 +-
arch/arm64/include/asm/rhi.h | 39 +
arch/arm64/include/asm/rmi_cmds.h | 173 ++++
arch/arm64/include/asm/rmi_smc.h | 210 ++++-
arch/arm64/include/asm/rsi.h | 5 +-
arch/arm64/include/asm/rsi_cmds.h | 129 +++
arch/arm64/include/asm/rsi_smc.h | 60 ++
arch/arm64/kernel/Makefile | 2 +-
arch/arm64/kernel/rhi.c | 35 +
arch/arm64/kernel/rsi.c | 26 +-
arch/arm64/kvm/mmu.c | 45 +
arch/arm64/kvm/rme-exit.c | 87 ++
arch/arm64/kvm/rme.c | 208 ++++-
arch/arm64/mm/mem_encrypt.c | 10 +
crypto/asymmetric_keys/x509_cert_parser.c | 9 +
crypto/asymmetric_keys/x509_loader.c | 38 +-
crypto/asymmetric_keys/x509_parser.h | 40 +-
drivers/iommu/iommufd/device.c | 54 ++
drivers/iommu/iommufd/iommufd_private.h | 7 +
drivers/iommu/iommufd/main.c | 13 +
drivers/iommu/iommufd/viommu.c | 178 +++-
drivers/pci/tsm.c | 229 ++++-
drivers/vfio/pci/vfio_pci_core.c | 20 +-
drivers/virt/coco/Kconfig | 5 +-
drivers/virt/coco/Makefile | 7 +-
drivers/virt/coco/arm-cca-guest/Kconfig | 10 +-
drivers/virt/coco/arm-cca-guest/Makefile | 3 +
.../{arm-cca-guest.c => arm-cca.c} | 175 +++-
drivers/virt/coco/arm-cca-guest/rsi-da.c | 576 ++++++++++++
drivers/virt/coco/arm-cca-guest/rsi-da.h | 73 ++
drivers/virt/coco/arm-cca-host/Kconfig | 17 +
drivers/virt/coco/arm-cca-host/Makefile | 5 +
drivers/virt/coco/arm-cca-host/arm-cca.c | 384 ++++++++
drivers/virt/coco/arm-cca-host/rmm-da.c | 857 ++++++++++++++++++
drivers/virt/coco/arm-cca-host/rmm-da.h | 108 +++
drivers/virt/coco/host/Kconfig | 6 -
drivers/virt/coco/host/Makefile | 6 -
drivers/virt/coco/{host => }/tsm-core.c | 27 +
include/keys/asymmetric-type.h | 2 +
include/keys/x509-parser.h | 55 ++
include/linux/device.h | 1 +
include/linux/iommufd.h | 4 +
include/linux/kvm_host.h | 1 +
include/linux/pci-tsm.h | 37 +-
include/linux/swiotlb.h | 4 +
include/linux/tsm.h | 29 +
include/uapi/linux/iommufd.h | 69 ++
48 files changed, 3887 insertions(+), 200 deletions(-)
create mode 100644 arch/arm64/include/asm/rhi.h
create mode 100644 arch/arm64/kernel/rhi.c
rename drivers/virt/coco/arm-cca-guest/{arm-cca-guest.c => arm-cca.c} (62%)
create mode 100644 drivers/virt/coco/arm-cca-guest/rsi-da.c
create mode 100644 drivers/virt/coco/arm-cca-guest/rsi-da.h
create mode 100644 drivers/virt/coco/arm-cca-host/Kconfig
create mode 100644 drivers/virt/coco/arm-cca-host/Makefile
create mode 100644 drivers/virt/coco/arm-cca-host/arm-cca.c
create mode 100644 drivers/virt/coco/arm-cca-host/rmm-da.c
create mode 100644 drivers/virt/coco/arm-cca-host/rmm-da.h
delete mode 100644 drivers/virt/coco/host/Kconfig
delete mode 100644 drivers/virt/coco/host/Makefile
rename drivers/virt/coco/{host => }/tsm-core.c (85%)
create mode 100644 include/keys/x509-parser.hSignature · 1 line
2.43.0