Re: [PATCH v4 07/15] iommu/vt-d: Delegate the dma domain to upper layer

2020-08-23 Thread Lu Baolu
Hi Chris, On 2020/8/22 2:33, Chris Wilson wrote: Quoting Lu Baolu (2019-05-25 06:41:28) This allows the iommu generic layer to allocate a dma domain and attach it to a device through the iommu api's. With all types of domains being delegated to upper layer, we can remove an internal flag which

Re: [patch RFC 26/38] x86/xen: Wrap XEN MSI management into irqdomain

2020-08-23 Thread Jürgen Groß
On 21.08.20 02:24, Thomas Gleixner wrote: To allow utilizing the irq domain pointer in struct device it is necessary to make XEN/MSI irq domain compatible. While the right solution would be to truly convert XEN to irq domains, this is an exercise which is not possible for mere mortals with limit

Re: [patch RFC 23/38] x86/xen: Rework MSI teardown

2020-08-23 Thread Jürgen Groß
On 21.08.20 02:24, Thomas Gleixner wrote: X86 cannot store the irq domain pointer in struct device without breaking XEN because the irq domain pointer takes precedence over arch_*_msi_irqs() fallbacks. XENs MSI teardown relies on default_teardown_msi_irqs() which invokes arch_teardown_msi_irq().

Re: [patch RFC 24/38] x86/xen: Consolidate XEN-MSI init

2020-08-23 Thread Jürgen Groß
On 21.08.20 02:24, Thomas Gleixner wrote: X86 cannot store the irq domain pointer in struct device without breaking XEN because the irq domain pointer takes precedence over arch_*_msi_irqs() fallbacks. To achieve this XEN MSI interrupt management needs to be wrapped into an irq domain. Move the

Re: [patch RFC 22/38] x86/xen: Make xen_msi_init() static and rename it to xen_hvm_msi_init()

2020-08-23 Thread Jürgen Groß
On 21.08.20 02:24, Thomas Gleixner wrote: The only user is in the same file and the name is too generic because this function is only ever used for HVM domains. Signed-off-by: Thomas Gleixner Cc: Konrad Rzeszutek Wilk Cc:linux-...@vger.kernel.org Cc:xen-de...@lists.xenproject.org Cc: Juergen Gro

Re: [RESEND PATCH 4/5] iommu: intel: Drop kerneldoc marker from regular comment

2020-08-23 Thread Lu Baolu
Hi, On 8/20/20 1:53 AM, Krzysztof Kozlowski wrote: Fix W=1 compile warnings (invalid kerneldoc): drivers/iommu/intel/dmar.c:389: warning: Function parameter or member 'header' not described in 'dmar_parse_one_drhd' Signed-off-by: Krzysztof Kozlowski Adjust the commit title to "iommu/v

Re: [PATCH v2 4/9] iommu/ioasid: Add reference couting functions

2020-08-23 Thread Lu Baolu
Hi Jacob, On 8/22/20 12:35 PM, Jacob Pan wrote: There can be multiple users of an IOASID, each user could have hardware contexts associated with the IOASID. In order to align lifecycles, reference counting is introduced in this patch. It is expected that when an IOASID is being freed, each user

Re: [PATCH v2 3/9] iommu/ioasid: Introduce ioasid_set APIs

2020-08-23 Thread Lu Baolu
Hi Jacob, On 8/22/20 12:35 PM, Jacob Pan wrote: ioasid_set was introduced as an arbitrary token that are shared by a group of IOASIDs. For example, if IOASID #1 and #2 are allocated via the same ioasid_set*, they are viewed as to belong to the same set. For guest SVA usages, system-wide IOASID

Re: [PATCH 0/8] Convert the intel iommu driver to the dma-iommu api

2020-08-23 Thread Tom Murphy
Hi Logan/All, I have added a check for the sg_dma_len == 0 : """ } __sgt_iter(struct scatterlist *sgl, bool dma) { struct sgt_iter s = { .sgp = sgl }; + if (sgl && sg_dma_len(sgl) == 0) + s.sgp = NULL; if (s.sgp) { . """ at location [1]. but it do

