From nobody Fri Apr 19 18:07:07 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=1601470055; cv=none; d=zohomail.com; s=zohoarc; b=XoXJJSM8A9FKMnIhYyW0JCnrrrWTFNqZHkEejNCxbILAaAbdDTQVPRjjz8RHGI0Apb7luV1MLOAs+EJTlImulWx76cNKpPAaM16UvIdDrmzL1jwst0CcG7lkcz1MMOP+c5sgCrmOZXeopHHQ/oAuYMo+2RxK8oT1DKQ5cvUGpUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601470055; 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=BSUw9xhLkqYSCQ32zUp1iAAVX9uLGXxIR1FOOIicwyw=; b=FCL23Cry+zg9BP+HNaqiZJN+9ICh11UeDBmcmp7ZUX6n+Dj7COCzy2tvcAb/+bXAsdB7fOJA8/eAAlIEqF7kNZG/z6pvKW8CeaqOq3JjDwQCH5IgCtXCPxqgdq7+CgYHNn5Yu5v+NytOqBCWC4G9GPbxlHP9iYua/XTmk0tkt5w= 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 1601470055521220.4752333944532; Wed, 30 Sep 2020 05:47:35 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 8F30410C0079; Wed, 30 Sep 2020 12:47:31 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id AE09A10C0077 for ; Wed, 30 Sep 2020 12:47:17 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 30 Sep 2020 12:47:16 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by email-inbound-relay-1e-27fb8269.us-east-1.amazon.com (Postfix) with ESMTPS id D02F9A1C20 for ; Wed, 30 Sep 2020 12:47:15 +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 12:47:15 +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 12:47:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1601470038; x=1633006038; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hmyXlj/Ti5J5FUG5DEvY8vpTv0+na2E7Yqs21h2XjWU=; b=V6e8yt1kdaj+hPURRecziJ0FQRfeaojSDk5TXQuMLe3znozSXk2BcZqN 6gf1K6UyT72PMDzbWxDZrdBkIwEeoOMw0dwm8sV+brBwj2FF/UJIdcZAt 7tk8PMBuNGWm37TcJXNMU23hwqE0tcNS3U/nBFmfM20cFra4dO7mOErai E=; X-IronPort-AV: E=Sophos;i="5.77,322,1596499200"; d="scan'208";a="58572216" From: Alexander Graf To: Date: Wed, 30 Sep 2020 14:47:03 +0200 Message-ID: <20200930124704.1846-3-graf@amazon.com> In-Reply-To: <20200930124704.1846-1-graf@amazon.com> References: <20200930124704.1846-1-graf@amazon.com> MIME-Version: 1.0 X-ClientProxiedBy: EX13D34UWA002.ant.amazon.com (10.43.160.245) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Message-ID-Hash: 3E6YRRN3WMH5PFZBNO3KUVH53PAPUOWZ X-Message-ID-Hash: 3E6YRRN3WMH5PFZBNO3KUVH53PAPUOWZ 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 v2 2/3] 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 7e56134..04bbba4 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