From nobody Tue Nov 26 09:43:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=1708594180; cv=none; d=zohomail.com; s=zohoarc; b=exp5lDRqtIdje/oTWnAnedwEUjHD8wpxwvXSreMPNB+ZMjvAZ1x7R8HfSIEs6Z0B3ibU8WAAYigbR4UvqOsTf/ifoI8oKJsYLMeTV40S1O6gH2+sM+bV/QuQPxhGCglDIiXX5HeJ5bhhZzFqnkMJnTy2vahesUx0EhVJf9/NjMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708594180; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=unEqUS2ah1tg5MfeHlyQZzvJDUO9xa3f3mPjgTDV990=; b=YPq6FBpQ/bvgg8r/RKPsapXD9FYNNPAg8nqZfj+923BeBHP2h1c5kLuSJbp/NW+cBeshlTN9j/puGePGwOW7H2vpPZcCd3QAucogs22BqaKUimkUQ5CBDGqf4nluSq5y0bZfM91KADXnv+8ojx8B8Ve5t6JgxraH/p7dYi3LRdY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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 1708594180693721.6104741508851; Thu, 22 Feb 2024 01:29:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rd5OL-0000R0-Hn; Thu, 22 Feb 2024 04:29:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rd5OI-0000Ls-WD; Thu, 22 Feb 2024 04:29:19 -0500 Received: from fhigh1-smtp.messagingengine.com ([103.168.172.152]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rd5OG-0002vN-Lm; Thu, 22 Feb 2024 04:29:18 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 4C28511400D3; Thu, 22 Feb 2024 04:29:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 22 Feb 2024 04:29:14 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Feb 2024 04:29:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1708594154; x= 1708680554; bh=unEqUS2ah1tg5MfeHlyQZzvJDUO9xa3f3mPjgTDV990=; b=d N0MqbHzXjwwcWazHUtlDNDcCgOw3Vv6k4lQVKO2uw3xR2xYLuh3MipMFV4gtW+d2 1MqWO4NNOtlCC9fVLz/CF5dYu6woqeYXU1GKgljIou/QEuEK3WXbvpzKqVaKlDXw GIkD1czSR7StKCd/lJBrtP0t0R5aQras5ciyK1RYv2hjVzzYgOM/B93qUlfpLQJC idi71uGtTfY6P4fFkjULj01DgLC24ctiLwEsqh+msVbTRhwjdWdEVV8UbOXhKwdy yJAfCf0Fp5UAhcYPonwPrlvv/UiXRxLFBJBabYAR8GRLHCS7c0C2TJrFrEmqQWqC 2s/0Dl26AtxH9q/WAqKoQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1708594154; x=1708680554; bh=unEqUS2ah1tg5 MfeHlyQZzvJDUO9xa3f3mPjgTDV990=; b=XyG9AKCbWJqh38ynmFCZKGc8AWfUQ BkeSg/Ijm9ZrmIMzm2/ZduYpR+zvGvTLBwAthqkL1MlLz9R7U9f5JHWrKYJ/IlPH OgdcEfrBDrIveT971Z73qVnqcimMYHffZhrPj2OqQRqrtOOPSg39IqwvTlePs1r4 pdRSHsJxuHabDSJNU9BOw8ko6+dQZx3wczNPWFLssaT0Bw70/GcBUp+o8O3sq+Cv MAEfo1x9pQgZviqYZqDPXChRkFWvlxvkuTUqeIg9SFbOCw7LEi7RpH93+FYXZMol jgDRyJ2gOp88kGJ+u13Q3AYTEOC3mJyaEZjzC0Cmg78F9j7zeCYvLorqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeggddtgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhfffugggtgffkvfevofesthejredtredtjeenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnheptdehveejiefhgfegiefhfeehueeigfeugfelhfdtffevheffkefhkeegteetffet necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihhtsh esihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen Date: Thu, 22 Feb 2024 10:29:06 +0100 Subject: [PATCH] hw/nvme: fix invalid endian conversion MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240222-fix-sriov-numcntl-v1-1-d60bea5e72d0@samsung.com> X-B4-Tracking: v=1; b=H4sIAOET12UC/x2MWwqAIBAAryL73UIuVtBVoo8eWy2UhlYE4t2TP gdmJkJgLxygVRE8PxLE2Qy6UDBtg10ZZc4MVJIpiQgXeTF4cQ/a+5jstWPFI5t6MKSbGnJ3es7 S/+z6lD5IOIi7YwAAAA== To: Keith Busch , Klaus Jensen Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, Klaus Jensen , Kevin Wolf X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1096; i=k.jensen@samsung.com; h=from:subject:message-id; bh=PKexRZKVAtWrh0NHmG0QcIlyS8OHM26yr8H24FSQGLs=; b=owJ4nAFtAZL+kA0DAAoBTeGvMW1PDekByyZiAGXXE+j+gubLVuf1ZigEypdh7Huj+/bNpFwPK Qlt34E/7RnIcokBMwQAAQoAHRYhBFIoM6p14tzmokdmwE3hrzFtTw3pBQJl1xPoAAoJEE3hrzFt Tw3pywIH/RsdlecmYxovU3zNM5/VTmMQ//Ijlu8Wgkk6X+MKEGRJi0RxhGSGkZSZW3I2CRRXibS QaGjKsLkGAW2D/uFB4lSEgYDr8U87MZChf8t5g6UzOkuhBu68XAk4gD97EiRjkt2tzxiir663ye 0l7YOrAwKz2NY1zPfKdZZkXAHWt9ymK6ACEI60wTlKm20azVouZ1TaDDV6Bpcm0nzfCzlZDuadD 4kPrilZc18FlvnnPTgkUwbXDEGi0DVIp+l5WSJsQ8adt1vXYRohQx7k+939FJWcsnwCjPRjstXA 3tbsxcrXX83OBLYiqmLBEzZH8naTpcl5K9VfQn6D4IlLiZTnlljkhqiq X-Developer-Key: i=k.jensen@samsung.com; a=openpgp; fpr=DDCA4D9C9EF931CC3468427263D56FC5E55DA838 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=103.168.172.152; envelope-from=its@irrelevant.dk; helo=fhigh1-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_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @irrelevant.dk) X-ZM-MESSAGEID: 1708594181845100001 From: Klaus Jensen numcntl is one byte and so is max_vfs. Using cpu_to_le16 on big endian hosts results in numcntl being set to 0. Fix by dropping the endian conversion. Fixes: 746d42b13368 ("hw/nvme: Initialize capability structures for primary= /secondary controllers") Reported-by: Kevin Wolf Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im --- 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 f026245d1e9e..76fe0397045b 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -7924,7 +7924,7 @@ static void nvme_init_state(NvmeCtrl *n) n->aer_reqs =3D g_new0(NvmeRequest *, n->params.aerl + 1); QTAILQ_INIT(&n->aer_queue); =20 - list->numcntl =3D cpu_to_le16(max_vfs); + list->numcntl =3D max_vfs; for (i =3D 0; i < max_vfs; i++) { sctrl =3D &list->sec[i]; sctrl->pcid =3D cpu_to_le16(n->cntlid); --- base-commit: 760b4dcdddba4a40b9fa0eb78fdfc7eda7cb83d0 change-id: 20240222-fix-sriov-numcntl-5ebe46a42176 Best regards, --=20 Klaus Jensen