From nobody Fri Mar 29 11:03:05 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.de; 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.de ARC-Seal: i=1; a=rsa-sha256; t=1601461469; cv=none; d=zohomail.com; s=zohoarc; b=BjjkjPdslY3mhq83vzcmzUyFPgKbeZU4lRjwA75aEQ1bfiwPWIz2ttOb2WQGyl6RCNS8kCnxDfxevaGsMEmCGIqdcxNbdM5rdVYh5y4gcGvkWoM5AYtMcuTT3yw2+5vUm/mTWdUpEvvk8vE2/rON+wgrmedpsyffTys4RjPcix0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601461469; 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=2KLfepVv+yV1c6iyi6vR1BRfKDaCNC5xqB+mUMg+mwM=; b=HI7sRp0ylg8Da0nE31aoaaaJ7RkA44QzjYYPbWpEg4bMyMVsR4ixNkWU5ZeIAD6cXpon/h2oi93xbIeRatFurd985myLdCa49/BvsMPhoF6+Gnd86eQa6NC9PhIUOnoNUqW7Y3Pq5iYFVTzHPovH1SziBEapPbMgRY7r4UJ1O70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@amazon.de; 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 1601461469804151.6163289521014; Wed, 30 Sep 2020 03:24:29 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id DC17310C007E; Wed, 30 Sep 2020 10:24:25 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 61AC610C0076 for ; Wed, 30 Sep 2020 10:24:10 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 30 Sep 2020 10:24:02 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by email-inbound-relay-1e-c7c08562.us-east-1.amazon.com (Postfix) with ESMTPS id F0A962429B9 for ; Wed, 30 Sep 2020 10:24:01 +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 10:24:01 +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 10:23:59 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX13D02EUC001.ant.amazon.com ([10.43.164.92]) with mapi id 15.00.1497.006; Wed, 30 Sep 2020 10:23:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1601461451; x=1632997451; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=jx6ejLMdQmtb+pDihhoMKuFKVFr34t20iS7VvvHtYf8=; b=kkvELTKL5utzU8BU7qlIL2WUZst7BDhnh/XP1EgKcajiZuwnQ2K5hgqT /u7jzPdPBOYpGo9AIB6ZO9MdN8yavsnt1vcatvuQBiMMDsInL7v6P06a6 KAyDxK7vEgK1wDDSd7Nc1AL2YFMxyl9+Ykj+QjQOW77VqkT9PHyOudQhU A=; X-IronPort-AV: E=Sophos;i="5.77,322,1596499200"; d="scan'208";a="80448394" From: "Sironi, Filippo" To: "Graf (AWS), Alexander" , "seabios@seabios.org" Thread-Topic: [UNVERIFIED SENDER] [SeaBIOS] [PATCH 2/3] nvme: Allow to set PRP2 Thread-Index: AQHWlqaQh90QWBTf50+K5KgY9S9ZoamA+jN+ Date: Wed, 30 Sep 2020 10:23:58 +0000 Message-ID: <1601461438390.53222@amazon.de> References: <20200929183653.4717-1-graf@amazon.com>,<20200929183653.4717-3-graf@amazon.com> In-Reply-To: <20200929183653.4717-3-graf@amazon.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted MIME-Version: 1.0 Message-ID-Hash: LGOQNATBIYYPWGYANRKFELL3EWEXKUUL X-Message-ID-Hash: LGOQNATBIYYPWGYANRKFELL3EWEXKUUL X-MailFrom: prvs=5351b6f17=sironi@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] Re: [UNVERIFIED SENDER] [PATCH 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" Reviewed-by: Filippo Sironi ________________________________________ From: Alexander Graf Sent: Tuesday, September 29, 2020 20:36 To: seabios@seabios.org Subject: [UNVERIFIED SENDER] [SeaBIOS] [PATCH 2/3] nvme: Allow to set PRP2 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 --- 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 2cde6a7..406ed19 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; 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); 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) 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 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); -- 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 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