From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286257245160.47587375876617; Fri, 3 Jun 2022 12:57:37 -0700 (PDT) Received: from localhost ([::1]:36764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDQO-0000jf-6z for importer2@patchew.org; Fri, 03 Jun 2022 15:57:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDN3-0005nv-Gw; Fri, 03 Jun 2022 15:54:09 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDN2-00087h-0G; Fri, 03 Jun 2022 15:54:09 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 18E113200956; Fri, 3 Jun 2022 15:54:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:06 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286044; x= 1654372444; bh=QBBj2njkfYxOiPtM3wOafH9doUoU2v/0tk/PMzEf2+I=; b=C 58zTJBrNktlq/VBpSj60Ml/L3IJcUzVauipMv79LdTfTU79/QJgHFm6uH/Sc0EI2 HXom/Scg2U1zBhJfDRCV/bbnDWaaHHVZchpsdwt1Xzdn1fp9OQf9cyKrJX50piBa fdhzS/nhwhSTiKyfxoL1AS1Urt8IKLzMI9b9Kp+/pqqId6kJ+lw2jB4McuvRcO1k Cej95d78wziHt5AMMD25rwPBVaxaRn/3KtsuChId/5mLTurobnxZTkGncp9aXLft ReyzHq2iZh1tLGKGsu+Ai7RCUsg4fWkknES4/gnSFOsPYLsJ1spp0Ho0gVtL0ACQ By0Ep3VV2ZrmY0ZIGGzIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286044; x=1654372444; bh=QBBj2njkfYxOi PtM3wOafH9doUoU2v/0tk/PMzEf2+I=; b=sfkBeOEQ+fMjcC6CkOqev5E+zUqhr 8HtyXST8Q/vQKA95tJJ5dA+yG3lzPEAj+8PBKInPo7u/0fsCtHIGhFMH/Dp/LwL1 GhG4khlbuk20J3Aw9C6szNoNussA3fpz3wk8CtXV35qvDN0MV0MyWkqm5rO78LwB 6UGoWOycE3EhF5H65Zi7SLlDfe9tNb3qzycx6uuWRnc0TbsR0G6VuikklMbsZOlL AJUJziRYsPo5DByjsH1Be6mahcZKW8es8SNqyzkyPuorl8/p+QyxOSiSv4T/Emmd DLkcEe4FJvf/+JL3w2VI4ZuXhxcNsO9d91xR9l4WAp9F4D5Ub9P4d6IaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Dmitry Tikhov , Klaus Jensen Subject: [PULL 01/11] hw/nvme: fix narrowing conversion Date: Fri, 3 Jun 2022 21:53:44 +0200 Message-Id: <20220603195354.705516-2-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286258915100001 Content-Type: text/plain; charset="utf-8" From: Dmitry Tikhov Since nlbas is of type int, it does not work with large namespace size values, e.g., 9 TB size of file backing namespace and 8 byte metadata with 4096 bytes lbasz gives negative nlbas value, which is later promoted to negative int64_t type value and results in negative ns->moff which breaks namespace Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 324f53ea0cd1..af6504fad2d8 100644 --- a/hw/nvme/ns.c +++ b/hw/nvme/ns.c @@ -29,7 +29,8 @@ void nvme_ns_init_format(NvmeNamespace *ns) { NvmeIdNs *id_ns =3D &ns->id_ns; BlockDriverInfo bdi; - int npdg, nlbas, ret; + int npdg, ret; + int64_t nlbas; =20 ns->lbaf =3D id_ns->lbaf[NVME_ID_NS_FLBAS_INDEX(id_ns->flbas)]; ns->lbasz =3D 1 << ns->lbaf.ds; @@ -42,7 +43,7 @@ void nvme_ns_init_format(NvmeNamespace *ns) id_ns->ncap =3D id_ns->nsze; id_ns->nuse =3D id_ns->ncap; =20 - ns->moff =3D (int64_t)nlbas << ns->lbaf.ds; + ns->moff =3D nlbas << ns->lbaf.ds; =20 npdg =3D ns->blkconf.discard_granularity / ns->lbasz; =20 --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286594593238.16484624070029; Fri, 3 Jun 2022 13:03:14 -0700 (PDT) Received: from localhost ([::1]:45344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDVp-0006ha-Iv for importer2@patchew.org; Fri, 03 Jun 2022 16:03:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDN9-0005sS-0m; Fri, 03 Jun 2022 15:54:16 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:47925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDN6-00088T-Ta; Fri, 03 Jun 2022 15:54:14 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id D1D643200942; Fri, 3 Jun 2022 15:54:09 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 Jun 2022 15:54:11 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286049; x= 1654372449; bh=Kb3lidWMLOT9NiWINfui1YYXH/mZrDt8OXR1JE6uz0k=; b=G 4BuNgujxtxCeh99NWQrmteumAEJLQOp5wqSEZx6JQZyorbjck/G6W8Ht8fLaBo1V A+VkoP0/TLASzzgKJIXzbj0Alb1De9PaAd411bc4TPRoTGoQAI95+Ru2hmyWo39u kzUbmqgQWoyh/evB8/Hwo5clhSAkcyGwFnWAqer9mbaRTwsFuNXxbuCNufH5tzZD MLvPdi9eqnUDyKviu50UOusfeSbPxE25BltjUQoVMGSoCgHntxGDNeSa5/1OEmb2 5pNsPNv4xETmklez7g1rBs+YhXLgj46QKo+3O+XaYhEggyFyHkjtzv7p9e7h8sI7 pV981MvbS7ayU5tkIrJ+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286049; x=1654372449; bh=Kb3lidWMLOT9N iWINfui1YYXH/mZrDt8OXR1JE6uz0k=; b=D+qGmMlEXuMlKHlp7awEprbzR7azD Ib5PKtci3U4Iz11WJyJ973gZ3D2gEWtYyazxawHAyWR4ER88mc/Fswd7cac4Q3da lS5kYiuruUxtQEe+wkPHLYoLTbTqH+BM3T51/w/IQqRtJmcsJFl7MNIWbNZ1dGhf 5yO5Uv4+ymbbh+L4mg8ONVIFbykmfcBSs/l1lIhSTVxA+3QWjlsep9RNf0ST4zmd kn7pJyrjDAe6LWWknkw1n6iB0F4L6sJN1nykcMiHmIKZxgrHw/Dgd1n0Ytb56wpP DSxtkUf8oT437FqiAcJ72TQ1vgOJ9RdYJ5vVjYDcW+mVaU2b4FV8+YAiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Dmitry Tikhov , Klaus Jensen Subject: [PULL 02/11] hw/nvme: add missing return statement Date: Fri, 3 Jun 2022 21:53:45 +0200 Message-Id: <20220603195354.705516-3-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286596696100003 Content-Type: text/plain; charset="utf-8" From: Dmitry Tikhov Since there is no return after nvme_dsm_cb invocation, metadata associated with non-zero block range is currently zeroed. Also this behaviour leads to segfault since we schedule iocb->bh two times. First when entering nvme_dsm_cb with iocb->idx =3D=3D iocb->nr and second because of missing return on call stack unwinding by calling blk_aio_pwrite_zeroes and subsequent nvme_dsm_cb callback. Fixes: d7d1474fd85d ("hw/nvme: reimplement dsm to allow cancellation") Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 03760ddeae8c..74540a03d518 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -2372,6 +2372,7 @@ static void nvme_dsm_md_cb(void *opaque, int ret) } =20 nvme_dsm_cb(iocb, 0); + return; } =20 iocb->aiocb =3D blk_aio_pwrite_zeroes(ns->blkconf.blk, nvme_moff(ns, s= lba), --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286244767964.9205900854486; Fri, 3 Jun 2022 12:57:24 -0700 (PDT) Received: from localhost ([::1]:36148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDQB-0000Fq-LS for importer2@patchew.org; Fri, 03 Jun 2022 15:57:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNC-0005uh-Sv; Fri, 03 Jun 2022 15:54:18 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:34803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNB-00088e-B2; Fri, 03 Jun 2022 15:54:18 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7BA9E320094E; Fri, 3 Jun 2022 15:54:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 03 Jun 2022 15:54:15 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:11 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286053; x= 1654372453; bh=uA3g6u/P3to6nNAaeQtZ+PajTiaKUfbgRMji4itvnIQ=; b=m CBGRN37iPZICaXXkiH516ShjxdHC5688oi1IhayC7bAzVdwzoIub//WoqsaCtvR6 UJgMaxJdELImctqEQXlR4eFOaq0GhFzj5E11S2pS76Vijcurzyb1ubLVTdXvx/JS vAjnU+YlBQpr9FNTmNGmnbjcqEDazmJBtZ4mcmati5szVT7On2hroU93zvp5V0pq ARk9ExLq2JrjYPVu3DjGCbLQ4JZTzCkfuJQ9cUtr1cOYvYX2oV3Ok3m+9w2KjXoW iSWz+pq6HoiQQVysbVHKXfk/Wl65T89keq3brCOqCUFKubWWj7OZchRLSbmaw/O5 6zDROUSgXy4dP+SLxHOcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286053; x=1654372453; bh=uA3g6u/P3to6n NAaeQtZ+PajTiaKUfbgRMji4itvnIQ=; b=tMCkBa/NR8O8qT3Cn3/xhNBBLQ1bP XDyWlJJ0/KaLlHT1AAly0bMsgyq5EATz8JuILDbR2EdOvlrEUXCrCW/MCw7R3aRQ 64w/kW3iiFflQepQIeCZOjI5yEsNfImZ+OS7/IrSy9l3I7ObcwGBVkeuirRcT6U9 +XgPE0/A/ZpXyEXjrPqiUWk3oetYPvm8ALWPNu1JDJisjdNL20jZvSQ/Hv4PnqkV dInh/exgHvquF7J71OMxxWcMm6y3ZiUdgjBu9RqfrYQNBQ3mvab5jrKVVhz6qJtL DkKuiOaDkQiSzNd5nYsw3JFzxD2kDBeq7RxAbGR3Dkr4aol/iy2xmvHhA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Dmitry Tikhov , Klaus Jensen Subject: [PULL 03/11] hw/nvme: fix copy cmd for pi enabled namespaces Date: Fri, 3 Jun 2022 21:53:46 +0200 Message-Id: <20220603195354.705516-4-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286246562100001 Content-Type: text/plain; charset="utf-8" From: Dmitry Tikhov Current implementation have problem in the read part of copy command. Because there is no metadata mangling before nvme_dif_check invocation, reftag error could be thrown for blocks of namespace that have not been previously written to. Signed-off-by: Dmitry Tikhov Reviewed-by: Klaus Jensen Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 74540a03d518..08574c4dcbc8 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -2787,6 +2787,10 @@ static void nvme_copy_in_completed_cb(void *opaque, = int ret) size_t mlen =3D nvme_m2b(ns, nlb); uint8_t *mbounce =3D iocb->bounce + nvme_l2b(ns, nlb); =20 + status =3D nvme_dif_mangle_mdata(ns, mbounce, mlen, slba); + if (status) { + goto invalid; + } status =3D nvme_dif_check(ns, iocb->bounce, len, mbounce, mlen, pr= infor, slba, apptag, appmask, &reftag); if (status) { --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286598912668.0046026649675; Fri, 3 Jun 2022 13:03:18 -0700 (PDT) Received: from localhost ([::1]:45422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDVt-0006kG-VX for importer2@patchew.org; Fri, 03 Jun 2022 16:03:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNH-0005xs-OJ; Fri, 03 Jun 2022 15:54:25 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:52501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNG-000895-5t; Fri, 03 Jun 2022 15:54:23 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 58E3A3200958; Fri, 3 Jun 2022 15:54:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:20 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286058; x= 1654372458; bh=wW5gFL/gfJnFS2/hmfyGz4hsdcQqlSYQJ7WqS1ZhXxU=; b=a iqLFS0xFi6PuJtz8wgOd1Aac8AIlp9Q0xtylN+te8IlFxnOHutQhS4O4D7SdgLsa zvo6NywFV4p/scDrLqhLF5gRw3CcVHQWIXMDTnkKvdGv6uo3v9lpPYsqaAOlCdWC ppGuc6s8YKS5Ld8oFUYhTMeYjmREb/6CIkavkfBLRfO6yXSCUZ7ov8/fhvo/j2wv ff+hz/RAZozl+CMsv+m9pytFD5iIu645hQS/7opMBQ4erCk2xgU82zcfU0zVMXvz iaFuGliHMThwas1AeOl9Tir5KfzJFwjgkDEpD82xKCbko33VZUBakHbVFn8L71oB V8ws0z50Vu8zAHCTMxjjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286058; x=1654372458; bh=wW5gFL/gfJnFS 2/hmfyGz4hsdcQqlSYQJ7WqS1ZhXxU=; b=L9SVCH9mIZz9th7cm5qQsZUdSRzLO 1NLiGoURZAtewodSJiihBKgn8Ey1MfaNUERevcJ5TmLsvr0cPeuBRB+FQ6SUJ4xF rG2dbdho9zSj2aBaNMOpmITi/s2RIzkmAH9ktL1n5L4cDScDPUsZxpe9N9WI4Oj0 favddstrKtbT2YNFRadvg3508FHkdHltff2z1LkePul8gyfGJWocMWueuUBaBm6n P8OpxNXvxxKoC6KCv7mep8xkKVJ5EhZyX3p9bWLhZEZNMC7YfJCdzFOcSgkW6aF2 lrZAqmVylD8q6xr3PUIm0ylxWioJQy+zRs22FT+ybrAgd8bjBS3xL89RA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , zhenwei pi Subject: [PULL 04/11] hw/nvme: fix smart aen Date: Fri, 3 Jun 2022 21:53:47 +0200 Message-Id: <20220603195354.705516-5-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286600991100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event(). Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting s= mart warning") Acked-by: zhenwei pi Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 08574c4dcbc8..a2f6069f7fe1 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeReq= uest *req) =20 if ((n->temperature >=3D n->features.temp_thresh_hi) || (n->temperature <=3D n->features.temp_thresh_low)) { - nvme_smart_event(n, NVME_AER_INFO_SMART_TEMP_THRESH); + nvme_smart_event(n, NVME_SMART_TEMPERATURE); } =20 break; --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165428659316048.797490246123175; Fri, 3 Jun 2022 13:03:13 -0700 (PDT) Received: from localhost ([::1]:45174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDVk-0006Yj-MO for importer2@patchew.org; Fri, 03 Jun 2022 16:03:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNN-0006A6-0v; Fri, 03 Jun 2022 15:54:30 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:37487) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNL-0008Ak-Dz; Fri, 03 Jun 2022 15:54:28 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 40A283200957; Fri, 3 Jun 2022 15:54:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:26 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286063; x= 1654372463; bh=twXrR4+kEWradYjllXM/BQhALki6oX/J6c6EC4q9/4c=; b=B gws57zIFxkqNiVMQHEKb1BZv+QcJZ0L7irEKgMOoyBweTFyU/3/pyZovfoPTm3lD 69mxGoTVYrLtP1vFsowDX+v4y9hTbQpoEe7hgBOKoHWvKa5F+kk3M4xtGmdaFBoP sg2wFh0HUWEgkrFOqwaJZDmeMCiu7wtMXs9AG96Tov/e8XRVEYpkDPgm80BlJz2P m9lDBCtZ2aK2NpF0o/L33iNA+TYPP3HjPrXAnRmMO9Iz9N7SUhg1SBdXy4t0pq6l sHwSQ9BFr9FC8Hl7ayTAAEjKuMVZqWX5wAhbl51gJyJm8NPUbAkjOccB24BEvGfr kr8Cn1lqQrTBsUk9KIzLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286063; x=1654372463; bh=twXrR4+kEWrad YjllXM/BQhALki6oX/J6c6EC4q9/4c=; b=UoFmC/HPUKq5OGgB+407eiNYFtgD0 CuXhxboBehQ/pTeoRXaEX0y38eyeaQKyE6CbV0HAYnPv348HJqGD3MXjCsyMrdrP JcMmzHFQUunvpki4CwZsHhrQorQE1zJfG3JjQhcpv+Cxyp3fcNpDY1APL1BNJ8XI WgUmA5SBMXeTPE3PZko6aNKFqgSmc4xVzQRCitkqTuWc6R2IyCsVKt4kaZVQTvID SDuQbxpr5z6egxbpegZ3gp5nQIPBERG+ZOdrGD002NgvIdcEEfdWa9XsTVhyUlOi n0hFcmY0xbxz8EsQ9HOsuU+tdx4x3htSUrlZTrP9ghefS/KyCJtK5UNig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , Christoph Hellwig Subject: [PULL 05/11] hw/nvme: enforce common serial per subsystem Date: Fri, 3 Jun 2022 21:53:48 +0200 Message-Id: <20220603195354.705516-6-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286594881100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen The Identify Controller Serial Number (SN) is the serial number for the NVM subsystem and must be the same across all controller in the NVM subsystem. Enforce this. Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 1 + hw/nvme/subsys.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/hw/nvme/nvme.h b/hw/nvme/nvme.h index 677381932569..e41771604f59 100644 --- a/hw/nvme/nvme.h +++ b/hw/nvme/nvme.h @@ -48,6 +48,7 @@ typedef struct NvmeSubsystem { DeviceState parent_obj; NvmeBus bus; uint8_t subnqn[256]; + char *serial; =20 NvmeCtrl *ctrls[NVME_MAX_CONTROLLERS]; NvmeNamespace *namespaces[NVME_MAX_NAMESPACES + 1]; diff --git a/hw/nvme/subsys.c b/hw/nvme/subsys.c index fb58d639504e..691a90d20947 100644 --- a/hw/nvme/subsys.c +++ b/hw/nvme/subsys.c @@ -27,6 +27,13 @@ int nvme_subsys_register_ctrl(NvmeCtrl *n, Error **errp) return -1; } =20 + if (!subsys->serial) { + subsys->serial =3D g_strdup(n->params.serial); + } else if (strcmp(subsys->serial, n->params.serial)) { + error_setg(errp, "invalid controller serial"); + return -1; + } + subsys->ctrls[cntlid] =3D n; =20 for (nsid =3D 1; nsid < ARRAY_SIZE(subsys->namespaces); nsid++) { --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286302284557.9719091142424; Fri, 3 Jun 2022 12:58:22 -0700 (PDT) Received: from localhost ([::1]:37664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDR7-0001Le-3x for importer2@patchew.org; Fri, 03 Jun 2022 15:58:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNS-0006K6-PK; Fri, 03 Jun 2022 15:54:35 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:36773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNQ-0008B6-2S; Fri, 03 Jun 2022 15:54:34 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 34528320095E; Fri, 3 Jun 2022 15:54:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 Jun 2022 15:54:30 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286068; x= 1654372468; bh=nG2SVVbNuLoH8KS/Dk9AeoHCWBYlTxx/9iwCVlaBHSg=; b=Y 67ciQhELbAxq0Rf0WOigF8Uxqqh8jT4tXuNVsPxqH8myhZwreG0vma0P30o25WNT greXnhvru4hLwpoSXgmk75ExaLDLhDKv8p1oDN9Nd/Kwqk9qBv9jlBi4TLKdY4kO YKUx/hNsdx4HMkcCpVP0/mG5zI7qcme9wNG9z8tkEgBPV5jdaiC4AriW9uOPDCiw mccHOjQXDiovYFHTIAnj8EH9XaFA2Pl8FaRZ0WvtPNFgmneqPcqDaz6buy+1aP37 /b5lbZY+KdyiCiST4alNyjfVZ4MRfb+N8Uo+BAa9SWtNEZ0twBUjDxgLUmLgkL4k fEw+VkTLGOye8xsLfJ5Pw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286068; x=1654372468; bh=nG2SVVbNuLoH8 KS/Dk9AeoHCWBYlTxx/9iwCVlaBHSg=; b=MQnZzwF33j/Lu7mchNd9lftWhgogC c2jxdzctG59mP6K2mqKu9w1Wu2tetB3NG1FqvHu4rImtfNBpMvaORL4ghRC+1HWt ITuKPDOEOy5vtXA2vnXg3Mq6l2D5NhqSrAhGXE//npqSPfqB8VtLbYeTLzoTkjJd 3vzPHiVlEXRucHcf65eC3fN4+qtkWBF1a+obZOH0dRj+EwHoIV2AZb8YhidkoB5X l7fgVVikbJ2Rmg0Xah4WuwzGL8iJDAMY11MUeLPxZSxPM5oUG9RuewSZ3qKgybTr eYcQAz0WHNmXp2GzIkNX3akw6gSUJNdLiAW4HULCdZxtRCbIePnslcpfQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , Christoph Hellwig Subject: [PULL 06/11] hw/nvme: do not auto-generate eui64 Date: Fri, 3 Jun 2022 21:53:49 +0200 Message-Id: <20220603195354.705516-7-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286304448100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen We cannot provide auto-generated unique or persistent namespace identifiers (EUI64, NGUID, UUID) easily. Since 6.1, namespaces have been assigned a generated EUI64 of the form "52:54:00:". This is will be unique within a QEMU instance, but not globally. Revert that this is assigned automatically and immediately deprecate the compatibility parameter. Users can opt-in to this with the `eui64-default=3Don` device parameter or set it explicitly with `eui64=3DUINT64`. Cc: libvir-list@redhat.com Reviewed-by: Christoph Hellwig Signed-off-by: Klaus Jensen --- docs/about/deprecated.rst | 7 +++++++ hw/core/machine.c | 1 + hw/nvme/ns.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e19bcba24240..47a8628b5601 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -296,6 +296,13 @@ contains native support for this feature and thus use = of the option ROM approach is obsolete. The native SeaBIOS support can be activated by using ``-machine graphics=3Doff``. =20 +``-device nvme-ns,eui64-default=3Don|off`` (since 7.1) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In QEMU versions 6.1, 6.2 and 7.0, the ``nvme-ns`` generates an EUI-64 +identifer that is not globally unique. If an EUI-64 identifer is required,= the +user must set it explicitly using the ``nvme-ns`` device parameter ``eui64= ``. + =20 Block device options '''''''''''''''''''' diff --git a/hw/core/machine.c b/hw/core/machine.c index bb0dc8f6a93d..c53548d0b138 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -43,6 +43,7 @@ =20 GlobalProperty hw_compat_7_0[] =3D { { "arm-gicv3-common", "force-8-bit-prio", "on" }, + { "nvme-ns", "eui64-default", "on"}, }; const size_t hw_compat_7_0_len =3D G_N_ELEMENTS(hw_compat_7_0); =20 diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index af6504fad2d8..06a04131f192 100644 --- a/hw/nvme/ns.c +++ b/hw/nvme/ns.c @@ -641,7 +641,7 @@ static Property nvme_ns_props[] =3D { DEFINE_PROP_SIZE("zoned.zrwas", NvmeNamespace, params.zrwas, 0), DEFINE_PROP_SIZE("zoned.zrwafg", NvmeNamespace, params.zrwafg, -1), DEFINE_PROP_BOOL("eui64-default", NvmeNamespace, params.eui64_default, - true), + false), DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165428679814795.38468455509303; Fri, 3 Jun 2022 13:06:38 -0700 (PDT) Received: from localhost ([::1]:53332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDZ6-0003lC-Le for importer2@patchew.org; Fri, 03 Jun 2022 16:06:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNW-0006V2-Ab; Fri, 03 Jun 2022 15:54:38 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:48699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNU-0008BR-Pz; Fri, 03 Jun 2022 15:54:38 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id DDAAA3200953; Fri, 3 Jun 2022 15:54:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:35 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286073; x= 1654372473; bh=Cd7INMBLuY9KTFyd/Zs/QQw6R9xcWyFf4pF78s2B6GU=; b=Z srASI7JUsE8tOBJNVVhc7GaEbh4TBuu0z4OFNtC43pT0IVssk1w9VoFDJYks+XTT Xd2mArlvW7X8NOVmf24vl+drUFW3a6nZXcyhp+KuApFVV3VvDTu0no6SMR8PId/3 D9arDRmD447Ozoqb6y7aSCZaXkYfIznNG97kxd0UKKrCsFgDISAlZz/FiWws552d 5L5/IQTd48muFL6pn00x/Yx+kdPL+Cc/CsTZnUZqAXoLA9s6zVc1v7H0WHV15voa yhl2tNqZs/Bp89xu068BebYvrh/QE0tzTBdCKeGCtpwF5iVZAMdtgtwqOzSgXkrf b3gUZHpWNr9u+ENjuzt2g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286073; x=1654372473; bh=Cd7INMBLuY9KT Fyd/Zs/QQw6R9xcWyFf4pF78s2B6GU=; b=zZ6AlW3Xg3NM/TcSwV78QHSge3M/j kDQvtYqMo35mDLF+aMgwLatGzKJzV3/3YFjZ4cOVnXJIGCb1uup6/wRGe1ioUoQ7 ZecJAVAJG/ULwgSfzA4C1mWE4+jqHAWhhVhnNCZxfrdp5fVVaeLoGNhnE+A/n1Sb T3zN5VUu05TTo81C6aOOzxftF+XbW78Q9oK75BcEzkOY+3b0BafC4OucTy04h59s 2QWaA5L6aJ5mXUhzZed/+ED0MBozw6bawDJO7Bnjb/Knba124NqpLXxSzgCavm5X YCqUyfWW3AW3gWQENJqCEYlU7b91RKtxaKi7JT+qj91D6gNLB0nQTxFNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , Christoph Hellwig Subject: [PULL 07/11] hw/nvme: do not auto-generate uuid Date: Fri, 3 Jun 2022 21:53:50 +0200 Message-Id: <20220603195354.705516-8-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286800982100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Do not default to generate an UUID for namespaces if it is not explicitly specified. This is a technically a breaking change in behavior. However, since the UUID changes on every VM launch, it is not spec compliant and is of little use since the UUID cannot be used reliably anyway and the behavior prior to this patch must be considered buggy. Reviewed-by: Keith Busch Reviewed-by: Christoph Hellwig Signed-off-by: Klaus Jensen --- hw/nvme/ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c index 06a04131f192..1b9c9d11567f 100644 --- a/hw/nvme/ns.c +++ b/hw/nvme/ns.c @@ -614,7 +614,7 @@ static Property nvme_ns_props[] =3D { DEFINE_PROP_BOOL("detached", NvmeNamespace, params.detached, false), DEFINE_PROP_BOOL("shared", NvmeNamespace, params.shared, true), DEFINE_PROP_UINT32("nsid", NvmeNamespace, params.nsid, 0), - DEFINE_PROP_UUID("uuid", NvmeNamespace, params.uuid), + DEFINE_PROP_UUID_NODEFAULT("uuid", NvmeNamespace, params.uuid), DEFINE_PROP_UINT64("eui64", NvmeNamespace, params.eui64, 0), DEFINE_PROP_UINT16("ms", NvmeNamespace, params.ms, 0), DEFINE_PROP_UINT8("mset", NvmeNamespace, params.mset, 0), --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165428680839116.608560216434398; Fri, 3 Jun 2022 13:06:48 -0700 (PDT) Received: from localhost ([::1]:54010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDZH-0004JR-7f for importer2@patchew.org; Fri, 03 Jun 2022 16:06:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNc-0006h1-JO; Fri, 03 Jun 2022 15:54:44 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:43129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNZ-0008C7-JL; Fri, 03 Jun 2022 15:54:43 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A362C320094F; Fri, 3 Jun 2022 15:54:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 03 Jun 2022 15:54:40 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286078; x= 1654372478; bh=z/L9OSPPnR3dL47BmyRviirXZ57IMkZ4Gb5vJuB4fvQ=; b=C fkMTOXM7i7GSzzsW4gg+ldRTbGiatDX+7unXIOxA65h+rp3LWQKqzD42AD9hOhFI oyRwBFxNM2Lml5wGUuOtM4OqEJRWvYmv9HayLaj8pNMQ5xpYoLlpwjBVPiD7/FGk tLe/r4aFN50E24dkA0WOO0SuAI4PuS+6bv2F6z7v6Z5kuHqR1ksyjI75oQnPIM6R bun9BTiOlp43aNj+uGmFqI+SheuwN5J6z9w7oIE1RRNSto1jzWjTg1IqbXN4wtJA CO3UnU02Q081YLMZbgJQfDMIaAQnecJjV5fkEdZ6tq9aC8JeMCmHfZuLy1XeeZ3h 7ZcjuE9g4VH0frEoNd2ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286078; x=1654372478; bh=z/L9OSPPnR3dL 47BmyRviirXZ57IMkZ4Gb5vJuB4fvQ=; b=lMCunqPTHyFT02YKj0mJaMQBnHfHl yNCeze46eFYap4OO6AnP5vbwDBMJx0Cas1hO7P4UEnEXv00Qf9d+UvA4WOtOh9wU LDdu/Vg6y476tAQvhS4S2GLDLKa90zBjefssglhIBwssMCFc28zQaLMH41Sh7VmT iqjDeGggJbyv/+TSW6Gke9svsPUcBmG85FlMaSL04RztdQ1yK1S4vHkurTBzxd/r RSXEPHHdunfhxLVBDgyqqTirDg9mCYRMdc5Hk00HSie+uCsbeLtbMFdCRj+UeYHx XL+fpFOY71U9LPDka25t6uxR2tvIqI/zYGRoVTXaDKfkr0CTyzimM3vHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepgffgtdelffetleetieevgfdtvdeuiefgheegveeujeeufefhieekfeetgeev ieeunecuffhomhgrihhnpehuuhhiugdruggrthgrnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen , Luis Chamberlain , Christoph Hellwig Subject: [PULL 08/11] hw/nvme: do not report null uuid Date: Fri, 3 Jun 2022 21:53:51 +0200 Message-Id: <20220603195354.705516-9-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286808998100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen Do not report the "null uuid" (all zeros) in the namespace identification descriptors. Reported-by: Luis Chamberlain Reported-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index a2f6069f7fe1..909e357a7eb9 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -4955,16 +4955,13 @@ static uint16_t nvme_identify_ns_descr_list(NvmeCtr= l *n, NvmeRequest *req) return NVME_INVALID_FIELD | NVME_DNR; } =20 - /* - * If the EUI-64 field is 0 and the NGUID field is 0, the namespace mu= st - * provide a valid Namespace UUID in the Namespace Identification Desc= riptor - * data structure. QEMU does not yet support setting NGUID. - */ - uuid.hdr.nidt =3D NVME_NIDT_UUID; - uuid.hdr.nidl =3D NVME_NIDL_UUID; - memcpy(uuid.v, ns->params.uuid.data, NVME_NIDL_UUID); - memcpy(pos, &uuid, sizeof(uuid)); - pos +=3D sizeof(uuid); + if (!qemu_uuid_is_null(&ns->params.uuid)) { + uuid.hdr.nidt =3D NVME_NIDT_UUID; + uuid.hdr.nidl =3D NVME_NIDL_UUID; + memcpy(uuid.v, ns->params.uuid.data, NVME_NIDL_UUID); + memcpy(pos, &uuid, sizeof(uuid)); + pos +=3D sizeof(uuid); + } =20 if (ns->params.eui64) { eui64.hdr.nidt =3D NVME_NIDT_EUI64; --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286998026652.4170934062755; Fri, 3 Jun 2022 13:09:58 -0700 (PDT) Received: from localhost ([::1]:60204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDcK-0008Ti-Kk for importer2@patchew.org; Fri, 03 Jun 2022 16:09:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNj-0006zG-Cf; Fri, 03 Jun 2022 15:54:51 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:49017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNe-0008CV-LO; Fri, 03 Jun 2022 15:54:51 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D4C803200972; Fri, 3 Jun 2022 15:54:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 03 Jun 2022 15:54:45 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286083; x= 1654372483; bh=bTDlsCpksBW533JoUBpw5+Erirf7Qt/s3d7AZz+W1ZE=; b=o xM/ha0dDfP6w3BzcD0p9Zv0eIVvO7tIkgd/MDf/A5MwHPx0U4oZ43m3j2uA99edV rL5JNs9ym+l31+LBLkJOpx92RQMbhkf2E5URfT+CB1hOuj3x9OdTVWU+8xF+s/pA BitSGOopr/7c0T/4zkDJyLlYDHy4nxnGX0muP6FSmcCgdmJhKGHJ1d/bkqaSrbtq Cy4mHVYoUc6E/rxad2eAzTLPChbJhaI++K7hkevnu7n1Z2fCOGdFsiraFZRwTK+D X1Tkpq5tthENU1SXYj+kwv4sf33P6Tmag4B6ynTu5GcW5S/msSkiMfeesOIhBMZO yhqei4k1cjixDjSlWTZZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1654286083; x=1654372483; bh=bTDlsCpksBW53 3JoUBpw5+Erirf7Qt/s3d7AZz+W1ZE=; b=O1WPSKejreWhE+4m220CXgQoE2Pbc udOBQqLjA+UYTldZTO77IvTsx2Ki68o5kNn/AzAdzDW9ieWplxVVERyB2LUYnh1L C/hlpAyD0oh3OH2jVFr49Qjk4ffDfisge0UbQvaHvE+xn9cB/S3ImjzqvVt/zjaI nvQtV69kx06+3c+tX5Y6DVJnOLy14y5s4SRQ11XPCDEhwiiM3hQWOJpDSSHpr9qb LzT96q00eqbwtsHvSzJbs/75Cs3c0IaCvsmLs69qH/7QdssmFJbqcZ4SJZoCYZxC 7KIVGAnE6xVlS+H3HcxOtOVheOHulz0bRULuMwbFXsKtVVv/LOpnmLScw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen Subject: [PULL 09/11] hw/nvme: bump firmware revision Date: Fri, 3 Jun 2022 21:53:52 +0200 Message-Id: <20220603195354.705516-10-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286999582100001 Content-Type: text/plain; charset="utf-8" From: Klaus Jensen The Linux kernel quirks the QEMU NVMe controller pretty heavily because of the namespace identifier mess. Since this is now fixed, bump the firmware revision number to allow the quirk to be disabled for this revision. As of now, bump the firmware revision number to be equal to the QEMU release version number. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 909e357a7eb9..1e6e0fcad918 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -6713,7 +6713,7 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pc= i_dev) id->vid =3D cpu_to_le16(pci_get_word(pci_conf + PCI_VENDOR_ID)); id->ssvid =3D cpu_to_le16(pci_get_word(pci_conf + PCI_SUBSYSTEM_VENDOR= _ID)); strpadcpy((char *)id->mn, sizeof(id->mn), "QEMU NVMe Ctrl", ' '); - strpadcpy((char *)id->fr, sizeof(id->fr), "1.0", ' '); + strpadcpy((char *)id->fr, sizeof(id->fr), QEMU_VERSION, ' '); strpadcpy((char *)id->sn, sizeof(id->sn), n->params.serial, ' '); =20 id->cntlid =3D cpu_to_le16(n->cntlid); --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654287116341636.4096487853344; Fri, 3 Jun 2022 13:11:56 -0700 (PDT) Received: from localhost ([::1]:34650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDeF-000250-8g for importer2@patchew.org; Fri, 03 Jun 2022 16:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNm-00074D-RZ; Fri, 03 Jun 2022 15:54:54 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:54867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNj-0008Cv-7M; Fri, 03 Jun 2022 15:54:54 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 4F6A7320096B; Fri, 3 Jun 2022 15:54:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 03 Jun 2022 15:54:49 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286087; x= 1654372487; bh=XjAUVaZOs6cVxQitSF42MMUPvVUHVcKYxbYsxg8fDLo=; b=E gJ4gd0N1gIrVrJtyAvSrv+x15vMsgI3iqRew3qkWGrQdVKMUfMYh27dd13NFS3S2 Cu1DotP/DfB4gBLqLDKO+i5OSk2pIeZhU4ga+hcRsYo/jHe5iEScoQV14ZIX7f+5 FFoEojzoJMzllOyExX/XfSd3ZtGjUyP1Fo7ptXwwdaN5z0Hx7+KUD+0ZMOITwcy3 57pjjoTI2+ECV2ERjHP1g7bOt/s+4yz21hsfFfDczs0Q5isgH+tkE2pZ14kWmeX+ fLuLHRApjjsu2d8aQTzDfutYh/nR7g70xtgWHnvixU4mQ6JGhmdM7i4WW9kcr8fp PA9I9O8PxeGW/PPhdRZ3g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1654286087; x= 1654372487; bh=XjAUVaZOs6cVxQitSF42MMUPvVUHVcKYxbYsxg8fDLo=; b=x OdokhScowL82bV/NCOhQpxmabT8L9N4B5MzarPRgFlzSnDCCUCEGNDDsCHMZerQ+ XAc1ud/7ABvBT2Zc4iWM8oCjXdSjm9clBp3WJ8va4MiB0KCf+5BtZEGivrcmrRAU NHW4fSHuEVScGX37tQVoJyEhlrhF7pfwCAnoTGFxJc0cjb7qbzgdBRvpOI2f0X4j nk2qM84lByUXMyPYQgtteaZkcKvuRQVOhPK80JDmnv8sFrjMbXbxjhI2+lR/J3qQ 896VImGyKBOIR482Wrijvd0zuCAk1L+g6hyDycv9qEMnnf9a8Hj1JxPanXIUtG5K w9+t6l9EDopm1XuPKxt+Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefmlhgr uhhsucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrg htthgvrhhnpeefvedtueetueduffevgffgtdeftdeuleffhfeigeffkeegfeejfeffteej iefhvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Klaus Jensen Subject: [PULL 10/11] hw/nvme: deprecate the use-intel-id compatibility parameter Date: Fri, 3 Jun 2022 21:53:53 +0200 Message-Id: <20220603195354.705516-11-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654287118122100001 From: Klaus Jensen Since version 5.2 commit 6eb7a071292a ("hw/block/nvme: change controller pci id"), the emulated NVMe controller has defaulted to a non-Intel PCI identifier. Deprecate the compatibility parameter so we can get rid of it once and for all. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Klaus Jensen --- docs/about/deprecated.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 47a8628b5601..aa2e32020707 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -303,6 +303,14 @@ In QEMU versions 6.1, 6.2 and 7.0, the ``nvme-ns`` gen= erates an EUI-64 identifer that is not globally unique. If an EUI-64 identifer is required,= the user must set it explicitly using the ``nvme-ns`` device parameter ``eui64= ``. =20 +``-device nvme,use-intel-id=3Don|off`` (since 7.1) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ``nvme`` device originally used a PCI Vendor/Device Identifier combina= tion +from Intel that was not properly allocated. Since version 5.2, the control= ler +has used a properly allocated identifier. Deprecate the ``use-intel-id`` +machine compatibility parameter. + =20 Block device options '''''''''''''''''''' --=20 2.36.1 From nobody Fri Apr 19 04:16:11 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654286633482482.2883550347867; Fri, 3 Jun 2022 13:03:53 -0700 (PDT) Received: from localhost ([::1]:46496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxDWS-0007SI-Fl for importer2@patchew.org; Fri, 03 Jun 2022 16:03:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNq-0007Eo-Fc; Fri, 03 Jun 2022 15:54:59 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:54219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxDNo-0008DF-Pz; Fri, 03 Jun 2022 15:54:58 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D50EB320096D; Fri, 3 Jun 2022 15:54:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 03 Jun 2022 15:54:54 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jun 2022 15:54:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1654286092; x= 1654372492; bh=4one0BcLs904Z7IHHedCkaTbGDZICC0tN5jiBZUvycY=; b=W 8GkYwO/visLBnZhUHjp8oAHwcv6YHM/JtTRV2koVrw+I4KAiLOCM6GBSfS9txrBg sE3UGl0r20Uxovm3gCGa++RI8lRQF5G1Rqr3Elc0KbLEZMGSRfnA43eKh72ruRCg h1uaW0FJ3s+32tFBmhjkjgYASBn6T3rzEVZ3xER8cV5Nd+mJt706s8Zm7zMY8yxz 1kus3A/wuAhbUufzakGDZ/Kv8isqREg11YuIHsH4Q6a9L8dirTvkZzQOEJOtR7Ay Dqq6o+NHCFgZknlyljrdysyVEb/yrQZWBRhyNqrTSzZZnYzRDZkXzQf1Uccgd1GC MdkhZcp1Bcw11s/GP9anQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1654286092; x= 1654372492; bh=4one0BcLs904Z7IHHedCkaTbGDZICC0tN5jiBZUvycY=; b=E BGpHhIhxtUpg86TplLFzD8IFBLezxW/nALr6+0NLJccY50sW6+bzVlh43aowlmmm 1rAMhG5vLXbkwFp04Juztr3Da7xsoQ+qhp8caijYznYR5qjQZ8wNte4Bq9tR0Hxk 65bHhvIaFIUgY5XwYBSVyaPIy0tM8WT+arvR+sEujmaMPvoCM4PaLuzBBTFy96dw 4Osszx7O+MKJHWq1hh9Tjy9o8Csc60DW7zVTvC88D1zEEP6wzTtzHY5csVQBwW1c myiM+QvMtuJqWnQxqjPh5hr8r3BRapH0a3+xmkYIWbBl2aaYz1T8YV15+fN4I8s4 v5ChCcZpfFv4nt22QQncg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrleeigddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefmlhgr uhhsucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrg htthgvrhhnpeefvedtueetueduffevgffgtdeftdeuleffhfeigeffkeegfeejfeffteej iefhvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Yanan Wang , Hanna Reitz , Eduardo Habkost , Marcel Apfelbaum , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fam Zheng , Stefan Hajnoczi , qemu-block@nongnu.org, Klaus Jensen , Keith Busch , Kevin Wolf , Dmitry Tikhov , Klaus Jensen Subject: [PULL 11/11] hw/nvme: add new command abort case Date: Fri, 3 Jun 2022 21:53:54 +0200 Message-Id: <20220603195354.705516-12-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603195354.705516-1-its@irrelevant.dk> References: <20220603195354.705516-1-its@irrelevant.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.24; envelope-from=its@irrelevant.dk; helo=wout1-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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1654286634851100001 From: Dmitry Tikhov NVMe command set specification for end-to-end data protection formatted namespace states: o If the Reference Tag Check bit of the PRCHK field is set to =E2=80=98= 1=E2=80=99 and the namespace is formatted for Type 3 protection, then the controller: =E2=96=AA should not compare the protection Information Reference= Tag field to the computed reference tag; and =E2=96=AA may ignore the ILBRT and EILBRT fields. If a command is aborted as a result of the Reference Tag Check bit of the PRCHK field being set to =E2=80=981=E2=80=99, then that command= should be aborted with a status code of Invalid Protection Information, but may be aborted with a status code of Invalid Field in Command. Currently qemu compares reftag in the nvme_dif_prchk function whenever Reference Tag Check bit is set in the command. For type 3 namespaces however, caller of nvme_dif_prchk - nvme_dif_check does not increment reftag for each subsequent logical block. That way commands incorporating more than one logical block for type 3 formatted namespaces with reftag check bit set, always fail with End-to-end Reference Tag Check Error. Comply with spec by handling case of set Reference Tag Check bit in the type 3 formatted namespace. Fixes: 146f720c5563 ("hw/block/nvme: end-to-end data protection") Signed-off-by: Dmitry Tikhov Signed-off-by: Klaus Jensen --- hw/nvme/dif.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/nvme/dif.c b/hw/nvme/dif.c index 62d885f83ea4..63c44c86ab55 100644 --- a/hw/nvme/dif.c +++ b/hw/nvme/dif.c @@ -26,6 +26,11 @@ uint16_t nvme_check_prinfo(NvmeNamespace *ns, uint8_t pr= info, uint64_t slba, return NVME_INVALID_PROT_INFO | NVME_DNR; } =20 + if ((NVME_ID_NS_DPS_TYPE(ns->id_ns.dps) =3D=3D NVME_ID_NS_DPS_TYPE_3) = && + (prinfo & NVME_PRINFO_PRCHK_REF)) { + return NVME_INVALID_PROT_INFO; + } + return NVME_SUCCESS; } =20 --=20 2.36.1