RE: [PATCH 12/12] bus: fsl-mc: Add ACPI support for fsl-mc

2020-05-21 Thread Makarand Pawagi
Hi Lorenzo, > -Original Message- > From: Laurentiu Tudor > Sent: Thursday, May 21, 2020 8:33 PM > To: Lorenzo Pieralisi ; linux-arm- > ker...@lists.infradead.org > Cc: Diana Madalina Craciun (OSS) ; Makarand > Pawagi ; iommu@lists.linux-foundation.org; > linux-a...@vger.kernel.org;

Re: [PATCH 0/2] Let pci_fixup_final access iommu_fwnode

2020-05-21 Thread Zhangfei Gao
Hi, Joerg On 2020/5/12 下午12:08, Zhangfei Gao wrote: Some platform devices appear as PCI but are actually on the AMBA bus, and they need fixup in drivers/pci/quirks.c handling iommu_fwnode. So calling pci_fixup_final after iommu_fwnode is allocated. For example: Hisilicon platform device need

Re: [PATCH -next] iommu/vt-d: fix a GCC warning

2020-05-21 Thread Lu Baolu
Hi Qian, Thanks! On 5/22/20 5:50 AM, Qian Cai wrote: The commit 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function") introduced a GCC warning, drivers/iommu/intel-iommu.c:5330:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] const static int ^

[PATCH v5 1/5] iommu/arm-smmu: add NVIDIA implementation for dual ARM MMU-500 usage

2020-05-21 Thread Krishna Reddy
NVIDIA's Tegra194 soc uses two ARM MMU-500s together to interleave IOVA accesses across them. Add NVIDIA implementation for dual ARM MMU-500s and add new compatible string for Tegra194 soc. Signed-off-by: Krishna Reddy --- MAINTAINERS | 2 + drivers/iommu/Makefile

[PATCH v5 3/5] iommu/arm-smmu: Add global/context fault implementation hooks

2020-05-21 Thread Krishna Reddy
Add global/context fault hooks to allow NVIDIA SMMU implementation handle faults across multiple SMMUs. Signed-off-by: Krishna Reddy --- drivers/iommu/arm-smmu-nvidia.c | 100 drivers/iommu/arm-smmu.c| 11 +++- drivers/iommu/arm-smmu.h| 3 + 3

[PATCH v5 5/5] arm64: tegra: enable SMMU for SDHCI and EQOS on T194

2020-05-21 Thread Krishna Reddy
Enable SMMU translations for SDHCI and EQOS transactions on T194. Signed-off-by: Krishna Reddy --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index

[PATCH v5 0/5] Nvidia Arm SMMUv2 Implementation

2020-05-21 Thread Krishna Reddy
Changes in v5: Rebased on top of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next v4 - https://lkml.org/lkml/2019/10/30/1054 v3 - https://lkml.org/lkml/2019/10/18/1601 v2 - https://lkml.org/lkml/2019/9/2/980 v1 - https://lkml.org/lkml/2019/8/29/1588 Krishna Reddy (5):

[PATCH v5 4/5] arm64: tegra: Add DT node for T194 SMMU

2020-05-21 Thread Krishna Reddy
Add DT node for T194 SMMU to enable SMMU support. Signed-off-by: Krishna Reddy --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 77 1 file changed, 77 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index

[PATCH v5 2/5] dt-bindings: arm-smmu: Add binding for Tegra194 SMMU

2020-05-21 Thread Krishna Reddy
Add binding for NVIDIA's Tegra194 Soc SMMU that is based on ARM MMU-500. Signed-off-by: Krishna Reddy --- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml

Re: [PATCH 10/12] of/irq: Make of_msi_map_rid() PCI bus agnostic

2020-05-21 Thread Rob Herring
On Thu, May 21, 2020 at 7:00 AM Lorenzo Pieralisi wrote: > > There is nothing PCI bus specific in the of_msi_map_rid() > implementation other than the requester ID tag for the input > ID space. Rename requester ID to a more generic ID so that > the translation code can be used by all busses that

