Skip to content

RFC coco/TSM: Implement host-side support for Arm CCA TDISP setup

Aneesh Kumar K.V (Arm) kvmarm linux-arm-kernel linux-coco lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 RFC Latest16 patches 43 repliesIn review
  2. v3 RFC12 patches 0 repliesSuperseded

Changes in v4 from the cover letter

https://lore.kernel.org/all/[email protected]
* updated the patches to follow the RMM 2.0bet1 specification
* moved vdev request-exit handling to the last patch in the series. This is expected to be dropped once the corresponding spec update lands
* dropped the vdev and pdev arguments from rmi_rtt_dev_validate(). The spec update for that change is still pending. The validation call is now made from the REC enter path
* added a response field to KVM_EXIT_ARM64_TIO so the VMM can pass the ioctl return status back to the exit handler
* dropped vcpu_fd from arm64_vdev_device_memmap_guest_req. Once vdev request handling is removed from the series, the ioctl path will no longer need vcpu_fd
* reworked the host-side vdev lifecycle to better match the RMM 2.0bet1 flow,
* updated the vdev flows to match the revised interfaces: populate MMIO BAR ranges in rmi_vdev_create(), rename the interface-report and measurement update commands, and drop vcpu_fd from the guest MMIO map request path

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16iommu/arm-smmu-v3: Discover RME support and realm IRQ topologyarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h drivers/iommu/arm/arm-smmu-v3/Makefile +3 more+297 -43 replies
2/16iommu/arm-smmu-v3: Save the programmed MSI message in msi_descdrivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c+3 -00 replies
3/16iommu/arm-smmu-v3: Add initial pSMMU realm viommu plumbingarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h arch/arm64/kernel/rmi.c +5 more+225 -037 replies
4/16iommu/arm-smmu-v3: Track realm pSMMU users with refcount_tarch/arm64/include/asm/rmi_cmds.h arch/arm64/kernel/rmi.c drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-realm.c +2 more+50 -90 replies
5/16coco: host: arm64: Add support for virtual device communicationarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h drivers/virt/coco/arm-cca-host/rmi-da.c +1 more+135 -70 replies
6/16coco: host: arm64: Add support for RMM vdev objectsarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h drivers/virt/coco/arm-cca-host/arm-cca.c +2 more+176 -10 replies
7/16coco: host: arm64: Add pdev stream key refresh and purge helpersarch/arm64/include/asm/rmi_cmds.h drivers/virt/coco/arm-cca-host/rmi-da.c drivers/virt/coco/arm-cca-host/rmi-da.h+63 -00 replies
8/16coco: host: arm64: Add helpers to unlock and destroy RMM vdevarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h drivers/virt/coco/arm-cca-host/arm-cca.c +2 more+116 -30 replies
9/16coco: host: arm64: Add support for da object read RHI handlingarch/arm64/include/uapi/asm/rmi-da.h drivers/virt/coco/arm-cca-host/arm-cca.c drivers/virt/coco/arm-cca-host/rmi-da.c +1 more+193 -00 replies
10/16coco: host: arm64: Add helper for cached object fetchesdrivers/virt/coco/arm-cca-host/rmi-da.c drivers/virt/coco/arm-cca-host/rmi-da.h+29 -00 replies
11/16coco: host: arm64: Fetch interface report via RMIarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/uapi/asm/rmi-da.h drivers/virt/coco/arm-cca-host/arm-cca.c +2 more+73 -10 replies
12/16coco: host: arm64: Fetch device measurements via RMIarch/arm64/include/asm/rmi_cmds.h arch/arm64/include/asm/rmi_smc.h arch/arm64/include/uapi/asm/rmi-da.h +3 more+118 -00 replies
13/16coco: host: KVM: arm64: Handle vdev validate-mapping exitsDocumentation/virt/kvm/api.rst arch/arm64/include/asm/kvm_rmi.h arch/arm64/include/asm/rmi_smc.h +7 more+322 -00 replies
14/16KVM: arm64: Unmap device mappings when a private granule is destroyedarch/arm64/include/asm/rmi_smc.h arch/arm64/kvm/rmi.c+83 -50 replies
15/16coco: host: arm64: Transition vdevs to TDISP RUN statearch/arm64/include/asm/rmi_cmds.h arch/arm64/include/uapi/asm/rmi-da.h drivers/virt/coco/arm-cca-host/arm-cca.c +2 more+55 -00 replies
16/16KVM: arm64: CCA: enable DA in realm create parametersarch/arm64/include/asm/rmi_smc.h arch/arm64/kvm/rmi.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [RFC PATCH v4 00/16] coco/TSM: Implement host-side support for Arm CCA TDISP setup

This patch series implements the host-side changes needed for end-to-end Arm CCA TDISP setup. It adds the RMI/RHI plumbing required to create and manage Realm vdev objects, service device-attestation object requests, and complete the KVM/RMM flows needed for device run-time transitions.

The series is based on the RMM 2.0bet1 specification [1] and the RHI v1.0 BET1 specification [5].

