From patchwork Thu Apr 22 13:58:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 1469230 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: 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=F//74d5d; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=aKB8Jd1E; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FQzZh15ZNz9sV5 for ; Fri, 23 Apr 2021 00:00:12 +1000 (AEST) Received: from localhost ([::1]:48802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZZsI-0004wh-0O for incoming@patchwork.ozlabs.org; Thu, 22 Apr 2021 10:00:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZZqv-0004n7-9M; Thu, 22 Apr 2021 09:58:45 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:55059) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZZqs-0007Wx-HY; Thu, 22 Apr 2021 09:58:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 792F31362; Thu, 22 Apr 2021 09:58:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 22 Apr 2021 09:58:40 -0400 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=GsK+ACJGs/Ugc x0dfxXfO3PtTcybUP67agVL7RKo6pY=; b=F//74d5dY0cwCzXOt3b/jn88UdrJL yPofROEGz6aJzeU1Is3N8ds6YirVX1bq6EDV3i2DrTiWmYsKDtPfudXeBLA7canr eykB+UIh3KIcGYcLvS32DJhEPctGPYUrvo7dMU1YRubw+Exe1dwIotVgj6mswrFP Dk4qd5AOphpI+bsbJmaRTH6q1srUVmp6Pt2w1Za5X26IwOYheuECTDGNT0AJAce8 3RrRHK3PZU/iiCGhShdQc1LKqstkXiyE9L8VH+OfCcD7e6wrx6um0jbHL62Uk3Wb zXKP41QRONhfOh5RQWGt+Jnl8bGPpvHAxEAAFVerlAX/PhyJa3aWW8azA== 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=GsK+ACJGs/Ugcx0dfxXfO3PtTcybUP67agVL7RKo6pY=; b=aKB8Jd1E 8T607Ql20DJm2TE9keo3kBaNPGvj30OLAEzdUTaEuAK9AfLWTghEnKCG3ST3wOyB xB2hvjV7WyCWMkAgLv/VQ0FVobDPHj6GMkB81KYToxdbb+arCsEOj8369D6QwAT/ 6GmCALk/uIqMwUedVAoCRX4pySdNFSgH/KtnL+MUrtwY6WTCD94575YDQtTDbHgO 7FJbUnlqNQecYEy7qZX8T3wxN7lqwckwH462XpeSkjjTijC+xpzbZJcqNj+nipUy 5U/HbhUuiSu8qKW2LxBEwkd3tlNRF6L7IFX9U0QZa2UNx1KB4SGAsgwhOXAMl8fH VUgoyBxDfkaT7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddutddgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehithhssehirhhrvghlvghvrghnthdrughk X-ME-Proxy: 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 F11151080063; Thu, 22 Apr 2021 09:58:37 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH for-6.0? 1/1] hw/block/nvme: fix invalid msix exclusive uninit Date: Thu, 22 Apr 2021 15:58:34 +0200 Message-Id: <20210422135834.406688-2-its@irrelevant.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210422135834.406688-1-its@irrelevant.dk> References: <20210422135834.406688-1-its@irrelevant.dk> MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.19; envelope-from=its@irrelevant.dk; helo=wout3-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: Kevin Wolf , qemu-block@nongnu.org, Klaus Jensen , Max Reitz , Klaus Jensen , Keith Busch Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen Commit 1901b4967c3f changed the nvme device from using a bar exclusive for MSI-x to sharing it on bar0. Unfortunately, the msix_uninit_exclusive_bar() call remains in nvme_exit() which causes havoc when the device is removed with, say, device_del. Fix this. Fixes: 1901b4967c3f ("hw/block/nvme: move msix table and pba to BAR 0") Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 624a1431d072..31a1a59d88c9 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -6235,7 +6235,7 @@ static void nvme_exit(PCIDevice *pci_dev) if (n->pmr.dev) { host_memory_backend_set_mapped(n->pmr.dev, false); } - msix_uninit_exclusive_bar(pci_dev); + msix_uninit(pci_dev, &n->bar0, &n->bar0); } static Property nvme_props[] = {