From patchwork Tue May 14 09:13:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 243631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9C9A52C00C4 for ; Tue, 14 May 2013 19:15:05 +1000 (EST) Received: from localhost ([::1]:47636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcBK3-0004gA-Na for incoming@patchwork.ozlabs.org; Tue, 14 May 2013 05:15:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcBJH-0004dx-2m for qemu-devel@nongnu.org; Tue, 14 May 2013 05:14:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcBJ4-0001Lh-2i for qemu-devel@nongnu.org; Tue, 14 May 2013 05:14:14 -0400 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:54332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcBJ3-0001L4-MI; Tue, 14 May 2013 05:14:01 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 6F3DC2C00C1; Tue, 14 May 2013 19:13:59 +1000 (EST) From: David Gibson To: alex.williamson@redhat.com, pbonzini@redhat.com Date: Tue, 14 May 2013 19:13:48 +1000 Message-Id: <1368522837-20747-3-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368522837-20747-1-git-send-email-david@gibson.dropbear.id.au> References: <1368522837-20747-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2402:b800:7003:1:1::1 Cc: aik@ozlabs.ru, David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com Subject: [Qemu-devel] [PATCH 02/11] pci: Don't del_subgregion on a non subregion X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently do_pci_unregister_device() calls memory_region_del_subregion() on the device's bus_master_enable_region and the device's iommu region. But the bus_master_enable_region is an _alias_ to the iommu region, the iommu region is _not_ a subregion of it. I suspect this has slipped by only because PCI hot unplug has not been tested with the new PCI DMA address space handling. This patch removes the bogus call. Signed-off-by: David Gibson --- hw/pci/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0ba39e6..58d3f69 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -875,7 +875,6 @@ static void do_pci_unregister_device(PCIDevice *pci_dev) pci_config_free(pci_dev); address_space_destroy(&pci_dev->bus_master_as); - memory_region_del_subregion(&pci_dev->bus_master_enable_region, pci_dev->iommu); pci_dev->bus->iommu_dtor_fn(pci_dev->iommu); memory_region_destroy(&pci_dev->bus_master_enable_region); }