Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-03-02 Thread Lu Baolu
Hi Joerg, On 2020/3/2 23:08, Joerg Roedel wrote: Hello Sai, Baolu, On Sun, Feb 16, 2020 at 01:57:26PM -0800, Sai Praneeth Prakhya wrote: Hence it will be helpful if there is some way to change the default domain of a B:D.F dynamically. Since, linux iommu subsystem prefers to deal at

[PATCH AUTOSEL 5.4 39/58] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-03-02 Thread Sasha Levin
From: Kai-Heng Feng [ Upstream commit 3dfee47b215e49788cfc80e474820ea2e948c031 ] Serious screen flickering when Stoney Ridge outputs to a 4K monitor. Use identity-mapping and PCI ATS doesn't help this issue. According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do the same here

[PATCH AUTOSEL 5.5 44/66] iommu/amd: Disable IOMMU on Stoney Ridge systems

2020-03-02 Thread Sasha Levin
From: Kai-Heng Feng [ Upstream commit 3dfee47b215e49788cfc80e474820ea2e948c031 ] Serious screen flickering when Stoney Ridge outputs to a 4K monitor. Use identity-mapping and PCI ATS doesn't help this issue. According to Alex Deucher, IOMMU isn't enabled on Windows, so let's do the same here

Re: [PATCH] iommu/io-pgtable-arm: Fix IOVA validation for 32-bit

2020-03-02 Thread Stephan Gerhold
Hi Robin, On Fri, Feb 28, 2020 at 02:18:55PM +, Robin Murphy wrote: > Since we ony support the TTB1 quirk for AArch64 contexts, and > consequently only for 64-bit builds, the sign-extension aspect of the > "are all bits above IAS consistent?" check should implicitly only apply > to 64-bit

[PATCH] dma: Fix max PFN arithmetic overflow on 32 bit systems

2020-03-02 Thread Alexander Dahl
For ARCH=x86 (32 bit) when you set CONFIG_IOMMU_INTEL since c5a5dc4cbbf4 ("iommu/vt-d: Don't switch off swiotlb if bounce page is used") there's a dependency on CONFIG_SWIOTLB, which was not necessarily active before. The init code for swiotlb in 'pci_swiotlb_detect_4gb()' compares something

Re: [PATCH v2 1/3] iommu/virtio: Add topology description to virtio-iommu config space

2020-03-02 Thread Joerg Roedel
On Fri, Feb 28, 2020 at 06:25:36PM +0100, Jean-Philippe Brucker wrote: > This solution isn't elegant nor foolproof, but is the best we can do at > the moment and works with existing virtio-iommu implementations. It also > enables an IOMMU for lightweight hypervisors that do not rely on > firmware

Re: [PATCH] iommu/io-pgtable-arm: Fix IOVA validation for 32-bit

2020-03-02 Thread Will Deacon
On Mon, Mar 02, 2020 at 05:11:23PM +0100, Joerg Roedel wrote: > On Mon, Mar 02, 2020 at 11:53:01AM +, Will Deacon wrote: > > On Fri, Feb 28, 2020 at 02:18:55PM +, Robin Murphy wrote: > > > Since we ony support the TTB1 quirk for AArch64 contexts, and > > > consequently only for 64-bit

Re: [PATCH] iommu/io-pgtable-arm: Fix IOVA validation for 32-bit

2020-03-02 Thread Joerg Roedel
On Mon, Mar 02, 2020 at 11:53:01AM +, Will Deacon wrote: > On Fri, Feb 28, 2020 at 02:18:55PM +, Robin Murphy wrote: > > Since we ony support the TTB1 quirk for AArch64 contexts, and > > consequently only for 64-bit builds, the sign-extension aspect of the > > "are all bits above IAS

Re: [PATCH v3] iommu/vt-d: Fix a bug in intel_iommu_iova_to_phys() for huge page

