From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796021666; b=hpTEiTpswpi9+Uq85pHRE3564nqYRgzZ9cpDNc3s4/TcsUqKQisOsxYeP7c+2p7ywS8i lSMOS5lmNE8AtjYSJ7lQRbKFu/rBHETuD33+D9NSIYqGavyV99nIlnSXQ/dEvr58UNwJo kL90UEq94KGm/hRzx1K39g9NgULCb0NH3PLu5hbUZkRqLxt+BkuT165vffd0vyMIUpFiI qFl1YPXhHp1gN70hXU7n3f83U17TOxK4gOxGCvHojydtgPG6TkYqu3CtwnWGiyR1ECY59 LjB6Xx1QWfDVsyD/7TQVqun5xDMFdakXQ5F2zhOm2NLBOmYPaU0OERKm6pPWNYzX5Fw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796021666; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:From:To:Cc:Subject:Date: Message-Id:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-TM-AS-GCONF:X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-GUID:X-Proofpoint-Spam-Info:X-Authority-Analysis: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=TX7Nii9x5yTysf9/AmcLYyyr6SmHK8dLBkxO2v0O1E0=; b=kLWXtpThxg46NTa7+HZd06TRL2UvhOLswBdHhXssE5OLBLxHMYw9DLm2hD4lB5KPnufN HytmPK/hyS/4H5MY26Bhta00CAEPNX1Fvf7WyEwE3yUa8UgiVEpuK+hLyeBZoQZfFXgCz 7tWjdIhS1bW/mRoLhQ7kDpj+9QxyBzSLQ7R3v3kglNomnNV96rS9rKqqD9cScTs6MHkct 6Al10WIa3SlhDlSgKDRuZXHROhQTf/Ifgc2iyoknVKKO2Kfrx5V5kyMxnaS2m0cgO5VVw 0T8jh7E9eUiX2ymJxErtDvtFm3puMpKxnD7SFcUAt9guNGGMb5skByYA5h+mYDaj1iA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=N3b+5kGN; arc=none smtp.remote-ip=148.163.156.1 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77FFC606A31C; Mon, 30 Nov 2026 06:54:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 77FFC606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=N3b+5kGN Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU5Z7CH691334; Mon, 30 Nov 2026 06:54:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=TX7Nii9x5yTysf9/AmcLYyyr6SmHK8dLBkxO2v0O1 E0=; b=N3b+5kGNSSfT/tqhZSVQsFeA3jUjf5YTvcW7dP7mAQxt5pKXspFZP4aQm bG91hWDXab7r8gUBYjwLrFUTvtsr2zUpgpMOrZeEEQrK9iHznmVIo3R/TGAG8OuE 2z7afpaygGVQ7rbkpbn354RWDKfKCEJi0lUGK7ykFAkO015OiLlvDQYVJdIiDYMt kj8UOTzpquFVEYxV3oH3ITlqUoxtqMsFrKCqkJaxcYgu6tOf/20bbPbPUFUAvRho 3t9hZ1u+HaCKAHNtheRygaxihidHbxPmCc+HVk8eC2eLrl7IZcT7ZBhquaGaT77R DKi3o3lnfWzFXlIpSWVanGafKaq2A== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4j7pmsxja4-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 06:54:25 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6AU5JIBY634083; Mon, 30 Nov 2026 06:54:24 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4j8asgksyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 06:54:24 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6AU6sKHf39715258 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Nov 2026 06:54:20 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 38DA020043; Mon, 30 Nov 2026 06:54:20 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E97E920040; Mon, 30 Nov 2026 06:54:18 +0000 (GMT) Received: from dhcp-9-123-9-11.bl1-in.ibm.com (unknown [9.123.9.11]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 30 Nov 2026 06:54:18 +0000 (GMT) From: M Nikhil To: sashiko-reviews@lists.linux.dev, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org Cc: niharp@linux.ibm.com, pasic@linux.ibm.com, bblock@linux.ibm.com Subject: [PATCH v15 0/2] zfcp: Use DMA streaming API to map I/O Date: Mon, 30 Nov 2026 12:24:14 +0530 Message-Id: <20261130065416.64595-1-nikh1092@linux.ibm.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Cw4fl4ldSvxEIXPFKfGbQ8So0gJlZ4Kq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTMwMDAyNiBTYWx0ZWRfX0xJNtScDGvyH +WPsgRP8WwJ9xJzho+hEJu4CJEsqmvTZcBxd8gZHj6Kc9Ad1YqyQD7mPvJymOxFM/nUnZZe6cPZ 65vVBG2EGivY5KBruVD8ksx61lhqJrlfVhol4ZHQpowzIc6eKARgXQZqGqPr5v7TYNWEg8ujVq9 diiX8grTc+Wv+zKrietrq8/KPXC2BTay0C2+U2i8IKFzxOj2lqqVABw0ZRlEN2cx+CD9/xPhY36 MU4RBoVei9gVWuH2K4bdKUsOl4i3LSrCs4hbDuOLJpZ9MM4IkrrWUqIAC1GVLTY0iqHacJPqX7u t9pntVZku2X/mCLGepT6uZjIabWUn3QQBZMB9aWUAkU7slrxlMpCgLoCRH/oiGMJ3/VxwPyU2tb xgM6jodgZK+MKDyqdV4L/NO0OmiXUjSLB63AGK4r/3r96mA/C18gqfF3p+9stUii7xrHqTdfvh8 cZbb2I73N0EkHYQry4w== X-Proofpoint-GUID: Cw4fl4ldSvxEIXPFKfGbQ8So0gJlZ4Kq X-Proofpoint-Spam-Info: AW1haW4tMjYxMTMwMDAyNiBTYWx0ZWRfX5hPd8p5AGNm6 docihi7todyHOeHgJwH7ztYBTvLTny9ZN+TUYHTIgbke9ybeXJODHKHWEJBx5CBBHKw35k2A1Jz FaxVhlo1vaRypctUmRNr97lwS7A7Oe0= X-Authority-Analysis: v=2.4 cv=U9cHnuru c=1 sm=1 tr=0 ts=6b0d1da1 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=Wd4ccqAm3J3WqkYLFQkA:9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-30_02,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 phishscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611300026 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 | 17 ++ drivers/s390/scsi/zfcp_ext.h | 14 +- drivers/s390/scsi/zfcp_fc.c | 46 +++-- drivers/s390/scsi/zfcp_fsf.c | 338 +++++++++++++++++++++++++++++----- drivers/s390/scsi/zfcp_fsf.h | 9 +- drivers/s390/scsi/zfcp_qdio.c | 45 +++-- drivers/s390/scsi/zfcp_qdio.h | 27 +-- drivers/s390/scsi/zfcp_scsi.c | 146 +++++++++++++-- 10 files changed, 561 insertions(+), 112 deletions(-) -- 2.39.5 (Apple Git-154)