Re: [PATCH 10/22] iommu: Introduce direct mapped region handling

2015-06-11 Thread Robin Murphy
On 28/05/15 17:41, Joerg Roedel wrote: From: Joerg Roedel Add two new functions to the IOMMU-API to allow the IOMMU drivers to export the requirements for direct mapped regions per device. This is useful for exporting the information in Intel VT-d's RMRR entries or AMD-Vi's unity mappings. Wh

Re: [PATCH 08/22] iommu: Make sure a device is always attached to a domain

2015-06-11 Thread Robin Murphy
On 28/05/15 17:41, Joerg Roedel wrote: From: Joerg Roedel Make use of the default domain and re-attach a device to it when it is detached from another domain. Also enforce that a device has to be in the default domain before it can be attached to a different domain. Signed-off-by: Joerg Roedel

Re: [PATCH 06/22] iommu: Allocate a default domain for iommu groups

2015-06-11 Thread Robin Murphy
Hi Joerg, On 28/05/15 17:41, Joerg Roedel wrote: From: Joerg Roedel The default domain will be used (if supported by the iommu driver) when the devices in the iommu group are not attached to any other domain. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 32 ++

Re: [PATCH 06/22] iommu: Allocate a default domain for iommu groups

2015-06-11 Thread Robin Murphy
Hi Joerg, On 28/05/15 17:41, Joerg Roedel wrote: From: Joerg Roedel The default domain will be used (if supported by the iommu driver) when the devices in the iommu group are not attached to any other domain. Signed-off-by: Joerg Roedel --- drivers/iommu/iommu.c | 32 ++

Re: [RFC/PATCH 0/9] IOMMU probe deferral support

2015-06-11 Thread Will Deacon
Hi Laurent, On Fri, May 15, 2015 at 12:00:01AM +0100, Laurent Pinchart wrote: > This patch series attempts to implement support for deferring probe of both > IOMMU drivers and bus master drivers. Have you had a chance to look at any of the feedback you've received on this? Will _

[PATCH v2 2/4] iommu: Implement common IOMMU ops for DMA mapping

2015-06-11 Thread Robin Murphy
Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Signed-off-by: Robin Murphy --- drivers/iommu/Kconfig | 7 + drivers/iommu/Makefile|

[PATCH v2 1/4] iommu/iova: Avoid over-allocating when size-aligned

2015-06-11 Thread Robin Murphy
Currently, allocating a size-aligned IOVA region quietly adjusts the actual allocation size in the process, returning a rounded-up power-of-two-sized allocation. This results in mismatched behaviour in the IOMMU driver if the original size was not a power of two, where the original size is mapped,

Re: [PATCH 0/4] More cleanups and fixes for Intel VT-d

2015-06-11 Thread David Woodhouse
On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > > here are a number of additional fixes for the Intel VT-d > driver and its behavior in a kdump kernel. The most > important fix is the iommu=pt case, which is broken without > these patches. It looks like the original kdump patch set has b

[PATCH v2 0/4] arm64: IOMMU-backed DMA mapping

2015-06-11 Thread Robin Murphy
Hi all, Here's a quick repost of [1] with a couple of minor fixes: - fix scatterlist dma_len for segments with nonzero offset - adjust the bus notifier priority with a less silly value The branch at [2] has been updated as well. Robin. [1]:http://thread.gmane.org/gmane.linux.kernel.iommu/9721 [

[PATCH v2 4/4] arm64: Hook up IOMMU dma_ops

2015-06-11 Thread Robin Murphy
With iommu_dma_ops in place, hook them up to the configuration code, so IOMMU-fronted devices will get them automatically. Signed-off-by: Robin Murphy --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/dma-mapping.h | 11 ++- arch/arm64/mm/dma-mapping.c | 15

Re: [PATCH v10 0/10] iommu/vt-d: Fix intel vt-d faults in kdump kernel

2015-06-11 Thread David Woodhouse
On Fri, 2015-04-10 at 16:42 +0800, Li, Zhen-Hua wrote: > This patchset is an update of Bill Sumner's patchset, implements a fix for: > If a kernel boots with intel_iommu=on on a system that supports intel vt-d, > when a panic happens, the kdump kernel will boot with these faults: But, in the gene

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread David Woodhouse
On Thu, 2015-06-11 at 15:44 +0100, David Woodhouse wrote: > It used to look like this > ... > Now it looks like this That's not quite right; each root entry is for only *one* bus, and the correct version looks more like this... It used to look like this: Root Table Address Register |

Re: [PATCH v2 1/3] drm/exynos: fimd: ensure proper hw state in fimd_clear_channel()

2015-06-11 Thread Inki Dae
On 2015년 06월 03일 17:26, Marek Szyprowski wrote: > One should not do any assumptions on the stare of the fimd hardware > during driver initialization, so to properly reset fimd before enabling > IOMMU, one should ensure that all power domains and clocks are really > enabled. This patch adds pm_runti

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread Joerg Roedel
On Thu, Jun 11, 2015 at 04:25:54PM +0200, Joerg Roedel wrote: > Okay, reading the VT-d spec again, the extended context-entry table seem > to exist in parallel to the current context-entry table, right? So this > patch should still work, even with extended entries present. I found section 3.4.4. o

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread David Woodhouse
On Thu, 2015-06-11 at 16:25 +0200, Joerg Roedel wrote: > On Thu, Jun 11, 2015 at 03:07:02PM +0100, David Woodhouse wrote: > > On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > > > From: Joerg Roedel > > > > > > Hide the copied context entries from the IOMMU driver by > > > considering them

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread Joerg Roedel
On Thu, Jun 11, 2015 at 03:07:02PM +0100, David Woodhouse wrote: > On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > > From: Joerg Roedel > > > > Hide the copied context entries from the IOMMU driver by > > considering them as non-present. This is implemented by > > setting the first AVL b

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread David Woodhouse
On Thu, 2015-06-11 at 16:12 +0200, Joerg Roedel wrote: > On Thu, Jun 11, 2015 at 03:07:02PM +0100, David Woodhouse wrote: > > On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > > > From: Joerg Roedel > > > > > > Hide the copied context entries from the IOMMU driver by > > > considering them

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread Joerg Roedel
On Thu, Jun 11, 2015 at 03:07:02PM +0100, David Woodhouse wrote: > On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > > From: Joerg Roedel > > > > Hide the copied context entries from the IOMMU driver by > > considering them as non-present. This is implemented by > > setting the first AVL b

