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

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


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: "Woods, Brian" <Brian.Woods@xxxxxxx>
  • Date: Fri, 19 Jul 2019 18:22:03 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=amd.com;dmarc=pass action=none header.from=amd.com;dkim=pass header.d=amd.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=qAM7k1qtITnuaNm8cBvqvzejAvFwLNCNMw8AeuHVzcM=; b=hF5ExR7df7wjUvpoETC1oc63YDcmGMc8b9AqDupfWWB/yMPCGSSik9S55cWibto80vvc5tYBftMuiF5mhY7rA5/KDwoH6X4VmMTjWaB7suM/jqiUmQzD7EjZouB++503KyZU5k5jtjh/O8h2Trnpo4rtnX0G325/iR5q77wdxPREE2tdQF9M5e4sZzE0gSfpxsjKBahtQtOhZ5fpcKULDBjY1k6fm7xlqR4HT8xSWcQBpE09JyQTWJXVD4aVg8pUUO4bHN4Yez9GSIDn9ColhTWY/aY3yeALU46O1LXqakrauo5CDIVoEIe1dGJPap3VBslQNXXAAYY4lXh29H9Xxg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ATVa5hFnWTXpZG1i0ch42PNEiwJrE3WpIKu+xzor3mfK6b5AZjJGDDum7IlpKOfMHjdNhRNfnp8MFF3m/jNXragjPTqu8sj5+DNtk2o66wEzv+rvK9c4/KyhGYWXQDPEczkgVnapK2gbgKQYEbLu/OpD5B3yP0Ua/xGTlHYvKqNRCQM2fWRE8DGPRwxeT2A+x68vNQB3qgHIa+5FVlOELgMN7u1OnKju6oCYIuogzkES+QymX1Z3zLQe8eUaUbhnm1eYmAxK0NuEuxfbpFhJHmAm0lpWai0bB/c6ZFRBDnspg7LTBX5CTu+gJa4g+AO9jw7X98zAMaorS3D5rEYN/A==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Woods@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Woods, Brian" <Brian.Woods@xxxxxxx>, "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Fri, 19 Jul 2019 18:22:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVO/SOpnsmBAT+PkeYlMzXJLveFabSRc6A
  • Thread-topic: [PATCH v3 01/14] AMD/IOMMU: free more memory when cleaning up after error

On Tue, Jul 16, 2019 at 04:35:08PM +0000, Jan Beulich wrote:
> 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>

Acked-by: Brian Woods <brian.woods@xxxxxxx>

> ---
> 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);
> 

-- 
Brian Woods

_______________________________________________
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®.