Skip to content

zfcp: Use DMA streaming API to map I/O

M Nikhil linux-s390 linux-scsi sashiko-reviews 9 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v14 Latest2 patches 0 repliesNew
  2. v13 posting 5/52 patches 0 repliesSuperseded
  3. v13 posting 4/52 patches 0 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v13 posting 3/52 patches0 repliesSuperseded
v13 posting 2/52 patches0 repliesSuperseded
v13 posting 1/52 patches0 repliesSuperseded
v12 posting 3/32 patches0 repliesSuperseded
v12 posting 2/32 patches0 repliesSuperseded
v12 posting 1/32 patches0 repliesSuperseded

Patches in v14 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2zfcp: Replace sg-list with sg_table in zfcp_fsf_ct_els structuredrivers/s390/scsi/zfcp_dbf.c drivers/s390/scsi/zfcp_fc.c drivers/s390/scsi/zfcp_fsf.c +1 more+41 -260 replies
2/2zfcp: Use DMA streaming API to map I/Odrivers/s390/scsi/zfcp_aux.c drivers/s390/scsi/zfcp_def.h drivers/s390/scsi/zfcp_ext.h +5 more+557 -830 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchBenjamin BlockNihar Panda
1/2R-b R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v14 thread

Cover letter [PATCH v14 0/2] zfcp: Use DMA streaming API to map I/O

In the existing zFCP driver, virtual addresses are translated directly into bus (physical addresses) for DMA operations on all I/O buffers passing from zFCP driver to the device.

Need for using DMA-API in zFCP driver:

In a Secure Execution environment, the host must ensure that device DMA accesses are restricted to non-guest-private, page-sized memory blocks. This prevents I/O failures that can occur when a device attempts to access guest-private memory. Therefore, guest memory pages must be prepared by the hypervisor before they become accessible to an I/O device.

To support this requirement, the host Linux kernel must be reliably informed whenever a memory region becomes eligible for device DMA access and when that access must be revoked. This information must be maintained correctly at least at page size granularity. To satisfy these requirements, all I/O buffers used by the zFCP driver should be mapped through the DMA API.

DMA API Integration in zFCP:

The zFCP driver is updated to use the DMA streaming API's to map all the I/O buffers which will be passed to the device.
All zFCP I/O buffers (QTCB, SRB, CT/ELS and SCSI I/O) are represented as scatter-gather lists and mapped through DMA API using dma_map_sgtable(). Once the DMA transfer is complete, the corresponding mappings are released using dma_unmap_sgtable().

By routing all device-visible memory through the DMA mapping layer, the driver ensures that:
1. DMA access is properly authorized before use.
2. DMA is revoked after use.
3. Secure Execution memory restrictions are honored.

M Nikhil (2):
zfcp: Replace sg-list with sg_table in zfcp_fsf_ct_els structure
zfcp: Use DMA streaming API to map I/O

 drivers/s390/scsi/zfcp_aux.c  |  15 ++
 drivers/s390/scsi/zfcp_dbf.c  |  16 +-
 drivers/s390/scsi/zfcp_def.h  |   4 +
 drivers/s390/scsi/zfcp_ext.h  |  12 +-
 drivers/s390/scsi/zfcp_fc.c   |  48 +++--
 drivers/s390/scsi/zfcp_fsf.c  | 325 +++++++++++++++++++++++++++++-----
 drivers/s390/scsi/zfcp_fsf.h  |   9 +-
 drivers/s390/scsi/zfcp_qdio.c |  40 +++--
 drivers/s390/scsi/zfcp_qdio.h |  27 +--
 drivers/s390/scsi/zfcp_scsi.c | 205 ++++++++++++++++++++-
 10 files changed, 595 insertions(+), 106 deletions(-)
Signature · 1 line
2.53.0