[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3 01/14] AMD/IOMMU: free more memory when cleaning up after error


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Tue, 16 Jul 2019 16:35:08 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u4b/8lMA3V0UKl8hzQJA2iYxHhfpLnnYKrKerCCshVk=; b=nMwHytgWXz7dtcAnSSwXsB/gFBdJklJYSrh/ZQ04ZWGNS3mpfqXwqwHOKWlrumU0oC2vKul8blHhcB/YvStX87MyudIngKzJuPi4MZqqkqLHWFfuO5Wu17DbnScBzgon6Xwh6vfRn1MYD0DOi2xDcF+Ckn4DipYBI06DM4Q5HKneD8R022KUz73yMwZbZuN417fK8e8AGSxJtVn/a1070Z5d3nAS/VLEtBIOxjd3I4h8JLIDOB8CGrxLGNS1nv3h1+9HGQcGZrBHCkLAU88fyu3Ikijmkx0Vyf403M5aT8CBKyAP8DIVXjno8SvfssrhOZ6JBQv8OekkTO0Q0hgESg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuRWPq8rZELuK+DlXssG5k5sC0Pm1L5r4hkUnlHzq+ewtVbrb0UdggwsS6dohwHAoSzaY9ZF3GTNM6YkUxA8JN2+EK0cn5Q+L0fBrMkgkGreIAtdc8i8b/6KxcJl2TwuivWKLG/pRYnA7C/Rga70Sb2tk5jPygmlZOIH7A+wuNXnFuMJlZO8bHaT+zlwIXwp5NbQIOZu5ubLprnC+pnoWNJbgmuUBRQTyWiI8RPxcg0QL7h3OjRTzCQaeOzVRgnujV8ovToSUp4n9ygncUjxFdMf2G7t8W50tt1RPfccurNHJJmAmZxwLZxPPANT6TOvz7VUQydRsE+DahjL0bdgfQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Brian Woods <brian.woods@xxxxxxx>, Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
  • Delivery-date: Tue, 16 Jul 2019 16:36:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/Rtf/2Gjt1xPEey+KV3HfkjfA==
  • Thread-topic: [PATCH v3 01/14] AMD/IOMMU: free more memory when cleaning up after error

The interrupt remapping in-use bitmaps were leaked in all cases. The
ring buffers and the mapping of the MMIO space were leaked for any IOMMU
that hadn't been enabled yet.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v3: New.

--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -1070,13 +1070,12 @@ static void __init amd_iommu_init_cleanu
      {
          list_del(&iommu->list);
          if ( iommu->enabled )
-        {
              disable_iommu(iommu);
-            deallocate_ring_buffer(&iommu->cmd_buffer);
-            deallocate_ring_buffer(&iommu->event_log);
-            deallocate_ring_buffer(&iommu->ppr_log);
-            unmap_iommu_mmio_region(iommu);
-        }
+
+        deallocate_ring_buffer(&iommu->cmd_buffer);
+        deallocate_ring_buffer(&iommu->event_log);
+        deallocate_ring_buffer(&iommu->ppr_log);
+        unmap_iommu_mmio_region(iommu);
          xfree(iommu);
      }
  
--- a/xen/drivers/passthrough/amd/iommu_intr.c
+++ b/xen/drivers/passthrough/amd/iommu_intr.c
@@ -610,6 +610,8 @@ int __init amd_iommu_free_intremap_table
  {
      void *tb = ivrs_mapping->intremap_table;
  
+    XFREE(ivrs_mapping->intremap_inuse);
+
      if ( tb )
      {
          __free_amd_iommu_tables(tb, INTREMAP_TABLE_ORDER);

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.