Re: A problem of Intel IOMMU hardware ?

2021-03-26 Thread Lu Baolu
Hi Nadav, On 3/27/21 12:36 PM, Nadav Amit wrote: On Mar 26, 2021, at 7:31 PM, Lu Baolu wrote: Hi Nadav, On 3/19/21 12:46 AM, Nadav Amit wrote: So here is my guess: Intel probably used as a basis for the IOTLB an implementation of some other (regular) TLB design. Intel SDM says regarding

Re: A problem of Intel IOMMU hardware ?

2021-03-26 Thread Nadav Amit
> On Mar 26, 2021, at 7:31 PM, Lu Baolu wrote: > > Hi Nadav, > > On 3/19/21 12:46 AM, Nadav Amit wrote: >> So here is my guess: >> Intel probably used as a basis for the IOTLB an implementation of >> some other (regular) TLB design. >> Intel SDM says regarding TLBs (4.10.4.2 “Recommended

Re: A problem of Intel IOMMU hardware ?

2021-03-26 Thread Lu Baolu
Hi Nadav, On 3/19/21 12:46 AM, Nadav Amit wrote: So here is my guess: Intel probably used as a basis for the IOTLB an implementation of some other (regular) TLB design. Intel SDM says regarding TLBs (4.10.4.2 “Recommended Invalidation”): "Software wishing to prevent this uncertainty should

Re: [PATCH 0/9] arm64: tegra: Prevent early SMMU faults

2021-03-26 Thread Dmitry Osipenko
26.03.2021 19:55, Dmitry Osipenko пишет: > 26.03.2021 19:35, Thierry Reding пишет: >> On Fri, Mar 26, 2021 at 06:29:28PM +0300, Dmitry Osipenko wrote: >>> 25.03.2021 16:03, Thierry Reding пишет: From: Thierry Reding Hi, this is a set of patches that is the result of

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Mark Kettenis
> From: Arnd Bergmann > Date: Fri, 26 Mar 2021 20:59:58 +0100 > > On Fri, Mar 26, 2021 at 6:51 PM Sven Peter wrote: > > On Fri, Mar 26, 2021, at 18:34, Robin Murphy wrote: > > > On 2021-03-26 17:26, Mark Kettenis wrote: > > > > > > > > Anyway, from my viewpoint having the information about the

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Mark Kettenis
> From: Arnd Bergmann > Date: Fri, 26 Mar 2021 21:03:32 +0100 > > On Fri, Mar 26, 2021 at 6:28 PM Mark Kettenis wrote: > > > I haven't figured out how the bypass stuff really works. Corellium > > added support for it in their codebase when they added support for > > Thunderbolt, and some of

[PATCH] dma-mapping: add unlikely hint to error path in dma_mapping_error

2021-03-26 Thread Heiner Kallweit
Zillions of drivers use the unlikely() hint when checking the result of dma_mapping_error(). This is an inline function anyway, so we can move the hint into the function and remove it from drivers over time. Signed-off-by: Heiner Kallweit --- This is a resend of a patch from Dec 2020 when I

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Arnd Bergmann
On Fri, Mar 26, 2021 at 6:28 PM Mark Kettenis wrote: > I haven't figured out how the bypass stuff really works. Corellium > added support for it in their codebase when they added support for > Thunderbolt, and some of the DARTs that seem to be related to > Thunderbolt do indeed have a "bypass"

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Arnd Bergmann
On Fri, Mar 26, 2021 at 6:51 PM Sven Peter wrote: > On Fri, Mar 26, 2021, at 18:34, Robin Murphy wrote: > > On 2021-03-26 17:26, Mark Kettenis wrote: > > > > > > Anyway, from my viewpoint having the information about the IOVA > > > address space sit on the devices makes little sense. This

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Sven Peter via iommu
On Fri, Mar 26, 2021, at 18:34, Robin Murphy wrote: > On 2021-03-26 17:26, Mark Kettenis wrote: > > > > Anyway, from my viewpoint having the information about the IOVA > > address space sit on the devices makes little sense. This information > > is needed by the DART driver, and there is no

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Robin Murphy
On 2021-03-26 17:26, Mark Kettenis wrote: From: Arnd Bergmann Date: Fri, 26 Mar 2021 17:38:24 +0100 On Fri, Mar 26, 2021 at 5:10 PM Sven Peter wrote: On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote: Some of the DARTs provide a bypass facility. That code make using the standard

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Mark Kettenis
> From: Arnd Bergmann > Date: Fri, 26 Mar 2021 17:38:24 +0100 > > On Fri, Mar 26, 2021 at 5:10 PM Sven Peter wrote: > > On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote: > > > Some of the DARTs provide a bypass facility. That code make using the > > > standard "dma-ranges" property tricky.

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Sven Peter via iommu
On Fri, Mar 26, 2021, at 17:38, Arnd Bergmann wrote: > On Fri, Mar 26, 2021 at 5:10 PM Sven Peter wrote: > > On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote: > > > Some of the DARTs provide a bypass facility. That code make using the > > > standard "dma-ranges" property tricky. That

Re: [PATCH 0/9] arm64: tegra: Prevent early SMMU faults

2021-03-26 Thread Dmitry Osipenko
26.03.2021 19:35, Thierry Reding пишет: > On Fri, Mar 26, 2021 at 06:29:28PM +0300, Dmitry Osipenko wrote: >> 25.03.2021 16:03, Thierry Reding пишет: >>> From: Thierry Reding >>> >>> Hi, >>> >>> this is a set of patches that is the result of earlier discussions >>> regarding early identity

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Arnd Bergmann
On Fri, Mar 26, 2021 at 5:10 PM Sven Peter wrote: > On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote: > > Some of the DARTs provide a bypass facility. That code make using the > > standard "dma-ranges" property tricky. That property would need to > > contain the bypass address range. But

Re: [PATCH 0/9] arm64: tegra: Prevent early SMMU faults

2021-03-26 Thread Thierry Reding
On Fri, Mar 26, 2021 at 06:29:28PM +0300, Dmitry Osipenko wrote: > 25.03.2021 16:03, 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 >

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Sven Peter via iommu
On Fri, Mar 26, 2021, at 16:59, Mark Kettenis wrote: > Some of the DARTs provide a bypass facility. That code make using the > standard "dma-ranges" property tricky. That property would need to > contain the bypass address range. But that would mean that if the > DART driver needs to look at

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Arnd Bergmann
On Fri, Mar 26, 2021 at 4:59 PM Mark Kettenis wrote: > > > From: Arnd Bergmann > > Date: Thu, 25 Mar 2021 22:41:09 +0100 > > > > On Thu, Mar 25, 2021 at 8:53 AM Sven Peter wrote: > > > On Tue, Mar 23, 2021, at 21:53, Rob Herring wrote: > > > > > > I'm probably just confused or maybe the

Re: [PATCH 0/3] Apple M1 DART IOMMU driver

2021-03-26 Thread Mark Kettenis
> From: Arnd Bergmann > Date: Thu, 25 Mar 2021 22:41:09 +0100 > > On Thu, Mar 25, 2021 at 8:53 AM Sven Peter wrote: > > On Tue, Mar 23, 2021, at 21:53, Rob Herring wrote: > > > > I'm probably just confused or maybe the documentation is outdated but I > > don't > > see how I could specify "this

Re: [PATCH 0/9] arm64: tegra: Prevent early SMMU faults

2021-03-26 Thread Dmitry Osipenko
25.03.2021 16:03, 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

Re: [Patch V2 08/13] genirq: Set auxiliary data for an interrupt

2021-03-26 Thread Thomas Gleixner
On Fri, Mar 26 2021 at 10:32, Marc Zyngier wrote: > On Thu, 25 Mar 2021 18:59:48 +, > Thomas Gleixner wrote: >> Though that leaves the question of the data type for 'val'. While u64 is >> probably good enough for most stuff, anything which needs more than that >> is left out (again). union as

Re: [PATCH 1/9] memory: tegra: Move internal data structures into separate header

2021-03-26 Thread Dmitry Osipenko
25.03.2021 19:11, Dmitry Osipenko пишет: > 25.03.2021 18:52, Thierry Reding пишет: >> On Thu, Mar 25, 2021 at 06:12:51PM +0300, Dmitry Osipenko wrote: >>> 25.03.2021 16:03, Thierry Reding пишет: From: Thierry Reding From Tegra20 through Tegra210, either the GART or SMMU drivers

Re: [Patch V2 13/13] genirq/msi: Provide helpers to return Linux IRQ/dev_msi hw IRQ number

2021-03-26 Thread Marc Zyngier
On Fri, 26 Mar 2021 01:02:43 +, "Dey, Megha" wrote: > > Hi Marc, > > On 3/25/2021 10:53 AM, Marc Zyngier wrote: > > On Fri, 26 Feb 2021 20:11:17 +, > > Megha Dey wrote: > >> From: Dave Jiang > >> > >> Add new helpers to get the Linux IRQ number and device specific index > >> for

Re: [Patch V2 08/13] genirq: Set auxiliary data for an interrupt

2021-03-26 Thread Marc Zyngier
On Thu, 25 Mar 2021 18:59:48 +, Thomas Gleixner wrote: > > On Thu, Mar 25 2021 at 17:23, Marc Zyngier wrote: > >> +{ > >> + struct irq_desc *desc; > >> + struct irq_data *data; > >> + unsigned long flags; > >> + int res = -ENODEV; > >> + > >> + desc = irq_get_desc_buslock(irq, , 0); >

Re: [Patch V2 07/13] irqdomain/msi: Provide msi_alloc/free_store() callbacks

2021-03-26 Thread Marc Zyngier
On Thu, 25 Mar 2021 18:44:48 +, Thomas Gleixner wrote: > > On Thu, Mar 25 2021 at 17:08, Marc Zyngier wrote: > > Megha Dey wrote: > >> @@ -434,6 +434,12 @@ int __msi_domain_alloc_irqs(struct irq_domain > >> *domain, struct device *dev, > >>if (ret) > >>return ret; > >> >

Re: [PATCH v13 10/10] iommu/arm-smmu-v3: Add stall support for platform devices

2021-03-26 Thread Auger Eric
Hi Jean, On 3/2/21 10:26 AM, Jean-Philippe Brucker wrote: > The SMMU provides a Stall model for handling page faults in platform > devices. It is similar to PCIe PRI, but doesn't require devices to have > their own translation cache. Instead, faulting transactions are parked > and the OS is given

Re: [PATCH v13 07/10] iommu/arm-smmu-v3: Maintain a SID->device structure

2021-03-26 Thread Jean-Philippe Brucker
On Thu, Mar 25, 2021 at 05:48:07PM +, Will Deacon wrote: > > +/* smmu->streams_mutex must be held */ > > Can you add a lockdep assertion for that? Sure > > +__maybe_unused > > +static struct arm_smmu_master * > > +arm_smmu_find_master(struct arm_smmu_device *smmu, u32 sid) > > +{ > > +

[PATCH 3/3] drivers: iommu/arm - coding style fix

2021-03-26 Thread Zhiqi Song
Fixed following checkpatch error: - spaces required around '=' - space required before the open parenthesis '(' - "foo * bar" should be "foo *bar" Signed-off-by: Zhiqi Song --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 +++---

[PATCH 0/3] drivers: iommu coding style fix

2021-03-26 Thread Zhiqi Song
Fix the checkpatch errors in iommu module. Zhiqi Song (3): drivers:iommu - coding style fix drivers:iommu/amd - coding style fix drivers:iommu/arm - coding style fix drivers/iommu/amd/init.c| 4 ++-- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-

[PATCH 1/3] drivers: iommu - coding style fix

2021-03-26 Thread Zhiqi Song
Fixed following checkpatch error: - space required after ',' Signed-off-by: Zhiqi Song --- drivers/iommu/io-pgtable-arm.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 87def58..3bf880f

[PATCH 2/3] drivers: iommu/amd - coding style fix

2021-03-26 Thread Zhiqi Song
Fixed following checkpatch errors: - code indent should use tabs where possible - space prohibited before ',' Signed-off-by: Zhiqi Song --- drivers/iommu/amd/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index

Re: [PATCH V4 05/18] iommu/ioasid: Redefine IOASID set and allocation APIs

2021-03-26 Thread Jean-Philippe Brucker
On Thu, Mar 25, 2021 at 02:16:45PM -0300, Jason Gunthorpe wrote: > On Thu, Mar 25, 2021 at 10:02:36AM -0700, Jacob Pan wrote: > > Hi Jean-Philippe, > > > > On Thu, 25 Mar 2021 11:21:40 +0100, Jean-Philippe Brucker > > wrote: > > > > > On Wed, Mar 24, 2021 at 03:12:30PM -0700, Jacob Pan wrote: >

[PATCH 7/8] iommu/arm-smmu: Fix spelling mistake "initally" -> "initially"

2021-03-26 Thread Zhen Lei
There is a spelling mistake in a comment, fix it. Signed-off-by: Zhen Lei --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index

[PATCH 8/8] iommu/vt-d: fix a couple of spelling mistakes

2021-03-26 Thread Zhen Lei
There are several spelling mistakes, as follows: guarentees ==> guarantees resgister ==> register insufficent ==> insufficient creats ==> creates tabke ==> take Signed-off-by: Zhen Lei --- drivers/iommu/intel/dmar.c | 6 +++--- drivers/iommu/intel/iommu.c | 2 +-

[PATCH 6/8] iommu/amd: fix a couple of spelling mistakes

2021-03-26 Thread Zhen Lei
There are several spelling mistakes, as follows: alignement ==> alignment programing ==> programming implemtation ==> implementation assignement ==> assignment By the way, both "programing" and "programming" are acceptable, but the latter seems more formal. Signed-off-by: Zhen Lei ---

[PATCH 2/8] iommu/omap: Fix spelling mistake "alignement" -> "alignment"

2021-03-26 Thread Zhen Lei
There is a spelling mistake in a comment, fix it. Signed-off-by: Zhen Lei --- drivers/iommu/omap-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 71f29c0927fc710..b2a6ab700ec43d1 100644 ---

[PATCH 3/8] iommu/mediatek: Fix spelling mistake "phyiscal" -> "physical"

2021-03-26 Thread Zhen Lei
There is a spelling mistake in a comment, fix it. Signed-off-by: Zhen Lei --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 6ecc007f07cd52e..c8c9bf1d70b29dc 100644 ---

[PATCH 4/8] iommu/sun50i: Fix spelling mistake "consits" -> "consists"

2021-03-26 Thread Zhen Lei
There is a spelling mistake in a comment, fix it. Signed-off-by: Zhen Lei --- drivers/iommu/sun50i-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index ea6db1341916524..7685b96b2d445a7 100644 ---

[PATCH 5/8] iommu: fix a couple of spelling mistakes

2021-03-26 Thread Zhen Lei
There are several spelling mistakes, as follows: funcions ==> functions distiguish ==> distinguish detroyed ==> destroyed Signed-off-by: Zhen Lei --- drivers/iommu/iommu.c | 4 ++-- drivers/iommu/iova.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 1/8] iommu/pamu: fix a couple of spelling mistakes

2021-03-26 Thread Zhen Lei
There are several spelling mistakes, as follows: Returs ==> Returns defaul ==> default assocaited ==> associated Signed-off-by: Zhen Lei --- drivers/iommu/fsl_pamu.c| 2 +- drivers/iommu/fsl_pamu_domain.c | 2 +- drivers/iommu/fsl_pamu_domain.h | 2 +- 3 files changed, 3 insertions(+),

[PATCH 0/8] iommu: fix a couple of spelling mistakes detected by codespell tool

2021-03-26 Thread Zhen Lei
This detection and correction covers the entire driver/iommu directory. Zhen Lei (8): iommu/pamu: fix a couple of spelling mistakes iommu/omap: Fix spelling mistake "alignement" -> "alignment" iommu/mediatek: Fix spelling mistake "phyiscal" -> "physical" iommu/sun50i: Fix spelling mistake