From patchwork Wed Mar 10 09:53:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 12127465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B590C433E0 for ; Wed, 10 Mar 2021 09:59:14 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BE7D064FBF for ; Wed, 10 Mar 2021 09:59:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE7D064FBF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJvcW-0001A4-BR for qemu-devel@archiver.kernel.org; Wed, 10 Mar 2021 04:59:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJvXQ-0007VY-VX; Wed, 10 Mar 2021 04:53:56 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJvXO-00052X-LX; Wed, 10 Mar 2021 04:53:56 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0D1C85C009C; Wed, 10 Mar 2021 04:53:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 10 Mar 2021 04:53:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:content-type:mime-version :content-transfer-encoding; s=fm2; bh=HhiXwAPEbFMN54eRAWxzMz8Z5+ QI7EakfDqoNkL62lo=; b=3z9K1H99pVvRrtONN2AhxKo6XL7MotUhUSnoDPWzeK SyrYw7Ss5jUQnByZvK7vNsuoGp1HCe55LdxoFrrBjUUBaTqdEZIAbS+GPX0LMePG R3pv2xZWCfgo5A5b9qJ80wXpFGFEf6n0l67BAcRRO6Ootua7V8Ff3GU7O4ISyhjb IlDixIz+XO0RV8YxBr0ab7CGTWQciOwQbOh1y4CbTl3N6lAnKmbzGvpM4s4Rp0RG pJpQNmlPmA//N4lB0drp9zRwWPFTT4moPfyXt8LmbiaPbSmuRd9Oh3dcuYStedOI KwZ12hSt/AVmHnC3RppcIH2rrF13jWwWsyupe5mCYATg== 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=fm2; bh=HhiXwA PEbFMN54eRAWxzMz8Z5+QI7EakfDqoNkL62lo=; b=G4zZ7OFs+N+wmNiKxe3Oi+ MGDxSmzPfwMWhl74xqkWbUFDMtOb0aLz1hWSiT+UrmTaWJe7iri5QaZ/YVDmIc4/ 1dBeUv3rvXQ8rqCn331JfvRi0xzF1DawTrWDf8ypjPlQFFrhm3Bj4Zt3yzO0rhOm Mffc5hhZc0wkDCfXb5o/edpgp4A2x1fIiOryAGKuaJAVgJJMX6m5mJzw4ItjcPgJ i4fRYvB/IGN30bb1HhEVSDvVyALBhl7vJuoT7xyb4DkuHZRApWtIKZ1GkW0wYNz6 j1eNsg8AAfB6jvzOx7Bmr3twSOxFPNKxE9KZznL5yKMh6LD84dUpW7oVXb9kwWsA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddukedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffotggggfesthhqredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhephfegveekiefgkeevvdetjeejkeekudfgvdehieejfffgkeffvdevlefftedvgefh necukfhppeektddrudeijedrleekrdduledtnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh 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 5625024005C; Wed, 10 Mar 2021 04:53:49 -0500 (EST) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v5 00/13] hw/block/nvme: metadata and end-to-end data protection support Date: Wed, 10 Mar 2021 10:53:34 +0100 Message-Id: <20210310095347.682395-1-its@irrelevant.dk> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.29; envelope-from=its@irrelevant.dk; helo=out5-smtp.messagingengine.com 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Gollu Appalanaidu , Max Reitz , Keith Busch , Stefan Hajnoczi , Klaus Jensen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This is v5 of a series that adds support for metadata and end-to-end data protection. First, on the subject of metadata, in v1, support was restricted to extended logical blocks, which was pretty trivial to implement, but required special initialization and broke DULBE. In v2, metadata is always stored continuously at the end of the underlying block device. This has the advantage of not breaking DULBE since the data blocks remains aligned and allows bdrv_block_status to be used to determinate allocation status. It comes at the expense of complicating the extended LBA emulation, but on the other hand it also gains support for metadata transfered as a separate buffer. The end-to-end data protection support blew up in terms of required changes. This is due to the fact that a bunch of new commands has been added to the device since v1 (zone append, compare, copy), and they all require various special handling for protection information. If potential reviewers would like it split up into multiple patches, each adding pi support to one command, shout out. Support for metadata and end-to-end data protection is all joint work with Gollu Appalanaidu. v5: * add a required fix for zone management receive when metadata is involved * add a couple of refactor patches for the zoned init code to make the format nvm patch more straight forward wrt. formatting of zoned namespaces. v4: * promoted from RFC * moved most eedp additions to nvme-dif.{c,h}. (Keith) v3: * added patch with Verify command * added patches for multiple LBA formats and Format NVM * changed NvmeSG to be a union (Keith) Gollu Appalanaidu (1): hw/block/nvme: add verify command Klaus Jensen (10): hw/block/nvme: fix zone management receive reporting too many zones hw/block/nvme: add metadata support hw/block/nvme: end-to-end data protection hw/block/nvme: add non-mdts command size limit for verify hw/block/nvme: prefer runtime helpers instead of device parameters hw/block/nvme: pull lba format initialization hw/block/nvme: parameterize nvme_ns_nlbas hw/block/nvme: remove invalid zone resource checks hw/block/nvme: move zoned constraints checks hw/block/nvme: split zone check/set geometry Minwoo Im (2): hw/block/nvme: support multiple lba formats hw/block/nvme: add support for the format nvm command hw/block/nvme-dif.h | 53 ++ hw/block/nvme-ns.h | 61 +- hw/block/nvme.h | 34 ++ include/block/nvme.h | 29 +- hw/block/nvme-dif.c | 508 +++++++++++++++++ hw/block/nvme-ns.c | 259 ++++++--- hw/block/nvme.c | 1267 +++++++++++++++++++++++++++++++++++++---- hw/block/meson.build | 2 +- hw/block/trace-events | 22 +- 9 files changed, 2018 insertions(+), 217 deletions(-) create mode 100644 hw/block/nvme-dif.h create mode 100644 hw/block/nvme-dif.c