At a high level, the series adds support for:
- host-side vdev communication and lifecycle management
- host handling of RHI DA object read/size requests
- host-side fetching and caching of interface reports and measurements
- KVM handling of vdev request/complete exits
- KVM handling of map/validation exits and teardown on granule destroy
- vdev transition to TDISP RUN state
- enabling DA in Realm create parameters

The series builds upon the TSM framework patches posted at [2] and depends on the KVM CCA patchset [3]. A git repository containing all related changes is available at [4]. kvmtool repo is at [6]

Previous posting:
Changes from v3:
https://lore.kernel.org/all/[email protected]
* updated the patches to follow the RMM 2.0bet1 specification
* moved vdev request-exit handling to the last patch in the series. This is expected to be dropped once the corresponding spec update lands
* dropped the vdev and pdev arguments from rmi_rtt_dev_validate(). The spec update for that change is still pending. The validation call is now made from the REC enter path
* added a response field to KVM_EXIT_ARM64_TIO so the VMM can pass the ioctl return status back to the exit handler
* dropped vcpu_fd from arm64_vdev_device_memmap_guest_req. Once vdev request handling is removed from the series, the ioctl path will no longer need vcpu_fd
* reworked the host-side vdev lifecycle to better match the RMM 2.0bet1 flow,
* updated the vdev flows to match the revised interfaces: populate MMIO BAR ranges in rmi_vdev_create(), rename the interface-report and measurement update commands, and drop vcpu_fd from the guest MMIO map request path

Changes from v1:
* rebase to latest kernel and core TSM changes
* address review feedback

rfc-v1: https://lore.kernel.org/all/[email protected]
There is no rfc-v2 posting. This series is marked rfc-v3 to stay aligned with the rest of the CCA patchsets that are being posted as v3.

[1] https://developer.arm.com/documentation/den0137/2-0bet1/
[2] https://lore.kernel.org/all/[email protected]
[3] https://lore.kernel.org/all/[email protected]
[4] https://gitlab.arm.com/linux-arm/linux-cca.git cca/topics/cca-tdisp-upstream-rfc-v4
[5] https://developer.arm.com/documentation/den0148/latest/
[6] https://gitlab.arm.com/linux-arm/kvmtool-cca.git cca/topics/cca-tdisp-upstream-rfc-v4

Cc Alexey Kardashevskiy <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Dan Williams <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Joerg Roedel <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Nicolin Chen <[email protected]>
Cc Pranjal Shrivastava <[email protected]>
Cc Robin Murphy <[email protected]>
Cc Samuel Ortiz <[email protected]>
Cc Steven Price <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Will Deacon <[email protected]>
Cc Xu Yilun <[email protected]>

Aneesh Kumar K.V (Arm) (16):
iommu/arm-smmu-v3: Discover RME support and realm IRQ topology iommu/arm-smmu-v3: Save the programmed MSI message in msi_desc iommu/arm-smmu-v3: Add initial pSMMU realm viommu plumbing iommu/arm-smmu-v3: Track realm pSMMU users with refcount_t
coco: host: arm64: Add support for virtual device communication
coco: host: arm64: Add support for RMM vdev objects
coco: host: arm64: Add pdev stream key refresh and purge helpers
coco: host: arm64: Add helpers to unlock and destroy RMM vdev
coco: host: arm64: Add support for da object read RHI handling
coco: host: arm64: Add helper for cached object fetches
coco: host: arm64: Fetch interface report via RMI
coco: host: arm64: Fetch device measurements via RMI
coco: host: KVM: arm64: Handle vdev validate-mapping exits
KVM: arm64: Unmap device mappings when a private granule is destroyed
coco: host: arm64: Transition vdevs to TDISP RUN state
KVM: arm64: CCA: enable DA in realm create parameters

 Documentation/virt/kvm/api.rst                |  20 +
 arch/arm64/include/asm/kvm_rmi.h              |   4 +
 arch/arm64/include/asm/rmi_cmds.h             | 193 ++++++
 arch/arm64/include/asm/rmi_smc.h              |  98 ++-
 arch/arm64/include/uapi/asm/rmi-da.h          |  47 ++
 arch/arm64/kernel/rmi.c                       |  51 ++
 arch/arm64/kvm/rmi-exit.c                     |  37 ++
 arch/arm64/kvm/rmi.c                          | 279 ++++++++-
 drivers/iommu/arm/arm-smmu-v3/Makefile        |   2 +-
 .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c     |   7 +
 .../iommu/arm/arm-smmu-v3/arm-smmu-v3-realm.c | 297 +++++++++
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c   |  86 ++-
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h   |  16 +
 drivers/virt/coco/arm-cca-host/arm-cca.c      | 188 +++++-
 drivers/virt/coco/arm-cca-host/rmi-da.c       | 569 +++++++++++++++++-
 drivers/virt/coco/arm-cca-host/rmi-da.h       |  40 ++
 include/uapi/linux/iommufd.h                  |   1 +
 include/uapi/linux/kvm.h                      |  11 +
 18 files changed, 1929 insertions(+), 17 deletions(-)
 create mode 100644 arch/arm64/include/uapi/asm/rmi-da.h
 create mode 100644 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-realm.c
Signature · 1 line
2.43.0