Re: [PATCH 09/12] dt-bindings: arm: fsl: Add msi-map device-tree binding for fsl-mc bus

2020-05-21 Thread Rob Herring
On Thu, May 21, 2020 at 7:00 AM Lorenzo Pieralisi wrote: > > From: Laurentiu Tudor > > The existing bindings cannot be used to specify the relationship > between fsl-mc devices and GIC ITSes. > > Add a generic binding for mapping fsl-mc devices to GIC ITSes, using > msi-map property. > >

Re: [PATCH 07/12] of/device: Add input id to of_dma_configure()

2020-05-21 Thread Rob Herring
On Thu, May 21, 2020 at 7:00 AM Lorenzo Pieralisi wrote: > > Devices sitting on proprietary busses have a device ID space that > is owned by the respective bus and related firmware bindings. In order > to let the generic OF layer handle the input translations to > an IOMMU id, for such busses the

Re: [PATCH 06/12] of/iommu: Make of_map_rid() PCI agnostic

2020-05-21 Thread Rob Herring
On Thu, May 21, 2020 at 7:00 AM Lorenzo Pieralisi wrote: > > There is nothing PCI specific (other than the RID - requester ID) > in the of_map_rid() implementation, so the same function can be > reused for input/output IDs mapping for other busses just as well. > > Rename the RID instances/names

[PATCH -next] iommu/vt-d: fix a GCC warning

2020-05-21 Thread Qian Cai
The commit 6ee1b77ba3ac ("iommu/vt-d: Add svm/sva invalidate function") introduced a GCC warning, drivers/iommu/intel-iommu.c:5330:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration] const static int ^ Signed-off-by: Qian Cai --- drivers/iommu/intel-iommu.c

Re: [PATCH] iommu/dma: limit iova free size to unmmaped iova

2020-05-21 Thread Robin Murphy
On 2020-05-21 12:30, Prakash Gupta wrote: Limit the iova size while freeing based on unmapped size. In absence of this even with unmap failure, invalid iova is pushed to iova rcache and subsequently can cause panic while rcache magazine is freed. Can you elaborate on that panic?

Re: [PATCH 02/12] ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic

2020-05-21 Thread Bjorn Helgaas
On Thu, May 21, 2020 at 01:59:58PM +0100, Lorenzo Pieralisi wrote: > iort_get_device_domain() is PCI specific but it need not be, > since it can be used to retrieve IRQ domain nexus of any kind > by adding an irq_domain_bus_token input to it. > > Make it PCI agnostic by also renaming the

Re: [PATCH 08/12] of/irq: make of_msi_map_get_device_domain() bus agnostic

2020-05-21 Thread Bjorn Helgaas
On Thu, May 21, 2020 at 02:00:04PM +0100, Lorenzo Pieralisi wrote: > From: Diana Craciun > > of_msi_map_get_device_domain() is PCI specific but it need not be and > can be easily changed to be bus agnostic in order to be used by other > busses by adding an IRQ domain bus token as an input

Re: [PATCH] iommu/dma: limit iova free size to unmmaped iova

2020-05-21 Thread Andrew Morton
On Thu, 21 May 2020 17:00:04 +0530 Prakash Gupta wrote: > Limit the iova size while freeing based on unmapped size. In absence of > this even with unmap failure, invalid iova is pushed to iova rcache and > subsequently can cause panic while rcache magazine is freed. > > Signed-off-by: Prakash

Re: [PATCH 2/2] dt-bindings: arm-smmu: Add sc7180 compatible string

2020-05-21 Thread Will Deacon
On Mon, May 18, 2020 at 01:59:49PM -0700, Doug Anderson wrote: > On Mon, May 18, 2020 at 7:39 AM Will Deacon wrote: > > On Fri, May 15, 2020 at 12:05:39PM -0700, Doug Anderson wrote: > > > On Fri, May 1, 2020 at 3:30 AM Sharat Masetty > > > wrote: > > > > > > > > This patch simply adds a new

