[PATCHv3 1/2] iommu/arm-smmu-qcom: Add SC7280 SMMU compatible

2021-04-20 Thread Sai Prakash Ranjan
Add compatible for SC7280 SMMU to use the Qualcomm Technologies, Inc. specific implementation. Signed-off-by: Sai Prakash Ranjan --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c

[PATCHv3 0/2] iommu/arm-smmu-qcom: Add SC7280 support

2021-04-20 Thread Sai Prakash Ranjan
Patch 1 adds the sc7280 smmu compatible. Patch 2 moves the adreno smmu check before apss smmu to enable adreno smmu specific implementation. Note that dt-binding for sc7280 is already merged. Changes in v3: * Collect acks and reviews * Rebase on top of for-joerg/arm-smmu/updates Changes in

[PATCHv3 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl earlier

2021-04-20 Thread Sai Prakash Ranjan
Adreno(GPU) SMMU and APSS(Application Processor SubSystem) SMMU both implement "arm,mmu-500" in some QTI SoCs and to run through adreno smmu specific implementation such as enabling split pagetables support, we need to match the "qcom,adreno-smmu" compatible first before apss smmu or else we will

Re: [PATCHv2 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl earlier

2021-04-20 Thread Sai Prakash Ranjan
On 2021-04-19 20:08, Bjorn Andersson wrote: On Fri 26 Feb 03:55 CST 2021, Sai Prakash Ranjan wrote: Adreno(GPU) SMMU and APSS(Application Processor SubSystem) SMMU both implement "arm,mmu-500" in some QTI SoCs and to run through adreno smmu specific implementation such as enabling split

Re: [PATCH] pci: Rename pci_dev->untrusted to pci_dev->external

2021-04-20 Thread Christoph Hellwig
On Mon, Apr 19, 2021 at 05:30:49PM -0700, Rajat Jain wrote: > The current flag name "untrusted" is not correct as it is populated > using the firmware property "external-facing" for the parent ports. In > other words, the firmware only says which ports are external facing, so > the field really

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: > Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, > The IPU driver allocates its own page table that is not mapped > via the DMA, and thus the Intel IOMMU driver blocks access giving > this error: > > DMAR: DRHD: handling

Re: [PATCH v3 04/10] iommu/dma: Add a helper function to reserve RMRs for IOMMU drivers

2021-04-20 Thread kernel test robot
Hi Shameer, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on pm/linux-next] [also build test WARNING on arm/for-next soc/for-next arm64/for-next/core linus/master v5.12-rc8] [cannot apply to iommu/next xlnx/master next-20210420] [If your patch is applied

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-20 Thread Suthikulpanit, Suravee
David / Joerg, On 4/10/2021 5:03 PM, David Coe wrote: The immediately obvious difference is the with the enormous count seen on mem_dte_mis on the older Ryzen 2400G. Will do some RTFM but anyone with  comments and insight? 841,689,151,202,939   amd_iommu_0/mem_dte_mis/  

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: > Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, > The IPU driver allocates its own page table that is not mapped > via the DMA, and thus the Intel IOMMU driver blocks access giving > this error: > > DMAR: DRHD: handling

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Bingbu Cao
Andy, On 4/20/21 6:20 PM, Andy Shevchenko wrote: > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: >> Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, >> The IPU driver allocates its own page table that is not mapped >> via the DMA, and thus the Intel IOMMU driver blocks

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-20 Thread Péter Ujfalusi
Hi Alice, On 4/19/21 7:27 AM, Alice Guo (OSS) wrote: > From: Alice Guo > > Update all the code that use soc_device_match because add support for > soc_device_match returning -EPROBE_DEFER. > > Signed-off-by: Alice Guo > --- > drivers/bus/ti-sysc.c | 2 +- >

Re: [RFC v1 PATCH 1/3] drivers: soc: add support for soc_device_match returning -EPROBE_DEFER

2021-04-20 Thread Dan Carpenter
On Mon, Apr 19, 2021 at 10:20:13AM +0200, Geert Uytterhoeven wrote: > Hi Alice, > > CC Arnd (soc_device_match() author) > > On Mon, Apr 19, 2021 at 6:28 AM Alice Guo (OSS) wrote: > > From: Alice Guo > > > > In i.MX8M boards, the registration of SoC device is later than caam > > driver which

Re: swiotlb cleanups v3

2021-04-20 Thread Christoph Hellwig
On Sat, Apr 17, 2021 at 11:39:22AM -0500, Tom Lendacky wrote: > Somewhere between the 1st and 2nd patch, specifying a specific swiotlb > for an SEV guest is no longer honored. For example, if I start an SEV > guest with 16GB of memory and specify swiotlb=131072 I used to get a > 256MB SWIOTLB.

Re: [PATCH 2/2] iommu/amd: Remove performance counter pre-initialization test

2021-04-20 Thread Alexander Monakov
On Tue, 20 Apr 2021, Suthikulpanit, Suravee wrote: > David / Joerg, > > On 4/10/2021 5:03 PM, David Coe wrote: > > > > The immediately obvious difference is the with the enormous count seen on > > mem_dte_mis on the older Ryzen 2400G. Will do some RTFM but anyone > > with comments and insight?

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-20 Thread Arnd Bergmann
On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET wrote: > Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > > For built-in drivers, load order depends on the initcall level and > > link order (how things are lined listed in the Makefile hierarchy). > > > > For loadable modules,

[PATCH v3 00/10] ACPI/IORT: Support for IORT RMR node

2021-04-20 Thread Shameer Kolothum
Hi, RFC v2 --> v3 -Dropped RFC tag as the ACPICA header changes are now ready to be part of 5.13[0]. But this series still has a dependency on that patch. -Added IORT E.b related changes(node flags, _DSM function 5 checks for PCIe). -Changed RMR to stream id mapping from M:N to M:1 as per

[PATCH v3 01/10] ACPI/IORT: Add support for RMR node parsing

2021-04-20 Thread Shameer Kolothum
Add support for parsing RMR node information from ACPI. Find associated stream id and smmu node info from the RMR node and populate a linked list with RMR memory descriptors. Signed-off-by: Shameer Kolothum --- drivers/acpi/arm64/iort.c | 104 +- 1 file

[PATCH v3 02/10] iommu/dma: Introduce generic helper to retrieve RMR info

2021-04-20 Thread Shameer Kolothum
Reserved Memory Regions(RMR) associated with an IOMMU may be described either through ACPI tables or DT in systems with devices that require a unity mapping or bypass for those regions in IOMMU drivers. Introduce a generic interface so that IOMMU drivers can retrieve and set up necessary

[PATCH v3 03/10] ACPI/IORT: Add a helper to retrieve RMR memory regions

2021-04-20 Thread Shameer Kolothum
Add a helper function that retrieves RMR memory descriptors associated with a given IOMMU. This will be used by IOMMU drivers to setup necessary mappings. Now that we have this, invoke this from the generic helper interface. Signed-off-by: Shameer Kolothum --- drivers/acpi/arm64/iort.c | 40

[PATCH v3 05/10] iommu/arm-smmu-v3: Introduce strtab init helper

2021-04-20 Thread Shameer Kolothum
Introduce a helper to check the sid range and to init the l2 strtab entries(bypass). This will be useful when we have to initialize the l2 strtab with bypass for RMR SIDs. Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 26 - 1 file changed,

[PATCH v3 06/10] iommu/arm-smmu-v3: Add bypass flag to arm_smmu_write_strtab_ent()

2021-04-20 Thread Shameer Kolothum
By default, disable_bypass is set and any dev without an iommu domain installs STE with CFG_ABORT during arm_smmu_init_bypass_stes(). Introduce a "bypass" flag to arm_smmu_write_strtab_ent() so that we can force it to install CFG_BYPASS STE for specific SIDs. This will be useful for RMR related

[PATCH v3 04/10] iommu/dma: Add a helper function to reserve RMRs for IOMMU drivers

2021-04-20 Thread Shameer Kolothum
IOMMU drivers can use this to implement their .get_resv_regions callback for any RMR address regions specific to a device. As per ACPI IORT E.b spec, a check is added to make sure OS has preserved the PCIe configuration done by boot firmware. Signed-off-by: Shameer Kolothum ---

Re: [PATCH v3 02/12] iommu: Add iommu_split_block interface

2021-04-20 Thread Lu Baolu
On 4/20/21 3:32 PM, Keqian Zhu wrote: Hi Baolu, Cheers for the your quick reply. On 2021/4/20 10:09, Lu Baolu wrote: Hi Keqian, On 4/20/21 9:25 AM, Keqian Zhu wrote: Hi Baolu, On 2021/4/19 21:33, Lu Baolu wrote: Hi Keqian, On 2021/4/19 17:32, Keqian Zhu wrote:

[PATCH v3 07/10] iommu/arm-smmu-v3: Get associated RMR info and install bypass STE

2021-04-20 Thread Shameer Kolothum
Check if there is any RMR info associated with the devices behind the SMMUv3 and if any, install bypass STEs for them. This is to keep any ongoing traffic associated with these devices alive when we enable/reset SMMUv3 during probe(). Signed-off-by: Shameer Kolothum ---

[PATCH v3 08/10] iommu/arm-smmu-v3: Reserve any RMR regions associated with a dev

2021-04-20 Thread Shameer Kolothum
Get RMR regions associated with a dev reserved so that there is a unity mapping for them in SMMU. Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 29 + 1 file changed, 29 insertions(+) diff --git

[PATCH v3 09/10] iommu/arm-smmu: Get associated RMR info and install bypass SMR

2021-04-20 Thread Shameer Kolothum
From: Jon Nettleton Check if there is any RMR info associated with the devices behind the SMMU and if any, install bypass SMRs for them. This is to keep any ongoing traffic associated with these devices alive when we enable/reset SMMU during probe(). Signed-off-by: Jon Nettleton Signed-off-by:

[PATCH v3 10/10] iommu/arm-smmu: Reserve any RMR regions associated with a dev

2021-04-20 Thread Shameer Kolothum
From: Jon Nettleton Get RMR regions associated with a dev reserved so that there is a unity mapping for them in SMMU. Signed-off-by: Jon Nettleton Signed-off-by: Shameer Kolothum --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 33 +++ 1 file changed, 33 insertions(+)

Re: [PATCH v3 02/10] iommu/dma: Introduce generic helper to retrieve RMR info

2021-04-20 Thread kernel test robot
Hi Shameer, Thank you for the patch! Yet something to improve: [auto build test ERROR on pm/linux-next] [also build test ERROR on arm/for-next soc/for-next arm64/for-next/core linus/master v5.12-rc8] [cannot apply to iommu/next xlnx/master next-20210420] [If your patch is applied to the wrong

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-20 Thread Arnd Bergmann
On Tue, Apr 20, 2021 at 1:44 AM Dominique MARTINET wrote: > Arnd Bergmann wrote on Mon, Apr 19, 2021 at 02:16:36PM +0200: > > For built-in drivers, load order depends on the initcall level and > > link order (how things are lined listed in the Makefile hierarchy). > > > > For loadable modules,

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Sakari Ailus
Hi Bingbu, Thanks for the patch. On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: > Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, > The IPU driver allocates its own page table that is not mapped > via the DMA, and thus the Intel IOMMU driver blocks access giving >

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Sakari Ailus
Hi Bingbu, On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > Andy, > > On 4/20/21 6:20 PM, Andy Shevchenko wrote: > > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: > >> Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, > >> The IPU driver allocates its own

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 01:56:40PM +0300, Sakari Ailus wrote: > On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > > On 4/20/21 6:20 PM, Andy Shevchenko wrote: > > > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: ... > > > This misses the changelog from v1 followed by the

Re: [PATCH v3 02/10] iommu/dma: Introduce generic helper to retrieve RMR info

2021-04-20 Thread kernel test robot
Hi Shameer, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on pm/linux-next] [also build test WARNING on arm/for-next soc/for-next arm64/for-next/core linus/master v5.12-rc8] [cannot apply to iommu/next xlnx/master next-20210420] [If your patch is applied

Re: [PATCH v3 02/10] iommu/dma: Introduce generic helper to retrieve RMR info

2021-04-20 Thread kernel test robot
Hi Shameer, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on pm/linux-next] [also build test WARNING on arm/for-next soc/for-next arm64/for-next/core linus/master v5.12-rc8] [cannot apply to iommu/next xlnx/master next-20210420] [If your patch is applied

Re: [PATCH v3 10/10] iommu/arm-smmu: Reserve any RMR regions associated with a dev

2021-04-20 Thread kernel test robot
Hi Shameer, I love your patch! Yet something to improve: [auto build test ERROR on pm/linux-next] [also build test ERROR on arm/for-next soc/for-next arm64/for-next/core linus/master v5.12-rc8] [cannot apply to iommu/next xlnx/master next-20210420] [If your patch is applied to the wrong git

Re: swiotlb cleanups v3

2021-04-20 Thread Tom Lendacky
On 4/20/21 4:23 AM, Christoph Hellwig wrote: > On Sat, Apr 17, 2021 at 11:39:22AM -0500, Tom Lendacky wrote: >> Somewhere between the 1st and 2nd patch, specifying a specific swiotlb >> for an SEV guest is no longer honored. For example, if I start an SEV >> guest with 16GB of memory and specify

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Andy Shevchenko
On Tue, Apr 20, 2021 at 05:37:27PM +0300, Sakari Ailus wrote: > On Tue, Apr 20, 2021 at 02:55:33PM +0300, Andy Shevchenko wrote: > > On Tue, Apr 20, 2021 at 01:56:40PM +0300, Sakari Ailus wrote: > > > On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > > > > On 4/20/21 6:20 PM, Andy

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Sakari Ailus
On Tue, Apr 20, 2021 at 02:55:33PM +0300, Andy Shevchenko wrote: > On Tue, Apr 20, 2021 at 01:56:40PM +0300, Sakari Ailus wrote: > > On Tue, Apr 20, 2021 at 06:34:26PM +0800, Bingbu Cao wrote: > > > On 4/20/21 6:20 PM, Andy Shevchenko wrote: > > > > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu

Re: [PATCH] pci: Rename pci_dev->untrusted to pci_dev->external

2021-04-20 Thread Bjorn Helgaas
On Tue, Apr 20, 2021 at 07:10:06AM +0100, Christoph Hellwig wrote: > On Mon, Apr 19, 2021 at 05:30:49PM -0700, Rajat Jain wrote: > > The current flag name "untrusted" is not correct as it is populated > > using the firmware property "external-facing" for the parent ports. In > > other words, the

Re: [RESEND v2] iommu/vt-d: Use passthrough mode for the Intel IPUs

2021-04-20 Thread Grant Grundler
On Tue, Apr 20, 2021 at 11:02 AM Sakari Ailus wrote: > > Hi Bingbu, > > Thanks for the patch. > > On Tue, Apr 20, 2021 at 10:48:33AM +0800, Bingbu Cao wrote: > > Intel IPU(Image Processing Unit) has its own (IO)MMU hardware, > > The IPU driver allocates its own page table that is not mapped > >

[PATCH v2 10/10] arm64: tegra: Enable SMMU support for display on Tegra194

2021-04-20 Thread Thierry Reding
From: Thierry Reding The display controllers are attached to a separate ARM SMMU instance that is dedicated to servicing isochronous memory clients. Add this ISO instance of the ARM SMMU to device tree and attach all four display controllers to it. Signed-off-by: Thierry Reding ---

[PATCH v2 09/10] arm64: tegra: Enable SMMU support on Tegra194

2021-04-20 Thread Thierry Reding
From: Thierry Reding Add the device tree node for the dual-SMMU found on Tegra194 and hook up peripherals such as host1x, BPMP, HDA, SDMMC, EQOS and VIC. Signed-off-by: Thierry Reding --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 86 1 file changed, 86 insertions(+)

[PATCH v2 07/10] arm64: tegra: Use correct compatible string for Tegra186 SMMU

2021-04-20 Thread Thierry Reding
From: Thierry Reding The SMMU found on Tegra186 requires interoperation with the memory controller in order to program stream ID overrides. The generic ARM SMMU 500 compatible is therefore inaccurate. Replace it with a more correct, SoC-specific compatible string. Signed-off-by: Thierry Reding

[PATCH v2 08/10] arm64: tegra: Hook up memory controller to SMMU on Tegra186

2021-04-20 Thread Thierry Reding
From: Thierry Reding On Tegra186 and later, the memory controller needs to be programmed in coordination with any of the ARM SMMU instances to configure the stream ID used for each memory client. To support this, add a phandle reference to the memory controller to the SMMU device tree node.

[PATCH v2 04/10] iommu/arm-smmu: tegra: Detect number of instances at runtime

2021-04-20 Thread Thierry Reding
From: Thierry Reding Parse the reg property in device tree and detect the number of instances represented by a device tree node. This is subsequently needed in order to support single-instance SMMUs with the Tegra implementation because additional programming is needed to properly configure the

[PATCH v2 06/10] iommu/arm-smmu: Use Tegra implementation on Tegra186

2021-04-20 Thread Thierry Reding
From: Thierry Reding Tegra186 requires the same SID override programming as Tegra194 in order to seamlessly transition from the firmware framebuffer to the Linux framebuffer, so the Tegra implementation needs to be used on Tegra186 devices as well. Signed-off-by: Thierry Reding ---

[PATCH v2 05/10] iommu/arm-smmu: tegra: Implement SID override programming

2021-04-20 Thread Thierry Reding
From: Thierry Reding The secure firmware keeps some SID override registers set as passthrough in order to allow devices such as the display controller to operate with no knowledge of SMMU translations until an operating system driver takes over. This is needed in order to seamlessly transition

[PATCH v2 00/10] arm64: tegra: Prevent early SMMU faults

2021-04-20 Thread Thierry Reding
From: Thierry Reding Hi, this is a set of patches that is the result of earlier discussions regarding early identity mappings that are needed to avoid SMMU faults during early boot. The goal here is to avoid early identity mappings altogether and instead postpone the need for the identity

[PATCH v2 01/10] memory: tegra: Implement SID override programming

2021-04-20 Thread Thierry Reding
From: Thierry Reding Instead of programming all SID overrides during early boot, perform the operation on-demand after the SMMU translations have been set up for a device. This reuses data from device tree to match memory clients for a device and programs the SID specified in device tree, which

[PATCH v2 02/10] dt-bindings: arm-smmu: Add Tegra186 compatible string

2021-04-20 Thread Thierry Reding
From: Thierry Reding The ARM SMMU instantiations found on Tegra186 and later need inter- operation with the memory controller in order to correctly program stream ID overrides. Furthermore, on Tegra194 multiple instances of the SMMU can gang up to achieve higher throughput. In order to do this,

[PATCH v2 03/10] iommu/arm-smmu: Implement ->probe_finalize()

2021-04-20 Thread Thierry Reding
From: Thierry Reding Implement a ->probe_finalize() callback that can be used by vendor implementations to perform extra programming necessary after devices have been attached to the SMMU. Signed-off-by: Thierry Reding --- Changes in v2: -remove unnecessarily paranoid check ---

RE: [PATCH v2 04/10] iommu/arm-smmu: tegra: Detect number of instances at runtime

2021-04-20 Thread Krishna Reddy
>+static const struct arm_smmu_impl nvidia_smmu_single_impl = { >+ .probe_finalize = nvidia_smmu_probe_finalize, >+}; nvidia_smmu_probe_finalize is used before it is defined. It is defined in patch 5. -KR ___ iommu mailing list

Re: [PATCH v3 02/12] iommu: Add iommu_split_block interface

2021-04-20 Thread Keqian Zhu
Hi Baolu, Cheers for the your quick reply. On 2021/4/20 10:09, Lu Baolu wrote: > Hi Keqian, > > On 4/20/21 9:25 AM, Keqian Zhu wrote: >> Hi Baolu, >> >> On 2021/4/19 21:33, Lu Baolu wrote: >>> Hi Keqian, >>> >>> On 2021/4/19 17:32, Keqian Zhu wrote: >> +EXPORT_SYMBOL_GPL(iommu_split_block);