Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-22 Thread Joerg Roedel
On Fri, Jan 18, 2019 at 12:17:05PM +, Eric Wong wrote: > @@ -5411,6 +5411,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, > quirk_iommu_g4x_gfx); > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_g4x_gfx); > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40,

Re: [PATCH] iommu/amd: Fix IOMMU page flush when detach all devices from a domain

2019-01-22 Thread j...@8bytes.org
Hi Suravee, On Thu, Jan 17, 2019 at 08:44:36AM +, Suthikulpanit, Suravee wrote: > Then, in __domain_flush_pages, we issue command when the dev_iommu[] >= 0. > This should preserve previous behavior, and only add flushing condition to > the specific IOMMU in detached state. Please let me know

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-22 Thread Daniel Vetter
On Tue, Jan 22, 2019 at 11:39 AM Joerg Roedel wrote: > > On Fri, Jan 18, 2019 at 12:17:05PM +, Eric Wong wrote: > > @@ -5411,6 +5411,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e20, > > quirk_iommu_g4x_gfx); > > DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30,

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-22 Thread Joerg Roedel
Hi Daniel, On Tue, Jan 22, 2019 at 11:46:39AM +0100, Daniel Vetter wrote: > Note that the string of platforms which have various issues with iommu > and igfx is very long, thus far we only disabled it where there's no > workaround to stop it from hanging the box, but otherwise left it > enabled.

Re: [PATCH] iommu: amd: call free_iova_fast with pfn in map_sg

2019-01-22 Thread Joerg Roedel
On Thu, Jan 17, 2019 at 12:29:02PM -0700, Jerry Snitselaar wrote: > In the error path of map_sg, free_iova_fast is being called with > address instead of the pfn. This results in a bad value getting into > the rcache, and can result in hitting a BUG_ON when > iova_magazine_free_pfns is called. >

Re: [PATCH] iommu/intel-iommu: fix memory leak in intel_iommu_put_resv_regions()

2019-01-22 Thread Joerg Roedel
On Wed, Jan 16, 2019 at 08:11:44PM +0100, Gerald Schaefer wrote: > Commit 9d3a4de4cb8d ("iommu: Disambiguate MSI region types") changed > the reserved region type in intel_iommu_get_resv_regions() from > IOMMU_RESV_RESERVED to IOMMU_RESV_MSI, but it forgot to also change > the type in

Re: [PATCH] dma-debug: add dumping facility via debugfs

2019-01-22 Thread Joerg Roedel
On Fri, Jan 18, 2019 at 12:35:43PM +0100, Christoph Hellwig wrote: > On Wed, Jan 16, 2019 at 06:10:13PM +, Robin Murphy wrote: > > It's a shame that this is pretty much a duplication of > > debug_dma_dump_mappings(), but there seems no straightforward way to define > > one in terms of the