Re: [PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread David Woodhouse
On Thu, 2015-06-11 at 15:47 +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Hide the copied context entries from the IOMMU driver by > considering them as non-present. This is implemented by > setting the first AVL bit (bit 67) in the context entry to > one. If this bit is set, the context_pr

[PATCH 2/4] iommu/vt-d: Don't consider copied context entries as present

2015-06-11 Thread Joerg Roedel
From: Joerg Roedel Hide the copied context entries from the IOMMU driver by considering them as non-present. This is implemented by setting the first AVL bit (bit 67) in the context entry to one. If this bit is set, the context_present() function returns false. Signed-off-by: Joerg Roedel ---

[PATCH 4/4] iommu/vt-d: Make sure si_domain is allocated for kdump kernel

2015-06-11 Thread Joerg Roedel
From: Joerg Roedel The si_domain needs to be allocated in the kdump kernel too. Otherwise the iommu=pt case breaks with a panic of the kdump kernel. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff

[PATCH 1/4] iommu/vt-d: Remove iommu_attach_domain_with_id()

2015-06-11 Thread Joerg Roedel
From: Joerg Roedel We don't re-use domain-ids from the old kernel, so this function is not needed anymore. Remove it. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/driv

[PATCH 3/4] iommu/vt-d: Remove unmap_device_dma()

2015-06-11 Thread Joerg Roedel
From: Joerg Roedel This removes the unmap_device_dma() function and the code-path calling it. That code looks like a left-over from Bill Sumners patch-set, as it only makes sense when kdump recovery is implemented like in his original patch-set. With the way it is implemented now this code doesn

[PATCH 0/4] More cleanups and fixes for Intel VT-d

2015-06-11 Thread Joerg Roedel
Hi, here are a number of additional fixes for the Intel VT-d driver and its behavior in a kdump kernel. The most important fix is the iommu=pt case, which is broken without these patches. Regards, Joerg Joerg Roedel (4): iommu/vt-d: Remove iommu_attach_domain_with_id() iommu/vt-d: D

Re: iommu/amd: Implement dm_region call-backs

2015-06-11 Thread Joerg Roedel
On Thu, Jun 11, 2015 at 11:02:51AM +0300, Dan Carpenter wrote: > On Thu, Jun 11, 2015 at 09:43:27AM +0200, Joerg Roedel wrote: > > What static checker do you use, btw? > > I'm using Smatch. > > The ERR_PTR stuff requires that you run > > smatch_scripts/build_kernel_data.sh > > At the star

Re: iommu/amd: Implement dm_region call-backs

2015-06-11 Thread Dan Carpenter
On Thu, Jun 11, 2015 at 09:43:27AM +0200, Joerg Roedel wrote: > On Wed, Jun 10, 2015 at 06:39:20PM +0300, Dan Carpenter wrote: > > Hello Joerg Roedel, > > > > The patch b61238c4a5e1: "iommu/amd: Implement dm_region call-backs" > > from May 28, 2015, leads to the following static checker warning: >

Re: [patch -next] iommu: checking for NULL instead of IS_ERR

2015-06-11 Thread Joerg Roedel
On Wed, Jun 10, 2015 at 01:59:27PM +0300, Dan Carpenter wrote: > The iommu_group_alloc() and iommu_group_get_for_dev() functions return > error pointers, they never return NULL. > > Signed-off-by: Dan Carpenter Applied, thanks. ___ iommu mailing list i

Re: iommu/amd: Implement dm_region call-backs

2015-06-11 Thread Joerg Roedel
On Wed, Jun 10, 2015 at 06:39:20PM +0300, Dan Carpenter wrote: > Hello Joerg Roedel, > > The patch b61238c4a5e1: "iommu/amd: Implement dm_region call-backs" > from May 28, 2015, leads to the following static checker warning: > > drivers/iommu/amd_iommu.c:3153 amd_iommu_get_dm_regions() >

[PATCH] iommu/amd: Handle errors returned from iommu_init_device

2015-06-11 Thread Joerg Roedel
Hi Dan, On Wed, Jun 10, 2015 at 06:36:18PM +0300, Dan Carpenter wrote: > This is a semi-automatic email about new static checker warnings. > > The patch 0a3da4517107: "iommu/amd: Put IOMMUv2 devices in a direct > mapped domain" from May 28, 2015, leads to the following Smatch > complaint: > >

Re: iommu: Introduce iommu_request_dm_for_dev()

2015-06-11 Thread Joerg Roedel
Hi Dan, On Wed, Jun 10, 2015 at 02:02:44PM +0300, Dan Carpenter wrote: > This is a semi-automatic email about new static checker warnings. > > The patch eeae3fba3afe: "iommu: Introduce iommu_request_dm_for_dev()" > from May 28, 2015, leads to the following Smatch complaint: > > drivers/iommu/io