From patchwork Mon Aug 1 10:05:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1662467 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=irrelevant.dk header.i=@irrelevant.dk header.a=rsa-sha256 header.s=fm2 header.b=t5EcFJnJ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=G1q7UJpK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LxDTQ3k5cz9sCD for ; Mon, 1 Aug 2022 20:12:58 +1000 (AEST) Received: from localhost ([::1]:40148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oISPw-00067W-0a for incoming@patchwork.ozlabs.org; Mon, 01 Aug 2022 06:12:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISJO-0001Ch-FE; Mon, 01 Aug 2022 06:06:10 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:57999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISJM-0000Wv-Pu; Mon, 01 Aug 2022 06:06:10 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id B511C320091B; Mon, 1 Aug 2022 06:06:06 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 01 Aug 2022 06:06:07 -0400 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=fm2; t=1659348366; x= 1659434766; bh=LgPzmVkdIvrOCWDn7ND8OkxWypGN7bdT3A7dXh2bPwQ=; b=t 5EcFJnJnyGRmBhSoaNbZdbL7ZsztCjDt95wT/JMQ/D6jNwdygRfBuU7IKyq6z6Ry 7KLL+HJvRJewQDhXQm/KTiqQWyB8za47QhEwuKLbw2UFtQaIHJv6xkV5CJ9zljVe eVBTYsTK81cAAPPgaYBQILo2e/Hjl7g0TMAxCWHUahHu8/+k0fu+4Z4hYkbLxHR/ yBQ4N/H4mGBniaO1dj8iLd0uMfIBQ0QjQJGvnlHUYjpSaFzJGSKtEXdj3KZitD5H y9SuECaP1+Lmvs5ZBJTlX5ufP78vM41sIUc3wU/ZwSgBCyqJi3rxB3MC2qYOGiUA SbmrCJrG0H2j3LVxS2o7A== 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=fm3; t=1659348366; x=1659434766; bh=LgPzmVkdIvrOC WDn7ND8OkxWypGN7bdT3A7dXh2bPwQ=; b=G1q7UJpKy/1OtfY5mZmySqfO7p/Rr W0PGAsADCQlDjQ3ENw5z3a2asLOfMuOvalqtQYEJclPcwhePITAv7FikbE3WUJtB 6v9kBX8szoqwRJJYJmNWu6rrzrwTM5oRTk8BXbAQbMsrNgJSimizED/hQ4TPS20w 7sRc4JFWA2t6avBIXmjPUsX2Vx+98BnSc73QfCs9TRVGJ/heu4Ao8A6ae1Q8nS8x VLA2wu/d7fCmWpJI3+NbfwU3uFENjI25B6QbHNrS/khB31rj3pjMo9Isr7WnrHW9 PiDGOeszbQby1D65NdhdJbcBFFJXv45/bxp2EITH6ogVAweRPSH4S9XFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvfedgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepjefgieelgfeiveehkeeuveehheekfeevgeeigfehfefgjeejhefffeegudej udegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepih htshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: Feedback-ID: idc91472f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Aug 2022 06:06:04 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Cc: Keith Busch , qemu-block@nongnu.org, Klaus Jensen , Klaus Jensen , Jinhao Fan Subject: [PULL for-7.1 2/3] hw/nvme: unregister the event notifier handler on the main loop Date: Mon, 1 Aug 2022 12:05:55 +0200 Message-Id: <20220801100556.2217492-3-its@irrelevant.dk> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220801100556.2217492-1-its@irrelevant.dk> References: <20220801100556.2217492-1-its@irrelevant.dk> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.25; envelope-from=its@irrelevant.dk; helo=wout2-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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen Make sure the notifier handler is unregistered in the main loop prior to cleaning it up. Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates") Reviewed-by: Keith Busch Reviewed-by: Jinhao Fan Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 8aa73b048d51..70b454eedbd8 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -4311,6 +4311,7 @@ static void nvme_free_sq(NvmeSQueue *sq, NvmeCtrl *n) if (sq->ioeventfd_enabled) { memory_region_del_eventfd(&n->iomem, 0x1000 + offset, 4, false, 0, &sq->notifier); + event_notifier_set_handler(&sq->notifier, NULL); event_notifier_cleanup(&sq->notifier); } g_free(sq->io_req); @@ -4701,6 +4702,7 @@ static void nvme_free_cq(NvmeCQueue *cq, NvmeCtrl *n) if (cq->ioeventfd_enabled) { memory_region_del_eventfd(&n->iomem, 0x1000 + offset, 4, false, 0, &cq->notifier); + event_notifier_set_handler(&cq->notifier, NULL); event_notifier_cleanup(&cq->notifier); } if (msix_enabled(&n->parent_obj)) {