Re: [PATCH v6 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2019-01-22 Thread Nicolas Boichat
Hi Andrew, On Fri, Jan 11, 2019 at 6:21 PM Joerg Roedel wrote: > > On Wed, Jan 02, 2019 at 01:51:45PM +0800, Nicolas Boichat wrote: > > Does anyone have any further comment on this series? If not, which > > maintainer is going to pick this up? I assume Andrew Morton? > > Probably, yes. I don't

Aw: Re: [BUG] "access dev->iommu_fwspec" cause crash on BPI-R2

2019-01-22 Thread Frank Wunderlich
Hi, thanks for quick reply, this seems to fix it no crash, xserver works, like revert of the commit...pushed the fix to below github-repo regards Frank > Gesendet: Dienstag, 22. Januar 2019 um 17:49 Uhr > Von: "Joerg Roedel" > An: "Frank Wunderlich" > Cc: "Matthias Brugger" , >

Re: [PATCH] arm64/xen: fix xen-swiotlb cache flushing

2019-01-22 Thread Christoph Hellwig
On Mon, Jan 21, 2019 at 03:56:29PM -0800, Stefano Stabellini wrote: > > Where should we pick this up? I could pick it up through the dma-mapping > > tree given that is where the problem is introduced, but the Xen or arm64 > > trees would also fit. > > I am happy for you to carry it in the

[PATCH v2] iommu/vt-d: Implement dma_[un]map_resource()

2019-01-22 Thread Logan Gunthorpe
Currently the Intel IOMMU uses the default dma_[un]map_resource() implementations does nothing and simply returns the physical address unmodified. However, this doesn't create the IOVA entries necessary for addresses mapped this way to work when the IOMMU is enabled. Thus, when the IOMMU is

Re: [PATCH 1/2] dma-direct: set_memory_{en, de}crypted() take number of pages

2019-01-22 Thread Thiago Jung Bauermann
Lendacky, Thomas writes: > On 1/22/19 3:17 PM, Thiago Jung Bauermann wrote: >> diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c >> index 355d16acee6d..bc78c37220ba 100644 >> --- a/kernel/dma/direct.c >> +++ b/kernel/dma/direct.c >> @@ -166,7 +166,7 @@ void *dma_direct_alloc_pages(struct

Re: [PATCH 1/2] dma-direct: set_memory_{en,de}crypted() take number of pages

2019-01-22 Thread Lendacky, Thomas
On 1/22/19 3:17 PM, Thiago Jung Bauermann wrote: > From: Ram Pai > > set_memory_encrypted() and set_memory_decrypted() expect the number of > PAGE_SIZE pages to encrypt or decrypt. dma_direct_alloc() and > dma_direct_free() instead pass number of bytes. This encrypts/decrypts a > huge number of

[PATCH 2/2] x86/kvmclock: set_memory_decrypted() takes number of pages

2019-01-22 Thread Thiago Jung Bauermann
From: Ram Pai set_memory_decrypted() expects the number of PAGE_SIZE pages to decrypt. kvmclock_init_mem() instead passes number of bytes. This decrypts a huge number of pages resulting in data corruption. Fixed it. [ bauermann: Slightly reworded commit message and added Fixes: tag. ] Fixes:

[PATCH 1/2] dma-direct: set_memory_{en, de}crypted() take number of pages

2019-01-22 Thread Thiago Jung Bauermann
From: Ram Pai set_memory_encrypted() and set_memory_decrypted() expect the number of PAGE_SIZE pages to encrypt or decrypt. dma_direct_alloc() and dma_direct_free() instead pass number of bytes. This encrypts/decrypts a huge number of pages resulting in data corruption. Fixed it. [ bauermann:

Re: [PATCH 2/2] x86/kvmclock: set_memory_decrypted() takes number of pages

2019-01-22 Thread Lendacky, Thomas
On 1/22/19 3:17 PM, Thiago Jung Bauermann wrote: > From: Ram Pai > > set_memory_decrypted() expects the number of PAGE_SIZE pages to decrypt. > kvmclock_init_mem() instead passes number of bytes. This decrypts a huge > number of pages resulting in data corruption. Same comment as patch 1/2 in

Re: [PATCH] iommu/amd: Fix IOMMU page flush when detach all devices from a domain

2019-01-22 Thread j...@8bytes.org
Hi Suravee, On Tue, Jan 22, 2019 at 03:53:18PM +, Suthikulpanit, Suravee wrote: > Thanks for the detail. Alright then, let's just go with the version you > sent on 1/16/19. Do you want me to resend V3 with that changes, or > would you be taking care of that? Please send me a v3 based on the

[PATCH] iommu/mediatek: Use correct fwspec in mtk_iommu_add_device()

2019-01-22 Thread Joerg Roedel
From: Joerg Roedel The mtk_iommu_add_device() function keeps the fwspec in an on-stack pointer and calls mtk_iommu_create_mapping(), which might change its source, dev->iommu_fwspec. This causes the on-stack pointer to be obsoleted and the device initialization to fail. Update the on-stack

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-22 Thread Joonas Lahtinen
Quoting Joerg Roedel (2019-01-22 13:01:09) > Hi Daniel, > > On Tue, Jan 22, 2019 at 11:46:39AM +0100, Daniel Vetter wrote: > > Note that the string of platforms which have various issues with iommu > > and igfx is very long, thus far we only disabled it where there's no > > workaround to stop it

Re: [BUG] "access dev->iommu_fwspec" cause crash on BPI-R2

2019-01-22 Thread Joerg Roedel
Hi Frank, thanks for the report! On Tue, Jan 22, 2019 at 05:09:09PM +0100, Frank Wunderlich wrote: > Hi, > > the following Patch breaks hdmi (at least) on Bananapi R2 (mt7623): > > a9bf2eec5a6fc01a0a5250eaf0bf61dfd382a78a "iommu/mediatek: Use helper > functions to access dev->iommu_fwspec"

Re: [PATCH] dma: debug: no need to check return value of debugfs_create functions

2019-01-22 Thread Greg Kroah-Hartman
On Tue, Jan 22, 2019 at 06:44:38PM +, Robin Murphy wrote: > Hi Greg, > > On 22/01/2019 15:21, Greg Kroah-Hartman wrote: > > When calling debugfs functions, there is no need to ever check the > > return value. The function can work or not, but the code logic should > > never do something

Re: [PATCH 1/3] iommu/arm-smmu: Move to bitmap for arm_smmu_domain atrributes

2019-01-22 Thread Vivek Gautam
On Mon, Jan 21, 2019 at 7:23 PM Robin Murphy wrote: > > On 21/01/2019 05:53, Vivek Gautam wrote: > > A number of arm_smmu_domain's attributes can be assigned based > > on the iommu domains's attributes. These local attributes better > > be managed by a bitmap. > > So remove boolean flags and move

[PATCH] dma: debug: no need to check return value of debugfs_create functions

2019-01-22 Thread Greg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Also delete the variables for the file dentries for the debugfs entries as they are never used at all once they are

Re: [PATCH] iommu/amd: Fix IOMMU page flush when detach all devices from a domain

2019-01-22 Thread Suthikulpanit, Suravee
Joerg, On 1/22/19 5:44 PM, j...@8bytes.org wrote: > Hi Suravee, > > On Thu, Jan 17, 2019 at 08:44:36AM +, Suthikulpanit, Suravee wrote: >> Then, in __domain_flush_pages, we issue command when the dev_iommu[] >= 0. >> This should preserve previous behavior, and only add flushing condition to

Re: [PATCH v1] iommu/s390: Declare s390 iommu reserved regions

2019-01-22 Thread Alex Williamson
On Mon, 21 Jan 2019 12:51:14 +0100 Pierre Morel wrote: > On 18/01/2019 14:51, Jean-Philippe Brucker wrote: > > Hi Pierre, > > > > On 18/01/2019 13:29, Pierre Morel wrote: > >> On 17/01/2019 14:02, Robin Murphy wrote: > >>> On 15/01/2019 17:37, Pierre Morel wrote: > The s390 iommu can

Re: [PATCH] iommu/intel: quirk to disable DMAR for QM57 igfx

2019-01-22 Thread Joerg Roedel
On Tue, Jan 22, 2019 at 04:48:26PM +0200, Joonas Lahtinen wrote: > According to our IOMMU folks there exists some desire to be able to assign > the iGFX device aka have intel_iommu=on instead of intel_iommu=igfx_off > due to how the devices might be grouped in IOMMU groups. Even when you > would

Re: [PATCH] dma: debug: no need to check return value of debugfs_create functions

2019-01-22 Thread Robin Murphy
Hi Greg, On 22/01/2019 15:21, Greg Kroah-Hartman wrote: When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Also delete the variables for the file dentries for the

[BUG] "access dev->iommu_fwspec" cause crash on BPI-R2

2019-01-22 Thread Frank Wunderlich
Hi, the following Patch breaks hdmi (at least) on Bananapi R2 (mt7623): a9bf2eec5a6fc01a0a5250eaf0bf61dfd382a78a "iommu/mediatek: Use helper functions to access dev->iommu_fwspec"