From nobody Wed Jun 28 18:10:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QrqPf5tJMz4kVhT; Wed, 28 Jun 2023 18:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QrqPf5Ryfz46JN; Wed, 28 Jun 2023 18:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687975830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eForoTMOSbTo1NFZLB4UWQfEejaoLmUXYS6L0eqHXT8=; b=vRQTQR1GzTl4SA8JsxzCvGFt3WXMkGW852baeh+8QBN+jExzNv72a+BUqGNJ650dz2xv1j ekErLXJq4S1JfBT05bqIkX1ITolSeO9XBH6A8ecSscIYLh9FnlFxTurCoQ1BBh7sItqAak gDX5QjrPTMtdSsNBwqDgrjl7r33AmWobBg6Fbd/fs/gVK3a8KCx76SrAm+w/1zUZMwT47F kVuYryvboGtaH6Ab0baZ48MawG4nmONqZFDHt+FwDufny/4p1DIzmrNKL+BLHvsQZ48bhI J3LwRJxFIBTRT4inO8foSCjsI7YDZYM3Tal/W2U07ZCrtkJxz7X/FcFy4SBFaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687975830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eForoTMOSbTo1NFZLB4UWQfEejaoLmUXYS6L0eqHXT8=; b=x26+3LyYlIL6W8NnBme92vnYAUqGi98AsT7NTnsSYKWsqBU4Ik35Ozgs7mTACbyKCpANJU NA/EBV2REqK2dtMI/c4CVaWMg1oAfHaKVZhWlvtCwW4QP8TEvGN9oF+pz6+LjBFP4PWgHu sRgcQzdKYZCuhWFgLw0g/UyU15SQZMpddJBZk2vCRhJk9Wl8VMk1dZXiqQVtVUN7yqBbjW 8FFbYX2CY4rdq9vDTd/QT1pNf9gCOIDJMkbwqUym/GgM1yagMQHdD9Il7ZmyNGIMa8hxol cqB7Yxaxq2O5cMpL1bI5xgsJeSyqPVaMG/A2wz/7S9vOQm3XJ1kQw6Q4lg8wiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687975830; a=rsa-sha256; cv=none; b=VkWf29/03GubBqGUkaf3+0+Z8M2W+9eLw/ORptApaHoiPNpqO3rdfAhyLe+OEzzQt9/qwc HDNYFAlQYVLtjnPPvDEDz8scX0VZa2kuwYhLS0sp7vA1d+QJFBz/OcK4FXJRTWodR8xAfs rPNWzRUcA9FIP0K8iWNhVT27UXF9ZR+kCVTYm84z74iGpc5kwsm7LpXR6JojcdTrANNU99 F/WyBfwURp4dUn2lMrm8RLKY5Ed5uLFtuBOv5S5w2AjvVoz7BuTHwr7GVmu5mesazWKLmw WM8eNDWBi13bwfCN0VI+B954lYDJ3XJJ8DZFWTLI+lS/Lcf+BnogPIjDFVhGeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QrqPf4WPdzkDV; Wed, 28 Jun 2023 18:10:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35SIAUWH002139; Wed, 28 Jun 2023 18:10:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35SIAUGc002138; Wed, 28 Jun 2023 18:10:30 GMT (envelope-from git) Date: Wed, 28 Jun 2023 18:10:30 GMT Message-Id: <202306281810.35SIAUGc002138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 78cb8841f085 - main - mrsas: Use mrsas_sge64 instead of iovec for the S/G list for passthru. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78cb8841f0853e8059537c32ec4bd31d1fec7134 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=78cb8841f0853e8059537c32ec4bd31d1fec7134 commit 78cb8841f0853e8059537c32ec4bd31d1fec7134 Author: John Baldwin AuthorDate: 2023-06-28 18:10:05 +0000 Commit: John Baldwin CommitDate: 2023-06-28 18:10:05 +0000 mrsas: Use mrsas_sge64 instead of iovec for the S/G list for passthru. The DMA scatter/gather list for mrsas passthrough ioctl commands is stored in a SGL at the end of the DCMD frame. Given the SGL member at the end of the DCMD frame it seems likely this S/G list is formatted as a fixed-width structure such as the type mrsas_sge64 and not as a iovec which contains a kernel pointer and length that vary with the native architecture size. Reviewed by: imp Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D40727 --- sys/dev/mrsas/mrsas_ioctl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/mrsas/mrsas_ioctl.c b/sys/dev/mrsas/mrsas_ioctl.c index 9d3699df5b7b..6f27d18ccab9 100644 --- a/sys/dev/mrsas/mrsas_ioctl.c +++ b/sys/dev/mrsas/mrsas_ioctl.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include struct mrsas_passthru_cmd { - struct iovec *kern_sge; + struct mrsas_sge64 *kern_sge; struct mrsas_softc *sc; struct mrsas_mfi_cmd *cmd; bus_dma_tag_t ioctl_data_tag; @@ -112,8 +112,8 @@ mrsas_passthru_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) } for (i = 0; i < nseg; i++) { - cb->kern_sge[i].iov_base = PTRIN(segs[i].ds_addr); - cb->kern_sge[i].iov_len = segs[i].ds_len; + cb->kern_sge[i].phys_addr = htole64(segs[i].ds_addr); + cb->kern_sge[i].length = htole32(segs[i].ds_len); } cb->sge_count = nseg; @@ -421,7 +421,7 @@ mrsas_user_command(struct mrsas_softc *sc, struct mfi_ioc_passthru *ioc) bus_dma_tag_t ioctl_data_tag; bus_dmamap_t ioctl_data_dmamap; bus_addr_t ioctl_data_phys_addr; - struct iovec *kern_sge; + struct mrsas_sge64 *kern_sge; int ret, ioctl_data_size; char *ioctl_temp_data_mem; @@ -457,11 +457,11 @@ mrsas_user_command(struct mrsas_softc *sc, struct mfi_ioc_passthru *ioc) if (sizeof(bus_addr_t) == 8) cmd->frame->hdr.flags |= MFI_FRAME_SGL64 | MFI_FRAME_SENSE64; - kern_sge = (struct iovec *)(&dcmd->sgl); + kern_sge = (struct mrsas_sge64 *)(&dcmd->sgl); if (ioctl_data_size == 0) { - kern_sge[0].iov_base = 0; - kern_sge[0].iov_len = 0; + kern_sge[0].phys_addr = 0; + kern_sge[0].length = 0; } else { ioctl_temp_data_mem = malloc(ioc->buf_size, M_MRSAS, M_WAITOK); if (ioctl_temp_data_mem == NULL) {