From patchwork Tue Mar 14 08:02:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 738582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vj6j10X32z9s1y for ; Tue, 14 Mar 2017 19:04:53 +1100 (AEDT) Received: from localhost ([::1]:56982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnhRq-0005Hs-Jq for incoming@patchwork.ozlabs.org; Tue, 14 Mar 2017 04:04:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cnhPk-00045c-Lt for qemu-devel@nongnu.org; Tue, 14 Mar 2017 04:02:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cnhPj-0006km-Or for qemu-devel@nongnu.org; Tue, 14 Mar 2017 04:02:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37092) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cnhPj-0006ka-Ii; Tue, 14 Mar 2017 04:02:39 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 97A7681222; Tue, 14 Mar 2017 08:02:39 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (vpn1-6-54.pek2.redhat.com [10.72.6.54]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2E82Wf0029775; Tue, 14 Mar 2017 04:02:37 -0400 From: Jason Wang To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Tue, 14 Mar 2017 16:02:28 +0800 Message-Id: <1489478550-19431-2-git-send-email-jasowang@redhat.com> In-Reply-To: <1489478550-19431-1-git-send-email-jasowang@redhat.com> References: <1489478550-19431-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 14 Mar 2017 08:02:39 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] e1000e: correctly tear down MSI-X memory regions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Jason Wang , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini MSI-X has been disabled by the time the e1000e device is unrealized, hence msix_uninit is never called. This causes the object to be leaked, which shows up as a RAMBlock with empty name when attempting migration. Reported-by: Dr. David Alan Gilbert Cc: Jason Wang Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Tested-by: Laurent Vivier Signed-off-by: Jason Wang --- hw/net/e1000e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index b0f429b..6e23493 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -306,7 +306,7 @@ e1000e_init_msix(E1000EState *s) static void e1000e_cleanup_msix(E1000EState *s) { - if (msix_enabled(PCI_DEVICE(s))) { + if (msix_present(PCI_DEVICE(s))) { e1000e_unuse_msix_vectors(s, E1000E_MSIX_VEC_NUM); msix_uninit(PCI_DEVICE(s), &s->msix, &s->msix); }