Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1519264

Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions callback

From Auger Eric <eric.auger@redhat.com>
Newsgroups linux.kernel
Subject Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions callback
Date 2016-11-10 19:10 +0100
Message-ID <sC1Xx-1gl-49@gated-at.bofh.it> (permalink)
References <szKR3-112-7@gated-at.bofh.it> <szKR3-112-23@gated-at.bofh.it> <sBZLY-871-27@gated-at.bofh.it> <sBZVD-8ak-5@gated-at.bofh.it> <sC0f0-77-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Joerg,

On 10/11/2016 17:13, Joerg Roedel wrote:
> On Thu, Nov 10, 2016 at 04:57:51PM +0100, Auger Eric wrote:
>> It does not only serve the purpose to register the MSI IOVA region. We
>> also need to allocate an iova_domain where MSI IOVAs will be allocated
>> upon the request of the relevant MSI controllers. Do you mean you don't
>> like to use the iova allocator for this purpose?
> 
> Yes, it looks like the only purpose of iommu_get_dma_msi_region_cookie()
> is to get the msi-region information into into the reserved-list.
> 
> Why do you need to 'allocate' the MSI region after all? Except for
> IOMMU_DOMAIN_DMA domains the iommu-core code does not care about address
> allocation. This is up to the users of the domain, which includes that
> the user has to take care of the MSI region.
The purpose is to reuse the transparent MSI IOVA allocation scheme
introduced by Robin in [PATCH v7 00/22] Generic DT bindings for PCI
IOMMUs and ARM SMMU (commit 44bb7e243bd4b4e5c79de2452cd9762582f58925).

GICv2m and GICV3 ITS use dma-mapping iommu_dma_map_msi_msg to allocate
an MSI IOVA on-demand. This relies on the existence of an allocated
iova_domain whose handle is stored in domain->iova_cookie.

the iommu_dma_init_domain could be done in VFIO instead of in the
IOMMU-code, on the basis of dm region info. But we would need to
differentiate the MSI window from P2P windows.

msi-region start/length are arbitrarily chosen and the setup of the
reserved region list does not depend on iommu_get_dma_msi_region_cookie;
but maybe I completely misunderstand your question.


> Besides that, 'iommu_get_dma_msi_region_cookie' is a terrible function
> name and does not describe at all what the function does or is supposed
> to do.
Yes this was discussed with Alex& Robin already
(https://patchwork.kernel.org/patch/9363989/). I proposed to rename into
iommu_setup_dma_msi_region but this was not validated.

Thanks

Eric
> 
> 
> 	Joerg
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions callback Eric Auger <eric.auger@redhat.com> - 2016-11-04 12:30 +0100
  Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Robin Murphy <robin.murphy@arm.com> - 2016-11-04 15:20 +0100
  Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-10 16:50 +0100
    Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Auger Eric <eric.auger@redhat.com> - 2016-11-10 17:00 +0100
      Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-10 17:20 +0100
        Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Auger Eric <eric.auger@redhat.com> - 2016-11-10 19:10 +0100
          Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-11 12:50 +0100
            Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Auger Eric <eric.auger@redhat.com> - 2016-11-11 16:50 +0100
              Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-11 17:30 +0100
                Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Auger Eric <eric.auger@redhat.com> - 2016-11-11 17:50 +0100
    Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Robin Murphy <robin.murphy@arm.com> - 2016-11-10 17:10 +0100
      Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-10 17:20 +0100
        Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Robin Murphy <robin.murphy@arm.com> - 2016-11-11 15:40 +0100
          Re: [RFC v2 8/8] iommu/arm-smmu: implement add_reserved_regions  callback Joerg Roedel <joro@8bytes.org> - 2016-11-11 16:10 +0100

csiph-web