From patchwork Wed Jul 29 22:06:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1338530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=irrelevant.dk Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=default header.b=rW6aArx/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BH7535jVcz9sRN for ; Thu, 30 Jul 2020 08:09:59 +1000 (AEST) Received: from localhost ([::1]:49916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k0uGr-0002Gj-3q for incoming@patchwork.ozlabs.org; Wed, 29 Jul 2020 18:09:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0uDo-0006oe-Pw; Wed, 29 Jul 2020 18:06:48 -0400 Received: from charlie.dont.surf ([128.199.63.193]:34612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k0uDl-0008U5-7v; Wed, 29 Jul 2020 18:06:48 -0400 Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by charlie.dont.surf (Postfix) with ESMTPSA id DAF95BF616; Wed, 29 Jul 2020 22:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=irrelevant.dk; s=default; t=1596060402; bh=PWC1uSf9gvUeJXpIbaAR4n8Y57AHWSEEhnnBDFKHR2I=; h=From:To:Cc:Subject:Date:From; b=rW6aArx/DPe9dEdibtJKQoZ2sX+PYftOqDDqAYiXeZwupItYCfCzjq7FYO4w7nlq7 u6/jocpNiAUNnlOXTBN7/ZU8fEqHYiBHZaYBtywrZ5qvRMsnIB8aGyYfosJJ7sdNqU rfDyI6PF/ex9XK/+UlNVd95GLjifGrGuzuBLIy+8/yHfKsfwsd0VWkrASNnKpg4Oof VL5fcm8URiqOi0tXYw0kfT3ki6cJ/oN0EHj1taOQHSR5UehtiL4QMR1/Wr8+bxMYTJ 2DKxNocmj3myHNltwRiQQQe8NKivAc9ayGIJHE/hT+dUHTPbBeJljLMnbN6DeT3iMj dlP55SRSHI0rA== From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v2 00/16] hw/block/nvme: dma handling and address mapping cleanup Date: Thu, 30 Jul 2020 00:06:22 +0200 Message-Id: <20200729220638.344477-1-its@irrelevant.dk> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Received-SPF: pass client-ip=128.199.63.193; envelope-from=its@irrelevant.dk; helo=charlie.dont.surf X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/29 14:23:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Maxim Levitsky , Klaus Jensen , Andrzej Jakowski , Minwoo Im , Keith Busch , Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This series consists of patches that refactors dma read/write and adds a number of address mapping helper functions. v2: * hw/block/nvme: add mapping helpers - Add an assert in case of out of bounds array access. (Maxim) * hw/block/nvme: remove redundant has_sg member - Split the fix for the missing qemu_iov_destroy into a fresh patch ("hw/block/nvme: destroy request iov before reuse"). (Minwoo) * hw/block/nvme: pass request along for tracing [DROPPED] - Dropped the patch and replaced it with a simple patch that just adds tracing to the nvme_map_prp function ("hw/block/nvme: add tracing to nvme_map_prp"). (Minwoo) * hw/block/nvme: add request mapping helper - Changed the name from nvme_map to nvme_map_dptr. (Minwoo, Maxim) * hw/block/nvme: add check for mdts - Don't touch the documentaiton for the cmb_size_mb and max_ioqpairs parameters in this patch. (Minwoo) * hw/block/nvme: refactor NvmeRequest clearing [DROPPED] - Keep NvmeRequest structure clearing as "before use". (Maxim) * hw/block/nvme: add a namespace reference in NvmeRequest * hw/block/nvme: remove NvmeCmd parameter - Squash these two patches together into "hw/block/nvme: add ns/cmd references in NvmeRequest". * hw/block/nvme: consolidate qsg/iov clearing - Move the qsg/iov destroys to a new nvme_req_exit function that is called after the cqe has been posted. * hw/block/nvme: remove explicit qsg/iov parameters - New patch. THe nvme_map_prp() function doesn't require the qsg and iov parameters since it can just get them from the passed NvmeRequest. Based-on: <20200706061303.246057-1-its@irrelevant.dk> Klaus Jensen (16): hw/block/nvme: memset preallocated requests structures hw/block/nvme: add mapping helpers hw/block/nvme: replace dma_acct with blk_acct equivalent hw/block/nvme: remove redundant has_sg member hw/block/nvme: destroy request iov before reuse hw/block/nvme: refactor dma read/write hw/block/nvme: add tracing to nvme_map_prp hw/block/nvme: add request mapping helper hw/block/nvme: verify validity of prp lists in the cmb hw/block/nvme: refactor request bounds checking hw/block/nvme: add check for mdts hw/block/nvme: be consistent about zeros vs zeroes hw/block/nvme: add ns/cmd references in NvmeRequest hw/block/nvme: consolidate qsg/iov clearing hw/block/nvme: use preallocated qsg/iov in nvme_dma_prp hw/block/nvme: remove explicit qsg/iov parameters block/nvme.c | 4 +- hw/block/nvme.c | 506 +++++++++++++++++++++++++++--------------- hw/block/nvme.h | 4 +- hw/block/trace-events | 4 + include/block/nvme.h | 4 +- 5 files changed, 340 insertions(+), 182 deletions(-)