Re: [PATCH v4 0/2] iommu: Add iommu_error class event to iommu trace

2013-09-25 Thread Joerg Roedel
On Tue, Sep 24, 2013 at 03:21:18PM -0600, Shuah Khan wrote: Shuah Khan (2): iommu: Add iommu_error class event to iommu trace iommu: Change iommu driver to call io_page_fault trace event Applied to the tracing branch, thanks Shuah. ___ iommu

Re: [PATCH 4/7] iommu/arm-smmu: Check for num_context_irqs 0 to avoid divide by zero exception

2013-09-25 Thread Andreas Herrmann
On Tue, Sep 24, 2013 at 11:40:48AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:06:58PM +0100, Andreas Herrmann wrote: With the right (or wrong;-) definition of v1 SMMU node in DTB it is possible to trigger a division by zero in arm_smmu_init_domain_context (if number of context

[PATCH 3/3] Fix compile error in drivers/gpu/drm/msm/msm_drv.c with IOMMU disabled

2013-09-25 Thread Joerg Roedel
The function msm_iommu_get_ctx() is needed buy the MSM-GPU driver with and wiithout IOMMU compiled in. Make the function available when no IOMMU driver is there. Signed-off-by: Joerg Roedel j...@8bytes.org --- drivers/iommu/msm_iommu.h |7 +++ 1 file changed, 7 insertions(+) diff --git

[PATCH 1/3] MSM: Remove iommu include from drivers/gpu/drm/msm/mdp4/mdp4_kms.c

2013-09-25 Thread Joerg Roedel
The include file has been removed and the file does not need it anyway, so remove it. Fixes a compile error. Signed-off-by: Joerg Roedel j...@8bytes.org --- drivers/gpu/drm/msm/mdp4/mdp4_kms.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp4/mdp4_kms.c

Re: [PATCH 6/7] iommu/arm-smmu: Add module parameter arm-smmu=off|force_isolation

2013-09-25 Thread Andreas Herrmann
On Tue, Sep 24, 2013 at 11:42:18AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:07:00PM +0100, Andreas Herrmann wrote: arm-smmu= arm-smmu driver option off Disable arm-smmu driver (ie. ignore available SMMUs) force_isolation Try to attach each

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Joerg Roedel
On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote: I *hate* the bizarre calling convention for iommu_unmap(). Is it actually clearly documented anywhere? Why on earth is it not just returning void, and expected to unmap what it was *asked* to unmap? Yeah, I agree that this should

Re: [PATCH 6/7] iommu/arm-smmu: Add module parameter arm-smmu=off|force_isolation

2013-09-25 Thread Joerg Roedel
On Tue, Sep 24, 2013 at 04:42:18PM +0100, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:07:00PM +0100, Andreas Herrmann wrote: +__setup(arm-smmu, arm_smmu_parse_options); If this is going to be a common function for IOMMUs, let's instead move the command-line parsing out into the generic

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Alex Williamson
On Wed, 2013-09-25 at 17:54 +0200, Joerg Roedel wrote: On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote: I *hate* the bizarre calling convention for iommu_unmap(). Is it actually clearly documented anywhere? Why on earth is it not just returning void, and expected to unmap

Re: [PATCH 5/7] iommu: supress loff_t compilation error on powerpc

2013-09-25 Thread Alex Williamson
On Thu, 2013-09-19 at 12:59 +0530, Bharat Bhushan wrote: Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- drivers/vfio/pci/vfio_pci_rdwr.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c

Re: [PATCH 2/7] iommu: add api to get iommu_domain of a device

2013-09-25 Thread Alex Williamson
On Thu, 2013-09-19 at 12:59 +0530, Bharat Bhushan wrote: This api return the iommu domain to which the device is attached. The iommu_domain is required for making API calls related to iommu. Follow up patches which use this API to know iommu maping. Signed-off-by: Bharat Bhushan

Re: [PATCH 7/7] iommu/arm-smmu: Clear global and context bank fault status and syndrome registers

2013-09-25 Thread Will Deacon
On Tue, Sep 24, 2013 at 07:32:47PM +0100, Andreas Herrmann wrote: On Tue, Sep 24, 2013 at 11:42:52AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:07:01PM +0100, Andreas Herrmann wrote: Signed-off-by: Andreas Herrmann andreas.herrm...@calxeda.com --- drivers/iommu/arm-smmu.c |

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread David Woodhouse
On Wed, 2013-09-25 at 17:54 +0200, Joerg Roedel wrote: On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote: I *hate* the bizarre calling convention for iommu_unmap(). Is it actually clearly documented anywhere? Why on earth is it not just returning void, and expected to unmap

Re: [PATCH 2/7] iommu/arm-smmu: Calculate SMMU_CB_BASE from smmu register values

2013-09-25 Thread Will Deacon
On Tue, Sep 24, 2013 at 07:07:20PM +0100, Andreas Herrmann wrote: On Tue, Sep 24, 2013 at 11:34:57AM -0400, Will Deacon wrote: On Tue, Sep 24, 2013 at 04:06:56PM +0100, Andreas Herrmann wrote: Currently it is derived from smmu resource size. If the resource size is wrongly specified (e.g.

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Joerg Roedel
On Wed, Sep 25, 2013 at 05:05:13PM +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 17:54 +0200, Joerg Roedel wrote: Yeah, I agree that this should be documented since it is quite non-standard/non-obvious behaviour of a function. The reason the interface was implemented this way is that

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Alex Williamson
On Wed, 2013-09-25 at 17:05 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 17:54 +0200, Joerg Roedel wrote: On Sat, Sep 21, 2013 at 09:59:00PM -0500, David Woodhouse wrote: I *hate* the bizarre calling convention for iommu_unmap(). Is it actually clearly documented anywhere? Why on

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread David Woodhouse
On Wed, 2013-09-25 at 11:36 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 17:05 +0100, David Woodhouse wrote: Why would it ever care? If it *happens* to map something that can use large pages, yay!. If it subsequently breaks apart those large pages by unmapping 4KiB in the middle, let

Re: [PATCH 7/7] vfio pci: Add vfio iommu implementation for FSL_PAMU

2013-09-25 Thread Alex Williamson
On Thu, 2013-09-19 at 12:59 +0530, Bharat Bhushan wrote: This patch adds vfio iommu support for Freescale IOMMU (PAMU - Peripheral Access Management Unit). The Freescale PAMU is an aperture-based IOMMU with the following characteristics. Each device has an entry in a table in memory

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Alex Williamson
On Wed, 2013-09-25 at 19:52 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 11:36 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 17:05 +0100, David Woodhouse wrote: Why would it ever care? If it *happens* to map something that can use large pages, yay!. If it subsequently breaks

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread David Woodhouse
On Wed, 2013-09-25 at 13:44 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 19:52 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 11:36 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 17:05 +0100, David Woodhouse wrote: Why would it ever care? If it *happens* to map something

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Alex Williamson
On Wed, 2013-09-25 at 21:11 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 13:44 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 19:52 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 11:36 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 17:05 +0100, David Woodhouse

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread David Woodhouse
On Wed, 2013-09-25 at 15:46 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 21:11 +0100, David Woodhouse wrote: I wouldn't bother to go looking for opportunities to use super pages if we remove the last non-SP-capable IOMMU from the domain. I predict bugs getting filed if a guest sees

Re: [PATCH] On unmap, flush IOMMU TLB and return correct size

2013-09-25 Thread Alex Williamson
On Wed, 2013-09-25 at 23:15 +0100, David Woodhouse wrote: On Wed, 2013-09-25 at 15:46 -0600, Alex Williamson wrote: On Wed, 2013-09-25 at 21:11 +0100, David Woodhouse wrote: I wouldn't bother to go looking for opportunities to use super pages if we remove the last non-SP-capable IOMMU

Re: [PATCH 1/1] x86/iommu: correct ICS register offset

2013-09-25 Thread Li, Zhen-Hua
Joerg, Thank you for reviewing this patch. ZhenHua On 09/24/2013 07:05 PM, Joerg Roedel wrote: On Tue, Sep 17, 2013 at 04:38:29PM +0800, ZhenHua wrote: Hi Guys, Though DMAR_ICS_REG is not used yet, I think this patch is necessary. So please take a look at it. You are right, my Spec

RE: [PATCH 5/7] iommu: supress loff_t compilation error on powerpc

2013-09-25 Thread Bhushan Bharat-R65777
-Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Wednesday, September 25, 2013 10:10 PM To: Bhushan Bharat-R65777 Cc: j...@8bytes.org; b...@kernel.crashing.org; ga...@kernel.crashing.org; linux- ker...@vger.kernel.org;

RE: [PATCH 6/7] vfio: moving some functions in common file

2013-09-25 Thread Bhushan Bharat-R65777
-Original Message- From: linux-pci-ow...@vger.kernel.org [mailto:linux-pci-ow...@vger.kernel.org] On Behalf Of Alex Williamson Sent: Wednesday, September 25, 2013 10:33 PM To: Bhushan Bharat-R65777 Cc: j...@8bytes.org; b...@kernel.crashing.org; ga...@kernel.crashing.org; linux-