Re: [PATCH] iommu/vt-d: Fix sysfs leak in alloc_domain()

2021-05-21 Thread Lu Baolu
Hi Joerg, On 5/21/21 2:53 PM, Rolf Eike Beer wrote: Am Donnerstag, 22. April 2021, 07:34:17 CEST schrieb Lu Baolu: Hi Rolf, On 4/22/21 1:39 PM, Rolf Eike Beer wrote: iommu_device_sysfs_add() is called before, so is has to be cleaned on subsequent errors. Fixes: 39ab9555c2411 ("iommu: Add sys

Re: [RFC PATCH v3 8/8] vfio: Add nested IOPF support

2021-05-21 Thread Shenming Lu
On 2021/5/19 2:58, Alex Williamson wrote: > On Fri, 9 Apr 2021 11:44:20 +0800 > Shenming Lu wrote: > >> To set up nested mode, drivers such as vfio_pci need to register a >> handler to receive stage/level 1 faults from the IOMMU, but since >> currently each device can only have one iommu dev faul

[PATCH v5 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) d

[PATCH v5 0/4] Add IOMMU driver for rk356x

2021-05-21 Thread Benjamin Gaignard
This series adds the IOMMU driver for rk356x SoC. Since a new compatible is needed to distinguish this second version of IOMMU hardware block from the first one, it is an opportunity to convert the binding to DT schema. version 5: - Add internal ops inside the driver to be able to add variants.

[PATCH v5 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-21 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions(+), 38 deletions(-) delete mode

[PATCH v5 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard --- version 5: - Use internal ops to support v2 hardware blo

[PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of this hardware block. The ops are global for a SoC because iommu domains are not attached to a specific devices if they are for a virtuel device

Re: [PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Heiko Stübner
Am Freitag, 21. Mai 2021, 10:36:36 CEST schrieb Benjamin Gaignard: > Add internal ops to be able to handle incoming variant v2. > The goal is to keep the overall structure of the framework but > to allow to add the evolution of this hardware block. > > The ops are global for a SoC because iommu do

Re: [PATCH v5 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Heiko Stübner
Am Freitag, 21. Mai 2021, 10:36:37 CEST schrieb Benjamin Gaignard: > This second version of the hardware block has a different bits > mapping for page table entries. > Add the ops matching to this new mapping. > Define a new compatible to distinguish it from the first version. > > Signed-off-by: B

Re: [PATCH v5 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Heiko Stübner
Am Freitag, 21. Mai 2021, 10:36:35 CEST schrieb Benjamin Gaignard: > Add compatible for the second version of IOMMU hardware block. > RK356x IOMMU can also be link to a power domain. > > Signed-off-by: Benjamin Gaignard > Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner > --- > .../devic

Re: [PATCH v5 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-21 Thread Heiko Stübner
Am Freitag, 21. Mai 2021, 10:36:34 CEST schrieb Benjamin Gaignard: > Convert Rockchip IOMMU to DT schema > > Signed-off-by: Benjamin Gaignard > Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner ___ iommu mailing list iommu@lists.linux-foundatio

Re: [PATCH] dma-iommu: Add a check to avoid dereference null pointer in function iommu_dma_map_sg()

2021-05-21 Thread Robin Murphy
On 2021-05-21 04:05, chenxiang wrote: From: Xiang Chen The issue is reported by tool TscanCode, and it is possible to deference null pointer when prev is NULL which is the initial value. No it isn't. This is literally explained in the comment visible in the diff context below... Robin. S

Re: [PATCH v5 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Robin Murphy
On 2021-05-21 09:36, Benjamin Gaignard wrote: Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++-

Re: [PATCH] dma-iommu: Add a check to avoid dereference null pointer in function iommu_dma_map_sg()

2021-05-21 Thread chenxiang (M)
在 2021/5/21 18:36, Robin Murphy 写道: On 2021-05-21 04:05, chenxiang wrote: From: Xiang Chen The issue is reported by tool TscanCode, and it is possible to deference null pointer when prev is NULL which is the initial value. No it isn't. This is literally explained in the comment visible in

Re: [PATCH v4 0/8] ACPI/IORT: Support for IORT RMR node

2021-05-21 Thread Steven Price
On 13/05/2021 14:45, Shameer Kolothum wrote: > Hi, > > v3 -->v4 > -Included the SMMUv2 SMR bypass install changes suggested by > Steve(patch #7) > -As per Robin's comments, RMR reserve implementation is now > more generic (patch #8) and dropped v3 patches 8 and 10. > -Rebase to 5.13-rc1  > > T

Re: [PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Robin Murphy
On 2021-05-21 09:36, Benjamin Gaignard wrote: Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of this hardware block. The ops are global for a SoC because iommu domains are not attached to a s

RE: [PATCH v4 0/8] ACPI/IORT: Support for IORT RMR node

2021-05-21 Thread Shameerali Kolothum Thodi
> -Original Message- > From: Steven Price [mailto:steven.pr...@arm.com] > Sent: 21 May 2021 13:55 > To: Shameerali Kolothum Thodi ; > linux-arm-ker...@lists.infradead.org; linux-a...@vger.kernel.org; > iommu@lists.linux-foundation.org > Cc: Linuxarm ; lorenzo.pieral...@arm.com; > j...@8by

Re: [PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
Le 21/05/2021 à 14:58, Robin Murphy a écrit : On 2021-05-21 09:36, Benjamin Gaignard wrote: Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of this hardware block. The ops are global for a S

[PATCH v6 0/4] Add IOMMU driver for rk356x

2021-05-21 Thread Benjamin Gaignard
This series adds the IOMMU driver for rk356x SoC. Since a new compatible is needed to distinguish this second version of IOMMU hardware block from the first one, it is an opportunity to convert the binding to DT schema. version 6: - Remove #include - Remove pt_address_mask field - Only use on

[PATCH v6 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Benjamin Gaignard
Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of this hardware block. The ops are global for a SoC because iommu domains are not attached to a specific devices if they are for a virtuel device

[PATCH v6 1/4] dt-bindings: iommu: rockchip: Convert IOMMU to DT schema

2021-05-21 Thread Benjamin Gaignard
Convert Rockchip IOMMU to DT schema Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../bindings/iommu/rockchip,iommu.txt | 38 - .../bindings/iommu/rockchip,iommu.yaml| 80 +++ 2 files changed, 80 insertions(+),

[PATCH v6 2/4] dt-bindings: iommu: rockchip: Add compatible for v2

2021-05-21 Thread Benjamin Gaignard
Add compatible for the second version of IOMMU hardware block. RK356x IOMMU can also be link to a power domain. Signed-off-by: Benjamin Gaignard Reviewed-by: Rob Herring Reviewed-by: Heiko Stuebner --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 7 ++- 1 file changed, 6 in

[PATCH v6 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Benjamin Gaignard
This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard Reviewed-by: Heiko Stuebner --- version 5: - Use internal o

Re: [PATCH v5 4/4] iommu: rockchip: Add support for iommu v2

2021-05-21 Thread Robin Murphy
On 2021-05-21 09:36, Benjamin Gaignard wrote: This second version of the hardware block has a different bits mapping for page table entries. Add the ops matching to this new mapping. Define a new compatible to distinguish it from the first version. Signed-off-by: Benjamin Gaignard --- version 5

[PATCH] iommu/rockchip: Remove redundant DMA syncs

2021-05-21 Thread Robin Murphy
When we allocate new pagetable pages, we don't modify them between the initial dma_map_single() call and the dma_sync_single_for_device() call via rk_iommu_flush(), so the latter is entirely pointless. Signed-off-by: Robin Murphy --- drivers/iommu/rockchip-iommu.c | 3 --- 1 file changed, 3 dele

Re: [PATCH v5 3/4] iommu: rockchip: Add internal ops to handle variants

2021-05-21 Thread Robin Murphy
On 2021-05-21 14:38, Benjamin Gaignard wrote: Le 21/05/2021 à 14:58, Robin Murphy a écrit : On 2021-05-21 09:36, Benjamin Gaignard wrote: Add internal ops to be able to handle incoming variant v2. The goal is to keep the overall structure of the framework but to allow to add the evolution of t

Re: [PATCH v2 3/6] ACPI: Add driver for the VIOT table

2021-05-21 Thread Rafael J. Wysocki
On Fri, Apr 23, 2021 at 1:57 PM Jean-Philippe Brucker wrote: > > The ACPI Virtual I/O Translation Table describes topology of > para-virtual platforms, similarly to vendor tables DMAR, IVRS and IORT. > For now it describes the relation between virtio-iommu and the endpoints > it manages. > > Three

Re: [PATCH v2 2/6] ACPI: Move IOMMU setup code out of IORT

2021-05-21 Thread Rafael J. Wysocki
On Fri, Apr 23, 2021 at 1:57 PM Jean-Philippe Brucker wrote: > > Some of the IOMMU setup code in IORT is fairly generic and can be reused > by VIOT. Extract it from IORT. Except that iort_iommu_configure_id() is not really generic AFAICS. ___ iommu mail

Re: [PATCH v4] iommu/of: Fix pci_request_acs() before enumerating PCI devices

2021-05-21 Thread Rob Herring
On Thu, May 20, 2021 at 10:03 PM Wang Xingang wrote: > > From: Xingang Wang > > When booting with devicetree, the pci_request_acs() is called after the > enumeration and initialization of PCI devices, thus the ACS is not > enabled. And ACS should be enabled when IOMMU is detected for the > PCI ho

Re: [PATCH 1/2] irqchip/qcom-pdc: Switch to IRQCHIP_PLATFORM_DRIVER and allow as a module

2021-05-21 Thread Greg Kroah-Hartman
On Tue, May 18, 2021 at 09:19:21PM +, John Stultz wrote: > From: Saravana Kannan > > This patch revives changes from Saravana Kannan to switch the > qcom-pdc driver to use IRQCHIP_PLATFORM_DRIVER helper macros, > and allows qcom-pdc driver to be loaded as a permanent module. > > Earlier atte

Re: [PATCH 2/2] firmware: QCOM_SCM: Allow qcom_scm driver to be loadable as a permenent module

2021-05-21 Thread Greg Kroah-Hartman
On Tue, May 18, 2021 at 09:19:22PM +, John Stultz wrote: > Allow the qcom_scm driver to be loadable as a permenent module. > > This still uses the "depends on QCOM_SCM || !QCOM_SCM" bit to > ensure that drivers that call into the qcom_scm driver are > also built as modules. While not ideal in

Re: [PATCH 01/11] iommu/vt-d: Add pasid private data helpers

2021-05-21 Thread Jacob Pan
Hi BaoLu, On Thu, 20 May 2021 11:15:21 +0800, Lu Baolu wrote: > We are about to use iommu_sva_alloc/free_pasid() helpers in iommu core. > That means the pasid life cycle will be managed by iommu core. Use a > local array to save the per pasid private data instead of attaching it > the real pasid