From nobody Mon Feb 9 11:30:40 2026 Delivered-To: importer@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+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1615292512; cv=none; d=zohomail.com; s=zohoarc; b=Pyd9LgfF62W06LvvniJWGhGAz56ZbwzTg4e8s2KCy58WLaCDto9Tu3DIsKp87uSWHu8gvCdA5lxucmlNKqe0fTur05hjJZfZllO268QuGI82VjPaUW8mtbLsVBOx9KTc/XhsCzq5in7Lexank7vWM0uKsMYocG//zPopXgAN0p4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615292512; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6tUgHYgUp2ybC6UX/X0aIvrDkDk1L72fYFBNNAan4Kc=; b=KAL2DM7fM0B/S2mBI0z0cVnxXS/dS6PJGnFSL61VU1JhhnZwCPFDfFHLSaTB/5FFyZPMy13kHqGmeyY/oHtQNV/MldA2EP9DltOI6NhUt8imIQ6zaIcLgIV5pUYQzCHqyvomlisLw/9R6kzxzSQohUkv9iwjdUcPwukgud9iHG8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=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 1615292512708494.9211256935297; Tue, 9 Mar 2021 04:21:52 -0800 (PST) Received: from localhost ([::1]:50196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJbN1-000607-FW for importer@patchew.org; Tue, 09 Mar 2021 07:21:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJao6-00006z-63; Tue, 09 Mar 2021 06:45:46 -0500 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:36413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJao3-0000Rx-Ja; Tue, 09 Mar 2021 06:45:45 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 5F6EA2777; Tue, 9 Mar 2021 06:45:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 09 Mar 2021 06:45:42 -0500 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 71DEA240054; Tue, 9 Mar 2021 06:45:36 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=6tUgHYgUp2ybC 6UX/X0aIvrDkDk1L72fYFBNNAan4Kc=; b=Te9Pv2W3Zfn8zJFlPpxWIzZ2t3zfM EZurQUoYse0cGhctP8fPD1eTyTFxx1fHfY4wftpkAFOKK7JKPKldERYXiRNvAnsV p4ejeTwNqAIZvttrG2jmQYcEaDEH/+8suI+lEhU0pmOiN3GNa5x7WdLAPo2JcoKu fCWaPN3B0s+o7sgHoHwP2UJ8/RveKuxCUHGW+aq0SxGfXlxnE+Utn+kcs5e4+xb/ dejuKfSkWzdQAJ+pTXwjQTZEpdjnyNKEYeRQBCfrUV7ZoVY53JNZ6N8ZH0MsPd6f JnUD3CPtI9sOHSPH5n9iKYQtwu/1hJrGEXAUHpigxrrxCjD7Xr0WYh4wg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=6tUgHYgUp2ybC6UX/X0aIvrDkDk1L72fYFBNNAan4Kc=; b=Ox33hHoJ /nW9b7PqZ2bu45wT5S6fCmEDchTiJ2/0mFEpMK94HfkBB0GLsY1v3kjWmmkll9JZ /A78BDVTSTBsHUlTWn+mDMk1X2acZ1yfNZhGRCzWBKqha2ca0yWFE5NiPgL495aA GH2xJWckClrxpW8+WXQv6EXt4GUV6gI4ieM2BIzpa4LGaltk9j55Efz3C0RcDzEu izGoEVt+WVGaGxl13EoIrDg0flX2Oo0lI0C6dH2t/rg7PltIYavb2IEw2+VHShLp kYRKY45mwpkFwU3uuDvokjipHHkSkD8smym5DiF2DbZnrClphYAAsZwKDlOuIu/F letimaXKWTNi7A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudduiedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpeelne curfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL v2 14/38] hw/block/nvme: improve invalid zasl value reporting Date: Tue, 9 Mar 2021 12:44:48 +0100 Message-Id: <20210309114512.536489-15-its@irrelevant.dk> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210309114512.536489-1-its@irrelevant.dk> References: <20210309114512.536489-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=64.147.123.26; envelope-from=its@irrelevant.dk; helo=wnew1-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 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, Dmitry Fomichev , Klaus Jensen , Max Reitz , Keith Busch , Stefan Hajnoczi , Klaus Jensen , Corne Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Klaus Jensen The Zone Append Size Limit (ZASL) must be at least 4096 bytes, so improve the user experience by adding an early parameter check in nvme_check_constraints. When ZASL is still too small due to the host configuring the device for an even larger page size, convert the trace point in nvme_start_ctrl to an NVME_GUEST_ERR such that this is logged by QEMU instead of only traced. Reported-by: Corne Cc: Dmitry Fomichev Reviewed-by: Dmitry Fomichev Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 56ef07b74d27..2addaf7c4f70 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -3997,8 +3997,10 @@ static int nvme_start_ctrl(NvmeCtrl *n) n->zasl =3D n->params.mdts; } else { if (n->params.zasl_bs < n->page_size) { - trace_pci_nvme_err_startfail_zasl_too_small(n->params.zasl_bs, - n->page_size); + NVME_GUEST_ERR(pci_nvme_err_startfail_zasl_too_small, + "Zone Append Size Limit (ZASL) of %d bytes is t= oo " + "small; must be at least %d bytes", + n->params.zasl_bs, n->page_size); return -1; } n->zasl =3D 31 - clz32(n->params.zasl_bs / n->page_size); @@ -4517,6 +4519,12 @@ static void nvme_check_constraints(NvmeCtrl *n, Erro= r **errp) error_setg(errp, "zone append size limit has to be a power of = 2"); return; } + + if (n->params.zasl_bs < 4096) { + error_setg(errp, "zone append size limit must be at least " + "4096 bytes"); + return; + } } } =20 --=20 2.30.1