[PATCH v8 1/3] dma-contiguous: provide the ability to reserve per-numa CMA

2020-08-23 Thread Barry Song
Right now, drivers like ARM SMMU are using dma_alloc_coherent() to get coherent DMA buffers to save their command queues and page tables. As there is only one default CMA in the whole system, SMMUs on nodes other than node0 will get remote memory. This leads to significant latency. This patch prov

[PATCH v8 2/3] arm64: mm: reserve per-numa CMA to localize coherent dma buffers

2020-08-23 Thread Barry Song
Right now, smmu is using dma_alloc_coherent() to get memory to save queues and tables. Typically, on ARM64 server, there is a default CMA located at node0, which could be far away from node2, node3 etc. with this patch, smmu will get memory from local numa node to save command queues and page table

Re: [PATCH v12 09/13] drm/msm: Add support to create a local pagetable

2020-08-23 Thread Guenter Roeck
On Mon, Aug 10, 2020 at 04:26:53PM -0600, Jordan Crouse wrote: > Add support to create a io-pgtable for use by targets that support > per-instance pagetables. In order to support per-instance pagetables the > GPU SMMU device needs to have the qcom,adreno-smmu compatible string and > split pagetable

[PATCH v8 0/3] make dma_alloc_coherent NUMA-aware by per-NUMA CMA

2020-08-23 Thread Barry Song
Ganapatrao Kulkarni has put some effort on making arm-smmu-v3 use local memory to save command queues[1]. I also did similar job in patch "iommu/arm-smmu-v3: allocate the memory of queues in local numa node" [2] while not realizing Ganapatrao has done that before. But it seems it is much better to

[PATCH v8 3/3] mm: cma: use CMA_MAX_NAME to define the length of cma name array

2020-08-23 Thread Barry Song
CMA_MAX_NAME should be visible to CMA's users as they might need it to set the name of CMA areas and avoid hardcoding the size locally. So this patch moves CMA_MAX_NAME from local header file to include/linux header file and removes the hardcode in both hugetlb.c and contiguous.c. Cc: Mike Kravetz

Re: [PATCH 12/18] iommu/tegra-gart: Add IOMMU_DOMAIN_DMA support

2020-08-23 Thread Dmitry Osipenko
21.08.2020 03:28, Robin Murphy пишет: ... >> Will a returned NULL tell to IOMMU core that implicit domain shouldn't >> be used? Is it possible to leave this driver as-is? > > The aim of this patch was just to make the conversion without functional > changes wherever possible, i.e. maintain an equi

Re: [PATCH 16/18] staging/media/tegra-vde: Clean up IOMMU workaround

2020-08-23 Thread Dmitry Osipenko
21.08.2020 03:11, Robin Murphy пишет: ... >> Hello, Robin! Thank you for yours work! >> >> Some drivers, like this Tegra VDE (Video Decoder Engine) driver for >> example, do not want to use implicit IOMMU domain. > > That isn't (intentionally) changing here - the only difference should be > that i

Re: [patch RFC 38/38] irqchip: Add IMS array driver - NOT FOR MERGING

2020-08-23 Thread Thomas Gleixner
On Sat, Aug 22 2020 at 20:05, Jason Gunthorpe wrote: > On Sat, Aug 22, 2020 at 03:34:45AM +0200, Thomas Gleixner wrote: > As a silicon design it might work, but it means existing devices can't > be used with this dev_msi. It is also the sort of thing that would > need a standard document to have an

Re: [PATCH v2 1/9] docs: Document IO Address Space ID (IOASID) APIs

2020-08-23 Thread Lu Baolu
Hi Jacob, On 2020/8/22 12:35, Jacob Pan wrote: IOASID is used to identify address spaces that can be targeted by device DMA. It is a system-wide resource that is essential to its many users. This document is an attempt to help developers from all vendors navigate the APIs. At this time, ARM SMMU