[GIT PULL] iommu/arm-smmu: Updates for 5.8

2020-05-21 Thread Will Deacon
Hi Joerg, Please pull these Arm SMMU updates for 5.8. The branch is based on your 'core' branch from a little while ago. Summary in the tag. Cheers, Will --->8 The following changes since commit 1b032ec1ecbce6047af7d11c9db432e237cb17d8: iommu: Unexport iommu_group_get_for_dev()

Re: [PATCH 12/12] bus: fsl-mc: Add ACPI support for fsl-mc

2020-05-21 Thread Laurentiu Tudor
Hi Lorenzo, On 5/21/2020 4:00 PM, Lorenzo Pieralisi wrote: > From: Diana Craciun > > Add ACPI support in the fsl-mc driver. Driver parses MC DSDT table to > extract memory and other resources. > > Interrupt (GIC ITS) information is extracted from the MADT table > by

Re: [PATCH v7 13/24] iommu/arm-smmu-v3: Enable broadcast TLB maintenance

2020-05-21 Thread Marc Zyngier
On 2020-05-21 15:17, Will Deacon wrote: [+Marc] On Tue, May 19, 2020 at 07:54:51PM +0200, Jean-Philippe Brucker wrote: The SMMUv3 can handle invalidation targeted at TLB entries with shared ASIDs. If the implementation supports broadcast TLB maintenance, enable it and keep track of it in a

[PATCH] iommu/dma: limit iova free size to unmmaped iova

2020-05-21 Thread Prakash Gupta
Limit the iova size while freeing based on unmapped size. In absence of this even with unmap failure, invalid iova is pushed to iova rcache and subsequently can cause panic while rcache magazine is freed. Signed-off-by: Prakash Gupta :100644 100644 4959f5df21bd 098f7d377e04 M

Re: [PATCH v7 13/24] iommu/arm-smmu-v3: Enable broadcast TLB maintenance

2020-05-21 Thread Will Deacon
[+Marc] On Tue, May 19, 2020 at 07:54:51PM +0200, Jean-Philippe Brucker wrote: > The SMMUv3 can handle invalidation targeted at TLB entries with shared > ASIDs. If the implementation supports broadcast TLB maintenance, enable it > and keep track of it in a feature bit. The SMMU will then be

Re: [PATCH v7 00/24] iommu: Shared Virtual Addressing for SMMUv3

2020-05-21 Thread Will Deacon
On Thu, May 21, 2020 at 11:35:14AM +0100, Will Deacon wrote: > On Tue, May 19, 2020 at 07:54:38PM +0200, Jean-Philippe Brucker wrote: > > Shared Virtual Addressing (SVA) allows to share process page tables with > > devices using the IOMMU, PASIDs and I/O page faults. Add SVA support to > > the Arm

Re: [PATCH v7 14/24] iommu/arm-smmu-v3: Add SVA feature checking

2020-05-21 Thread Will Deacon
On Tue, May 19, 2020 at 07:54:52PM +0200, Jean-Philippe Brucker wrote: > Aggregate all sanity-checks for sharing CPU page tables with the SMMU > under a single ARM_SMMU_FEAT_SVA bit. For PCIe SVA, users also need to > check FEAT_ATS and FEAT_PRI. For platform SVA, they will most likely have > to

Re: [PATCH v7 07/24] iommu/io-pgtable-arm: Move some definitions to a header

2020-05-21 Thread Will Deacon
On Tue, May 19, 2020 at 07:54:45PM +0200, Jean-Philippe Brucker wrote: > Extract some of the most generic TCR defines, so they can be reused by > the page table sharing code. > > Signed-off-by: Jean-Philippe Brucker > --- > drivers/iommu/io-pgtable-arm.h | 30 ++ >