2020-03-02 Thread Joerg Roedel
On Wed, Feb 26, 2020 at 12:30:06PM -0800, Yonghyun Hwang wrote: > intel_iommu_iova_to_phys() has a bug when it translates an IOVA for a huge > page onto its corresponding physical address. This commit fixes the bug by > accomodating the level of page entry for the IOVA and adds IOVA's lower >

Re: provide in-place uncached remapping for dma-direct v2

2020-03-02 Thread Robin Murphy
On 24/02/2020 7:44 pm, Christoph Hellwig wrote: Hi all, this series provides support for remapping places uncached in-place in the generic dma-direct code, and moves openrisc over from its own in-place remapping scheme. The arm64 folks also had interest in such a scheme to avoid problems with

Re: [PATCH] iommu: silence iommu group prints

2020-03-02 Thread Joerg Roedel
On Thu, Feb 27, 2020 at 11:57:52AM +, Russell King wrote: > On the LX2160A, there are lots (about 160) of IOMMU messages produced > during boot; this is excessive. Reduce the severity of these messages > to debug level. No, these messages are a very useful tool when it comes to debugging

Re: [PATCH v2 2/4] iommu: Add Allwinner H6 IOMMU driver

2020-03-02 Thread Joerg Roedel
Hi Maxime, On Thu, Feb 20, 2020 at 07:15:14PM +0100, Maxime Ripard wrote: > +struct sun50i_iommu_domain { > + struct iommu_domain domain; > + > + /* Number of devices attached to the domain */ > + refcount_t refcnt; > + > + /* Lock to modify the Directory Table */ > +

RE: [PATCH] iommu: silence iommu group prints

2020-03-02 Thread Laurentiu Tudor
Hi Robin, > -Original Message- > From: Robin Murphy > Sent: Friday, February 28, 2020 8:32 PM > > [ +Laurentiu ] > > Hi Russell, > > Thanks for sharing a log, now I properly understand what's up... further > comments at the end (for context). > > On 28/02/2020 10:06 am, Russell King

Re: [PATCH V2 3/5] iommu: Add support to change default domain of an iommu_group

2020-03-02 Thread Joerg Roedel
Hello Sai, Baolu, On Sun, Feb 16, 2020 at 01:57:26PM -0800, Sai Praneeth Prakhya wrote: > Hence it will be helpful if there is some way to change the default > domain of a B:D.F dynamically. Since, linux iommu subsystem prefers to > deal at iommu_group level instead of B:D.F level, it might be

Re: [PATCH] iommu/io-pgtable-arm: Fix IOVA validation for 32-bit

2020-03-02 Thread Will Deacon
On Fri, Feb 28, 2020 at 02:18:55PM +, Robin Murphy wrote: > Since we ony support the TTB1 quirk for AArch64 contexts, and > consequently only for 64-bit builds, the sign-extension aspect of the > "are all bits above IAS consistent?" check should implicitly only apply > to 64-bit IOVAs. Change

[PATCH v2 2/3] iommu/mediatek: add pdata member for legacy ivrp paddr

2020-03-02 Thread Fabien Parent
Add a new platform data member in order to select which IVRP_PADDR format is used by an SoC. Signed-off-by: Fabien Parent --- v2: new patch --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v2 3/3] iommu/mediatek: add support for MT8167

2020-03-02 Thread Fabien Parent
Add support for the IOMMU on MT8167 Signed-off-by: Fabien Parent --- V2: * removed if based on m4u_plat, and using instead the new has_legacy_ivrp_paddr member that was introduced in patch 2. --- drivers/iommu/mtk_iommu.c | 9 + drivers/iommu/mtk_iommu.h | 1 + 2 files

[PATCH v2 1/3] dt-bindings: iommu: Add binding for MediaTek MT8167 IOMMU

2020-03-02 Thread Fabien Parent
This commit adds IOMMU binding documentation for the MT8167 SoC. Signed-off-by: Fabien Parent Acked-by: Rob Herring --- V2: no change --- Documentation/devicetree/bindings/iommu/mediatek,iommu.txt | 1 + 1 file changed, 1 insertion(+) diff --git