From patchwork Mon Aug 8 13:09:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 108968 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D5025B6F71 for ; Tue, 9 Aug 2011 00:55:14 +1000 (EST) Received: from localhost ([::1]:39770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqREW-0003HU-7T for incoming@patchwork.ozlabs.org; Mon, 08 Aug 2011 10:55:12 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqPab-0002p3-3o for qemu-devel@nongnu.org; Mon, 08 Aug 2011 09:10:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqPaN-0002N9-NG for qemu-devel@nongnu.org; Mon, 08 Aug 2011 09:09:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqPaN-0002LD-6D for qemu-devel@nongnu.org; Mon, 08 Aug 2011 09:09:39 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p78D9cK4007022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Aug 2011 09:09:38 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p78D9Zw6030050; Mon, 8 Aug 2011 09:09:37 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 5DCD0250B69; Mon, 8 Aug 2011 16:09:34 +0300 (IDT) From: Avi Kivity To: Anthony Liguori , qemu-devel@nongnu.org Date: Mon, 8 Aug 2011 16:09:32 +0300 Message-Id: <1312808972-1718-40-git-send-email-avi@redhat.com> In-Reply-To: <1312808972-1718-1-git-send-email-avi@redhat.com> References: <1312808972-1718-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH v4 39/39] pci: remove support for pre memory API BARs 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 Not used anymore. Reviewed-by: Richard Henderson Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/pci.c | 33 ++------------------------------- 1 files changed, 2 insertions(+), 31 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 6547d2b..dc7271a 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -848,18 +848,7 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev) r = &pci_dev->io_regions[i]; if (!r->size || r->addr == PCI_BAR_UNMAPPED) continue; - if (r->memory) { - memory_region_del_subregion(r->address_space, r->memory); - } else { - if (r->type == PCI_BASE_ADDRESS_SPACE_IO) { - isa_unassign_ioport(r->addr, r->filtered_size); - } else { - cpu_register_physical_memory(pci_to_cpu_addr(pci_dev->bus, - r->addr), - r->filtered_size, - IO_MEM_UNASSIGNED); - } - } + memory_region_del_subregion(r->address_space, r->memory); } } @@ -1058,25 +1047,7 @@ static void pci_update_mappings(PCIDevice *d) /* now do the real mapping */ if (r->addr != PCI_BAR_UNMAPPED) { - if (r->memory) { - memory_region_del_subregion(r->address_space, r->memory); - } else if (r->type & PCI_BASE_ADDRESS_SPACE_IO) { - int class; - /* NOTE: specific hack for IDE in PC case: - only one byte must be mapped. */ - class = pci_get_word(d->config + PCI_CLASS_DEVICE); - if (class == 0x0101 && r->size == 4) { - isa_unassign_ioport(r->addr + 2, 1); - } else { - isa_unassign_ioport(r->addr, r->filtered_size); - } - } else { - cpu_register_physical_memory(pci_to_cpu_addr(d->bus, - r->addr), - r->filtered_size, - IO_MEM_UNASSIGNED); - qemu_unregister_coalesced_mmio(r->addr, r->filtered_size); - } + memory_region_del_subregion(r->address_space, r->memory); } r->addr = new_addr; r->filtered_size = filtered_size;