From patchwork Tue Sep 22 08:45:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1368837 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=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm1 header.b=OYuoxtBk; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=Z/4pFjRQ; 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 4BwZgb03w2z9sSC for ; Tue, 22 Sep 2020 18:47:23 +1000 (AEST) Received: from localhost ([::1]:58554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKdxI-0005qa-OH for incoming@patchwork.ozlabs.org; Tue, 22 Sep 2020 04:47:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKdvh-0005mv-Rl; Tue, 22 Sep 2020 04:45:41 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:58671) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKdve-0000sa-DU; Tue, 22 Sep 2020 04:45:41 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id D89B85803C0; Tue, 22 Sep 2020 04:45:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 22 Sep 2020 04:45:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm1; bh=iyfc7acZGLQOgH27pF4waqX06L BeQe8tSacA8+qvrvg=; b=OYuoxtBklOjdoqF73NXMO4ToV5aHEzdMuINirMSN2C d/pTeyRhrLTulaHZuiEBQl5szNarMlqIMgeowa2up1tLxlbakqYG349WVjE/fNaI p5fUb4NL70dByl3CqJ0h0uCHzcaGFoaeoLh7+vgk+nyoxuETT2R4z76VcFMkbNW1 pASGzTDKjeBwlOt+v78Z5IUuhWNcSLzc9R3O9s3iGDKz4Civ9q8PJkHCuqhwGXeK 7c5oxZkLoTz/qF3OTpqeaMDGF916roncM+9NqjLikMHLRgJ6o1QGGoWXHLfklLhQ eYWYzGosE5qajVlDzbFzyRErLLUY0tzhL2FDctU3vg3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=iyfc7a cZGLQOgH27pF4waqX06LBeQe8tSacA8+qvrvg=; b=Z/4pFjRQTkg6WLAWEdjmJ9 rON8vT+Z6l9MWB/bIH5DHov9pqOH74/MS6xsssXlVNyfdA6IzcXylUnIcOnc+RlN WSXaeXK0lFuFPwED8ApLG75Tx5XFBgiP/lb0SV4mIW9heajmGhwX8kTAGccjxbYf fBtx9/jMDhD7klq7qyAgvq5SXbf/mzhh1/eD7kJ1QGQ8uQytsURWBETCgDSyC4e9 t9CscaF6vaqbFJGhIkFn+E7e6Sm/gkEsz4LVkcezPrH4ISxyN1I/7X9FgxQxHwEo pga/Tbe3uN3DfpjIzl16u3BFn0DUG0LI9x2+m39cEI9/BXjrGwPJ4xXCfCEssOwg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudeggddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofggtgfgsehtqhertdertdejnecuhfhrohhmpefmlhgruhhsucfl vghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtthgvrh hnpeefudehfedugffhuddttefffeeluedttdetgfduleduuddugfeuhfelueeuuefggfen ucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 15FF63064682; Tue, 22 Sep 2020 04:45:33 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v3 00/17] hw/block/nvme: multiple namespaces support Date: Tue, 22 Sep 2020 10:45:16 +0200 Message-Id: <20200922084533.1273962-1-its@irrelevant.dk> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.230; envelope-from=its@irrelevant.dk; helo=new4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 04:45:36 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-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: Kevin Wolf , Eduardo Habkost , qemu-block@nongnu.org, "Michael S. Tsirkin" , Klaus Jensen , Max Reitz , Keith Busch , Klaus Jensen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This is the next round of my patches for the nvme device. This includes a bit of cleanup and two new features: * support for scatter/gather lists * multiple namespaces support through a new nvme-ns device Finally, the series wraps up with changing the PCI vendor and device ID to get rid of the internal Intel id and as a side-effect get rid of some Linux kernel quirks that no longer applies. "pci: pass along the return value of dma_memory_rw" has already been posted by Philippe in another series, but since it is not applied yet, I am including it here. Changes for v3 ~~~~~~~~~~~~~~ * hw/block/nvme: handle dma errors Do not retry DMA, just set Controller Fatal Status (CFS). This causes the Linux kernel to most likely disable the controller when running the blktests block/011 test case, which causes some havoc when running blktests, but I have submitted a patch for blktests to fix this. (Keith) * hw/block/nvme: refactor aio submission Dropped the unneeded nvme_req_is_write function. (Keith) * Added R-b's from Keith and Philippe. Changes for v2 ~~~~~~~~~~~~~~ * Added a new patch ("hw/block/nvme: fix typo in trace event") that does what it says on the tin. * Dropped the "hw/block/nvme: support multiple parallel aios per request" patch (Keith). * hw/block/nvme: add symbolic command name to trace events Changed to single quote (Philippe) * hw/block/nvme: default request status to success Commit message typo fixed (Philippe) * hw/block/nvme: change controller pci id Do NOT bump the device id for the legacy Intel id (David) Gollu Appalanaidu (1): hw/block/nvme: add support for sgl bit bucket descriptor Klaus Jensen (16): hw/block/nvme: fix typo in trace event pci: pass along the return value of dma_memory_rw hw/block/nvme: handle dma errors hw/block/nvme: commonize nvme_rw error handling hw/block/nvme: alignment style fixes hw/block/nvme: add a lba to bytes helper hw/block/nvme: fix endian conversion hw/block/nvme: add symbolic command name to trace events hw/block/nvme: refactor aio submission hw/block/nvme: default request status to success hw/block/nvme: harden cmb access hw/block/nvme: add support for scatter gather lists hw/block/nvme: refactor identify active namespace id list hw/block/nvme: support multiple namespaces pci: allocate pci id for nvme hw/block/nvme: change controller pci id docs/specs/nvme.txt | 23 ++ docs/specs/pci-ids.txt | 1 + hw/block/nvme-ns.h | 74 ++++ hw/block/nvme.h | 83 +++- include/block/nvme.h | 6 +- include/hw/pci/pci.h | 4 +- hw/block/nvme-ns.c | 167 ++++++++ hw/block/nvme.c | 848 ++++++++++++++++++++++++++++++----------- hw/core/machine.c | 1 + MAINTAINERS | 1 + hw/block/meson.build | 2 +- hw/block/trace-events | 23 +- 12 files changed, 978 insertions(+), 255 deletions(-) create mode 100644 docs/specs/nvme.txt create mode 100644 hw/block/nvme-ns.h create mode 100644 hw/block/nvme-ns.c Reviewed-by: Keith Busch