From nobody Fri Apr 19 20:55:47 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Received-SPF: none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@amazon.com; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=quarantine dis=quarantine) header.from=amazon.com ARC-Seal: i=1; a=rsa-sha256; t=1601500327; cv=none; d=zohomail.com; s=zohoarc; b=LhToA+VTIhhNmsxueeYRR+lYz2Bxz9zCN0gtbMRaqlQOR5HbAZKzXdOhl9WSBO1sY8CpPcW83JTbHPlIORiw/WTw7DgWjoW5I/spqX0xCEOCyOWNR4TFHB9WtTCuo1oprNlIHhoLovQu7Xz5Wgf0CCjdE0L4YftQJ3pcn8HyF2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601500327; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To; bh=XcQ9tcQ0ucjtn6KJzTyuxIYE8Datpw3dhFhqvlCuZI4=; b=gOf1eB9gkcfIZTEyUVUH0xICCgw7T63ZdVCMsJNxrQ+FOo/i3n2XbFinGjaEzkYqUz2hoUq6fhMq08KmvlT6Skz4TGCeWloVk+qKZ7JUjQFidEj9wwVAhZ+1K6wremdFlr3FNKS2v2UnSLK8k6EiOwH7NpxIoMSJu6W0xTSPAJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@amazon.com; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1601500327892799.7075362843091; Wed, 30 Sep 2020 14:12:07 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id E4A7210C009E; Wed, 30 Sep 2020 21:12:03 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 308AC10C0084 for ; Wed, 30 Sep 2020 21:11:30 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 30 Sep 2020 21:11:07 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by email-inbound-relay-2c-168cbb73.us-west-2.amazon.com (Postfix) with ESMTPS id 53F33A1FD9 for ; Wed, 30 Sep 2020 21:11:07 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 21:11:06 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX13D20UWC001.ant.amazon.com (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 21:11:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1601500290; x=1633036290; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nyfv60RGr+MkhCdP7OzPi9VDsRVgHEK6GTdL5F6Z0GE=; b=bv5mlSy5AzwjkSAGArqv8FcVgaaxyJU4ybYRyTI9wjD/adXfUnjt31Ns K3MkEdJkZnu0pgVSQsSex3SlwIVjQMg4hMfDp2kNzYdOc+h39NwkGecK3 3xl1mXzuDw7UOTFskymp8kfii9jAcTaRm2Gwdk71sWXmbEmB/hng/3JMQ E=; X-IronPort-AV: E=Sophos;i="5.77,322,1596499200"; d="scan'208";a="57257586" From: Alexander Graf To: Date: Wed, 30 Sep 2020 23:10:54 +0200 Message-ID: <20200930211056.8478-3-graf@amazon.com> In-Reply-To: <20200930211056.8478-1-graf@amazon.com> References: <20200930211056.8478-1-graf@amazon.com> MIME-Version: 1.0 X-ClientProxiedBy: EX13D15UWA002.ant.amazon.com (10.43.160.218) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Message-ID-Hash: XTJCBZOK6UAWFR2OX6ZMFBRR72UHNMN2 X-Message-ID-Hash: XTJCBZOK6UAWFR2OX6ZMFBRR72UHNMN2 X-MailFrom: prvs=535b814ec=graf@amazon.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.3.2b1 Precedence: list Subject: [SeaBIOS] [PATCH v3 2/4] nvme: Allow to set PRP2 List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: ------ X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When creating a PRP based I/O request, we pass in the pointer to operate on. Going forward, we will want to be able to pass additional pointers though for mappings above 4k. This patch adds a parameter to nvme_get_next_sqe() to pass in the PRP2 value of an NVMe I/O request, paving the way for a future patch to implement PRP lists. Signed-off-by: Alexander Graf Reviewed-by: Filippo Sironi --- src/hw/nvme.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hw/nvme.c b/src/hw/nvme.c index 5bc2586..f1b9331 100644 --- a/src/hw/nvme.c +++ b/src/hw/nvme.c @@ -152,7 +152,7 @@ nvme_wait(struct nvme_sq *sq) /* Returns the next submission queue entry (or NULL if the queue is full).= It also fills out Command Dword 0 and clears the rest. */ static struct nvme_sqe * -nvme_get_next_sqe(struct nvme_sq *sq, u8 opc, void *metadata, void *data) +nvme_get_next_sqe(struct nvme_sq *sq, u8 opc, void *metadata, void *data, = void *data2) { if (((sq->head + 1) & sq->common.mask) =3D=3D sq->tail) { dprintf(3, "submission queue is full"); @@ -166,6 +166,7 @@ nvme_get_next_sqe(struct nvme_sq *sq, u8 opc, void *met= adata, void *data) sqe->cdw0 =3D opc | (sq->tail << 16 /* CID */); sqe->mptr =3D (u32)metadata; sqe->dptr_prp1 =3D (u32)data; + sqe->dptr_prp2 =3D (u32)data2; =20 if (sqe->dptr_prp1 & (NVME_PAGE_SIZE - 1)) { /* Data buffer not page aligned. */ @@ -200,7 +201,7 @@ nvme_admin_identify(struct nvme_ctrl *ctrl, u8 cns, u32= nsid) struct nvme_sqe *cmd_identify; cmd_identify =3D nvme_get_next_sqe(&ctrl->admin_sq, NVME_SQE_OPC_ADMIN_IDENTIFY, NULL, - identify_buf); + identify_buf, NULL); =20 if (!cmd_identify) { warn_internalerror(); @@ -338,7 +339,7 @@ nvme_create_io_cq(struct nvme_ctrl *ctrl, struct nvme_c= q *cq, u16 q_idx) =20 cmd_create_cq =3D nvme_get_next_sqe(&ctrl->admin_sq, NVME_SQE_OPC_ADMIN_CREATE_IO_CQ, NUL= L, - cq->cqe); + cq->cqe, NULL); if (!cmd_create_cq) { goto err_destroy_cq; } @@ -382,7 +383,7 @@ nvme_create_io_sq(struct nvme_ctrl *ctrl, struct nvme_s= q *sq, u16 q_idx, struct =20 cmd_create_sq =3D nvme_get_next_sqe(&ctrl->admin_sq, NVME_SQE_OPC_ADMIN_CREATE_IO_SQ, NUL= L, - sq->sqe); + sq->sqe, NULL); if (!cmd_create_sq) { goto err_destroy_sq; } @@ -429,7 +430,7 @@ nvme_io_readwrite(struct nvme_namespace *ns, u64 lba, c= har *buf, u16 count, struct nvme_sqe *io_read =3D nvme_get_next_sqe(&ns->ctrl->io_sq, write ? NVME_SQE_OPC_IO_W= RITE : NVME_SQE_OPC_IO_R= EAD, - NULL, buf); + NULL, buf, NULL); io_read->nsid =3D ns->ns_id; io_read->dword[10] =3D (u32)lba; io_read->dword[11] =3D (u32)(lba >> 32); --=20 2.16.4 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org