Re: [PATCH v7 12/24] iommu/arm-smmu-v3: Add support for VHE

2020-05-21 Thread Will Deacon
On Tue, May 19, 2020 at 07:54:50PM +0200, Jean-Philippe Brucker wrote: > ARMv8.1 extensions added Virtualization Host Extensions (VHE), which allow > to run a host kernel at EL2. When using normal DMA, Device and CPU address > spaces are dissociated, and do not need to implement the same >

[PATCH 06/12] of/iommu: Make of_map_rid() PCI agnostic

2020-05-21 Thread Lorenzo Pieralisi
There is nothing PCI specific (other than the RID - requester ID) in the of_map_rid() implementation, so the same function can be reused for input/output IDs mapping for other busses just as well. Rename the RID instances/names to a generic "id" tag and provide an of_map_rid() wrapper function so

[PATCH 04/12] ACPI/IORT: Remove useless PCI bus walk

2020-05-21 Thread Lorenzo Pieralisi
The PCI bus domain number (used in the iort_match_node_callback() - pci_domain_nr() call) is cascaded through the PCI bus hierarchy at PCI bus enumeration time, therefore there is no need in iort_find_dev_node() to walk the PCI bus upwards to grab the root bus to be passed to iort_scan_node(), the

[PATCH 03/12] ACPI/IORT: Make iort_msi_map_rid() PCI agnostic

2020-05-21 Thread Lorenzo Pieralisi
There is nothing PCI specific in iort_msi_map_rid(). Make it a generic function, iort_msi_map_id() and provide a stub for iort_msi_map_rid() on top of it to keep current users unchanged. Signed-off-by: Lorenzo Pieralisi Cc: Will Deacon Cc: Hanjun Guo Cc: Sudeep Holla Cc: Catalin Marinas Cc:

[PATCH 05/12] ACPI/IORT: Add an input ID to acpi_dma_configure()

2020-05-21 Thread Lorenzo Pieralisi
Some HW devices are created as child devices of proprietary busses, that have a bus specific policy definining how the child devices wires representing the devices ID are translated into IOMMU and IRQ controllers device IDs. Current IORT code provides translations for: - PCI devices, where the

[PATCH 12/12] bus: fsl-mc: Add ACPI support for fsl-mc

2020-05-21 Thread Lorenzo Pieralisi
From: Diana Craciun Add ACPI support in the fsl-mc driver. Driver parses MC DSDT table to extract memory and other resources. Interrupt (GIC ITS) information is extracted from the MADT table by drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c. IORT table is parsed to configure DMA. Signed-off-by:

[PATCH 00/12] ACPI/OF: Upgrade MSI/IOMMU ID mapping APIs

2020-05-21 Thread Lorenzo Pieralisi
Firmware bindings provided in the ACPI IORT table[1] and device tree bindings define rules to carry out input/output ID mappings - ie retrieving an IOMMU/MSI controller input ID for a device with a given ID. At the moment these firmware bindings are used exclusively for PCI devices and their

[PATCH 10/12] of/irq: Make of_msi_map_rid() PCI bus agnostic

2020-05-21 Thread Lorenzo Pieralisi
There is nothing PCI bus specific in the of_msi_map_rid() implementation other than the requester ID tag for the input ID space. Rename requester ID to a more generic ID so that the translation code can be used by all busses that require input/output ID translations. Leave a wrapper function

[PATCH 08/12] of/irq: make of_msi_map_get_device_domain() bus agnostic

2020-05-21 Thread Lorenzo Pieralisi
From: Diana Craciun of_msi_map_get_device_domain() is PCI specific but it need not be and can be easily changed to be bus agnostic in order to be used by other busses by adding an IRQ domain bus token as an input parameter. Signed-off-by: Diana Craciun Signed-off-by: Lorenzo Pieralisi Cc:

[PATCH 02/12] ACPI/IORT: Make iort_get_device_domain IRQ domain agnostic

2020-05-21 Thread Lorenzo Pieralisi
iort_get_device_domain() is PCI specific but it need not be, since it can be used to retrieve IRQ domain nexus of any kind by adding an irq_domain_bus_token input to it. Make it PCI agnostic by also renaming the requestor ID input to a more generic ID name. Signed-off-by: Lorenzo Pieralisi Cc:

[PATCH 01/12] ACPI/IORT: Make iort_match_node_callback walk the ACPI namespace for NC

2020-05-21 Thread Lorenzo Pieralisi
When the iort_match_node_callback is invoked for a named component the match should be executed upon a device with an ACPI companion. For devices with no ACPI companion set-up the ACPI device tree must be walked in order to find the first parent node with a companion set and check the parent node

[PATCH 09/12] dt-bindings: arm: fsl: Add msi-map device-tree binding for fsl-mc bus

2020-05-21 Thread Lorenzo Pieralisi
From: Laurentiu Tudor The existing bindings cannot be used to specify the relationship between fsl-mc devices and GIC ITSes. Add a generic binding for mapping fsl-mc devices to GIC ITSes, using msi-map property. Signed-off-by: Laurentiu Tudor Cc: Rob Herring ---

[PATCH 11/12] bus/fsl-mc: Refactor the MSI domain creation in the DPRC driver

2020-05-21 Thread Lorenzo Pieralisi
From: Diana Craciun The DPRC driver is not taking into account the msi-map property and assumes that the icid is the same as the stream ID. Although this assumption is correct, generalize the code to include a translation between icid and streamID. Furthermore do not just copy the MSI domain

[PATCH 07/12] of/device: Add input id to of_dma_configure()

2020-05-21 Thread Lorenzo Pieralisi
Devices sitting on proprietary busses have a device ID space that is owned by the respective bus and related firmware bindings. In order to let the generic OF layer handle the input translations to an IOMMU id, for such busses the current of_dma_configure() interface should be extended in order to

Re: [PATCH v7 18/24] iommu/arm-smmu-v3: Add support for Hardware Translation Table Update

2020-05-21 Thread Will Deacon
On Tue, May 19, 2020 at 07:54:56PM +0200, Jean-Philippe Brucker wrote: > If the SMMU supports it and the kernel was built with HTTU support, > enable hardware update of access and dirty flags. This is essential for > shared page tables, to reduce the number of access faults on the fault > queue.

Re: [PATCH v7 00/24] iommu: Shared Virtual Addressing for SMMUv3

2020-05-21 Thread Will Deacon
Hi Jean-Philippe, On Tue, May 19, 2020 at 07:54:38PM +0200, Jean-Philippe Brucker wrote: > Shared Virtual Addressing (SVA) allows to share process page tables with > devices using the IOMMU, PASIDs and I/O page faults. Add SVA support to > the Arm SMMUv3 driver. > > Since v6 [1]: > * Rename

Re: [PATCH v2 3/4] iommu/arm-smmu-v3: Use pci_ats_supported()

2020-05-21 Thread Will Deacon
On Wed, May 20, 2020 at 05:22:02PM +0200, Jean-Philippe Brucker wrote: > The new pci_ats_supported() function checks if a device supports ATS and > is allowed to use it. > > Signed-off-by: Jean-Philippe Brucker > --- > drivers/iommu/arm-smmu-v3.c | 20 +++- > 1 file changed, 7

Re: [PATCH 09/15] device core: Add ability to handle multiple dma offsets

2020-05-21 Thread Christoph Hellwig
On Wed, May 20, 2020 at 03:36:16PM -0700, Dan Williams wrote: > Certainly blindly cc'ing everyone recommended by > scripts/get_maintainers.pl is overkill, but finding that subset is a > bit of an art. Yes. But I'd rather be not Cced and just find the complete thread on a list. But all the lists