From nobody Sat Nov 23 20:33:15 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=1731925015; cv=none; d=zohomail.com; s=zohoarc; b=JV+hHM8ax9TQpn8ibvryjD6HKrG0sWxybeL1wR8x5FiESz36IZTtSFbhzeRFWFPejbJpdyUSUirIwLi67VKIKZbw1YNHM/1hp5cU8Smc5yObNkzuZbdDAmjo2lu6ESoeWU3tBf/kklQngY/ztZ3U4sCeD7ljbrvAsIVtANpcEqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731925015; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wn0FDtj1v/m1iBQtnIW92oDW3NoKo76q4MrOju+Mbr0=; b=NDN0nYrk8pu7JSzLLVjQixbWhvgYnGuIKvcvGMguKOaUrlUSkE0qK4Q/90MmIzfYXOxHoLK3Olbv8E42EIZ8YAvGDA33jagyWedAZF8udsK2S6WCWR2T73f3qm7POD/g/J58lfAQj0W0MnkPZNccqvsmSD2dSxkNNW/GIWMg+cw= 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 1731925015862676.9009666901568; Mon, 18 Nov 2024 02:16:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCynT-0005Xp-3u; Mon, 18 Nov 2024 05:15:55 -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 1tCymm-0005LQ-GE; Mon, 18 Nov 2024 05:15:12 -0500 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCymk-0008Jf-OC; Mon, 18 Nov 2024 05:15:12 -0500 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.stl.internal (Postfix) with ESMTP id F0DE32540169; Mon, 18 Nov 2024 05:15:08 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Mon, 18 Nov 2024 05:15:09 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Nov 2024 05:15:07 -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:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1731924908; x=1732011308; bh=wn0FDtj1v/m1iBQtnIW92oDW3NoKo76q 4MrOju+Mbr0=; b=JzQ9NbbT8OW0x+wdQFqnyESdyyVXe6iR+fp7HVhbHxdtw8ar 8/97tqEq+xqEHn2/Pn/9TmiWuvAo74fEu7MiFjEj004D/MiIhEfM6HHLFzhLTVyP dX87Mf7HkHNcmoHRZ5Qq7Xsy6vrJ2GnA49/xnG2LLbgDWTkBOOpnwX9htEA4zPzq P2z+lg6uS7vSzspYQtQUEtTPTSE/3J3rnu/TeskfWM36hKyKr3NMzOsYfn1VIUHw jQrenlr5IOec1P3jVgyChrIoFthU26RKAFIAB7d00yuZL9p88H8bB3gt/CHuVmJW nruOb/xSMvbsHXTGbMVzqojmIACoI8qINv6ljw== 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:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1731924908; x= 1732011308; bh=wn0FDtj1v/m1iBQtnIW92oDW3NoKo76q4MrOju+Mbr0=; b=c HsS0V70ytWvozQpu8jobdBhl2fvPs6OZgrmALwP4OZC9N39OapauRoiNi77ZyABk 2rwRMWjTfX4s18hk6K2MiRMvlg8lVycRQFBH0xgbDY9ZvlHB3+YyzQ2v8fAMDvvd V8LQ/DyS0gZK285NRU2m/qIdT7zhgAurJsws/rhaZo6l9FA3OnLJI01lOt6/BqDW UEZwT3cwNOumCR9j7xs/LFRdsnfQekguvQdR+KrBABJ5ptlm3oH7tf2nM4BSIZI4 biC2LwrN5Hc8AyV3ZEZkU1tjJ/wXXb5sJ1pzjAPltrkA7dhTPm4QJDTJNB727Nyw D9lptUfR8Nvp4fn+y+HPA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfedtgdduvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomhepmfhlrghushculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrd gukheqnecuggftrfgrthhtvghrnhepkeeivddtueehffefuddtleefkefhiedttdduveeg gfffieetveffhfehgfeghfffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukhdpnhgspghrtghpthht ohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepfhhoshhsseguvghfmhgrtg hrohdrihhtpdhrtghpthhtohepihhtshesihhrrhgvlhgvvhgrnhhtrdgukhdprhgtphht thhopehqvghmuhdqsghlohgtkhesnhhonhhgnhhurdhorhhgpdhrtghpthhtohepkhgsuh hstghhsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehqvghmuhdquggvvhgvlhesnhho nhhgnhhurdhorhhgpdhrtghpthhtohepkhdrjhgvnhhsvghnsehsrghmshhunhhgrdgtoh hm X-ME-Proxy: Feedback-ID: idc91472f:Fastmail From: Klaus Jensen Date: Mon, 18 Nov 2024 11:14:18 +0100 Subject: [PATCH for-9.2 2/4] hw/nvme: fix use/unuse of msix vectors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241118-nvme-fixes-v1-2-02d107dbdcc0@samsung.com> References: <20241118-nvme-fixes-v1-0-02d107dbdcc0@samsung.com> In-Reply-To: <20241118-nvme-fixes-v1-0-02d107dbdcc0@samsung.com> To: Keith Busch , Klaus Jensen , Jesper Devantier , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: Klaus Jensen X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1122; i=k.jensen@samsung.com; h=from:subject:message-id; bh=On2tnR5FtbLyphu7V88G7B3jZ5QwBKDAjv+OiR4JC0E=; b=LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tCgpvd0o0bkFGdEFaTCtrQTBEQUFvQlRlR3ZNV zFQRGVrQnl5WmlBR2M3RTZYZnhubUJhUnBIU0lmVEZIa3VnSGd6CmRFQzFQendibXBWdGc1OHBa cjcxVzRrQk13UUFBUW9BSFJZaEJGSW9NNnAxNHR6bW9rZG13RTNocnpGdFR3M3AKQlFKbk94T2x BQW9KRUUzaHJ6RnRUdzNwQi9jSUFKYWdoUEFyb3FCRllyc3Qwb0d2SVpWakowUWR4S2RxdVZtVw pHZ1BJOXFpMmNHd1YwT2FqNXRRcitKUEJrMHJLM0pZQkhqNVVMR3NtVUlRUHdxMkVqd2w1b3VMR XNJbi9FVDZwCkNhVGtsTHRtd1lDenVob3YzNDZuQTVtOE9lZU9EUnZtMlBqZGxIMlR4Smh4RWph cU9meUlyTkx3NDBMdzB0YzgKTEpESTlJbFJLYmVQYXprY3NRdUl0N0VJeTBzWkgzdTYwUTN1czh TaE0wcjR3OWNhdW5EQ1ZYb0VTc2pJdmVUTApLSUY0T1Jqdi9xTVE0OU8yVHdab1c0S0NTbVh1QT lEbTZXNEtDb01EOEY1V1N2LzE0YlR3blo0bGN2K2RnTlYxClkxRnZ2SHRYdWs1NTJTNVNaSWx6S TdQTkNDTGNrVzlOYmxUeFFRN21tTmVWVEpoQkhyT0FSS3daCj12SFp6Ci0tLS0tRU5EIFBHUCBN RVNTQUdFLS0tLS0K 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=202.12.124.157; envelope-from=its@irrelevant.dk; helo=fhigh-b6-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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.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: 1731925017903116600 From: Klaus Jensen Only call msix_{un,}use_vector() when interrupts are actually enabled for a completion queue. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 13898d58278ed2155d45a9120fc07ea60bc64a32..a38f460a78599bc191c17a2a376= e865a74744e58 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -5423,7 +5423,7 @@ static void nvme_free_cq(NvmeCQueue *cq, NvmeCtrl *n) event_notifier_set_handler(&cq->notifier, NULL); event_notifier_cleanup(&cq->notifier); } - if (msix_enabled(pci)) { + if (msix_enabled(pci) && cq->irq_enabled) { msix_vector_unuse(pci, cq->vector); } if (cq->cqid) { @@ -5464,9 +5464,10 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n= , uint64_t dma_addr, { PCIDevice *pci =3D PCI_DEVICE(n); =20 - if (msix_enabled(pci)) { + if (msix_enabled(pci) && irq_enabled) { msix_vector_use(pci, vector); } + cq->ctrl =3D n; cq->cqid =3D cqid; cq->size =3D size; --=20 2.45.2