From patchwork Wed Oct 21 22:17:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 302315 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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no 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 18EF3C4363A for ; Wed, 21 Oct 2020 22:21:24 +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 0FF5A241A3 for ; Wed, 21 Oct 2020 22:21:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FF5A241A3 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]:58940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVMTx-0008Vz-FH for qemu-devel@archiver.kernel.org; Wed, 21 Oct 2020 18:21:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVMQV-00077P-OB; Wed, 21 Oct 2020 18:17:47 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:51001) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVMQS-000057-AX; Wed, 21 Oct 2020 18:17:47 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 6C8E71264; Wed, 21 Oct 2020 18:17:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 21 Oct 2020 18:17:41 -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-transfer-encoding; s=fm1; bh=E+NiYjeA3qOq8nyqEXnp4jxKdW 6IUjZVLq1wtm2Wx3c=; b=HYJQvCbOpNSrGRTI1SVb2f6tPIK9TkNWjiB7jGa7uo NQDSKdpChIHDd4VIzSjXlDq1J4Vw4Lo6xOF9gN5kbEFzetgmHJSW7iIGYblyb05s 460sZucsP6nhVu+CUty6d/wEj8lIlPpgQSU4NmBL5zBLVxtyflP8BfunHYCkbEZU CHMtot9qQ4fIr9Tbl468YOE/8F0/X/2ogD8ZY40TO22Dl3z4KoCD4n3sFYhkE1Hd mOHkE5ZXBaaOywGCp4uRDv1zpMTI0xLuusXenScXbX/A4CJXWwPAp7SNOLxrszwY ih7GgKg0IZw/A4mwRLmZpBLeknBpUs+fRTPfrwz5IWIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=E+NiYjeA3qOq8nyqE Xnp4jxKdW6IUjZVLq1wtm2Wx3c=; b=Ae4l1gUdrajR9gpne0XdmGwxeUU/Jn0xf egTOWioT1SAUcSE3ocUVJ+1KOn21FGwlz2RWK5GtZCFGG8TvJEv8G7/mQdLKmtpE L0upYMGvwaILjl0qU5PYEJTxStJGsjLFwTW4BAyjb7yDRqwjH1dM6Fre11PSMUCb Zx2hngOfwXn2QbTkes3TrL8BPYtmiyUfhq+PaRyTy9lgwGwQdHWdX4qvIW3v6QKr dmZaOiQIn97f7wb2U2CKQTc33O8cgYBgqEqp7DgjbHxqIE3k0EIb+S1bzQ3rnimt zAMdqUFf1zlw+ABmD/g99p+yckEoDiuKENH7Doj6AWjoq/du7LuRA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrjeeigddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdhqredtredttdenucfhrhhomhepmfhlrghushculfgv nhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvghrnh ephfejffdvtdeufeekleelteetudffhfeliedtvdegudduffdtueffkefgueegtdeunecu ffhomhgrihhnpehirhhrvghlvghvrghnthdrughknecukfhppeektddrudeijedrleekrd duledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep ihhtshesihhrrhgvlhgvvhgrnhhtrdgukh 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 116043064682; Wed, 21 Oct 2020 18:17:38 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v3 0/2] hw/block/nvme: dulbe and dsm support Date: Thu, 22 Oct 2020 00:17:34 +0200 Message-Id: <20201021221736.100779-1-its@irrelevant.dk> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.21; envelope-from=its@irrelevant.dk; helo=wout5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 18:17:42 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, RCVD_IN_MSPIKE_H2=-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: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Keith Busch , Klaus Jensen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen This adds support for the Deallocated or Unwritten Logical Block error recovery feature as well as the Dataset Management command. I wanted to add support for the NPDG and NPDA fields such that the host could get a hint on how many blocks to request deallocation of for the deallocation to actually happen, but I cannot find a realiable way to get the actual block size of the underlying device. If it is an image on a file system we could typically use the host page size, but if it is a raw device, we might have 512 byte sectors that we can issue discards on. And QEMU doesn't seem to provide this without root privileges at least. See the two patches for some gotchas. I also integrated this into my zoned proposal. I'll spare you the v4, nobody cares anyway. But I put it in my repo[1] for posterity. [1]: https://irrelevant.dk/g/pci-nvme.git/tag/?h=zoned-v4. Klaus Jensen (2): hw/block/nvme: add dulbe support hw/block/nvme: add the dataset management command hw/block/nvme-ns.h | 4 + hw/block/nvme.h | 2 + include/block/nvme.h | 5 ++ hw/block/nvme-ns.c | 8 +- hw/block/nvme.c | 179 +++++++++++++++++++++++++++++++++++++++++- hw/block/trace-events | 4 + 6 files changed, 197 insertions(+), 5 deletions(-) -- 2.28.0