This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH] x86-64/mmcfg: fix pci_mmcfg_arch_free()

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86-64/mmcfg: fix pci_mmcfg_arch_free()
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Fri, 01 Jul 2011 11:39:49 +0100
Delivery-date: Fri, 01 Jul 2011 03:40:21 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
While only used on error paths so far, it should still actually do
something (which iounmap(), being an empty stub, doesn't).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -166,7 +166,12 @@ void __init pci_mmcfg_arch_free(void)
     for (i = 0; i < pci_mmcfg_config_num; ++i) {
         if (pci_mmcfg_virt[i].virt) {
-            iounmap(pci_mmcfg_virt[i].virt);
+            unsigned long size;
+            const struct acpi_mcfg_allocation *cfg = pci_mmcfg_virt[i].cfg;
+            size = (cfg->end_bus_number - cfg->start_bus_number + 1) << 20;
+            destroy_xen_mappings((unsigned long)pci_mmcfg_virt[i].virt,
+                                 (unsigned long)pci_mmcfg_virt[i].virt + size);
             pci_mmcfg_virt[i].virt = NULL;
             pci_mmcfg_virt[i].cfg = NULL;

Attachment: x86_64-mmcfg-arch-free.patch
Description: Text document

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86-64/mmcfg: fix pci_mmcfg_arch_free(), Jan Beulich <=