Re: [PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2015-01-15 Thread Laurent Pinchart
On Thursday 15 January 2015 11:12:17 Will Deacon wrote: > On Thu, Jan 15, 2015 at 08:28:44AM +, Thierry Reding wrote: > > On Wed, Jan 14, 2015 at 10:46:10AM +, Will Deacon wrote: > > > On Wed, Jan 14, 2015 at 09:00:24AM +, Alexandre Courbot wrote: > > [...] > > > >>> 2) Say you want to

Re: [RFC PATCH 0/5] arm64: IOMMU-backed DMA mapping

2015-01-15 Thread Robin Murphy
On 13/01/15 08:02, Yingjoe Chen wrote: On Mon, 2015-01-12 at 20:48 +, Robin Murphy wrote: Hi all, Whilst it's a long way off perfect, this has reached the point of being functional and stable enough to be useful, so here it is. The core consists of the meat of the arch/arm implementation mo

[PATCH 3/3] vfio/type1: Add conditional rescheduling

2015-01-15 Thread Alex Williamson
IOMMU operations can be expensive and it's not very difficult for a user to give us a lot of work to do for a map or unmap operation. Killing a large VM will vfio assigned devices can result in soft lockups and IOMMU tracing shows that we can easily spend 80% of our time with need-resched set. A s

[PATCH 0/3] vfio/type1: map/unmap chunking + conditional rescheduling

2015-01-15 Thread Alex Williamson
This series is inspired by the IOMMU tracing code added by Shuah Khan and a request to report some of those traces for vfio-based device assignment. What I saw in the trace was an absurd number of calls to iommu_unmap(). In fact, I had to up the trace log buffer size several times before I was ac

[PATCH 2/3] vfio/type1: Chunk contiguous reserved/invalid page mappings

2015-01-15 Thread Alex Williamson
We currently map invalid and reserved pages, such as often occur from mapping MMIO regions of a VM through the IOMMU, using single pages. There's really no reason we can't instead follow the methodology we use for normal pages and find the largest possible physically contiguous chunk for mapping.

[PATCH 1/3] vfio/type1: DMA unmap chunking

2015-01-15 Thread Alex Williamson
When unmapping DMA entries we try to rely on the IOMMU API behavior that allows the IOMMU to unmap a larger area than requested, up to the size of the original mapping. This works great when the IOMMU supports superpages *and* they're in use. Otherwise, each PAGE_SIZE increment is unmapped separa

Re: [PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2015-01-15 Thread Will Deacon
On Thu, Jan 15, 2015 at 08:30:06AM +, Thierry Reding wrote: > On Wed, Jan 14, 2015 at 07:17:50PM +, Will Deacon wrote: > > On Wed, Jan 14, 2015 at 01:51:36PM +, Heiko Stübner wrote: > > > As Alexandre suspected the new Rockchip drm code seems to be affected by > > > this. I hadn't playe

Re: [PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2015-01-15 Thread Will Deacon
On Thu, Jan 15, 2015 at 08:28:44AM +, Thierry Reding wrote: > On Wed, Jan 14, 2015 at 10:46:10AM +, Will Deacon wrote: > > On Wed, Jan 14, 2015 at 09:00:24AM +, Alexandre Courbot wrote: > [...] > > > 2) Say you want to use the IOMMU API in your driver, and have an iommu > > > property

Re: [PATCH v10] iopoll: Introduce memory-mapped IO polling macros

2015-01-15 Thread Will Deacon
On Wed, Jan 14, 2015 at 07:42:53PM +, Mitchel Humpherys wrote: > On Tue, Dec 16 2014 at 01:45:27 AM, Will Deacon wrote: > > On Mon, Dec 15, 2014 at 11:47:23PM +, Mitchel Humpherys wrote: > >> From: Matt Wagantall > >> > >> It is sometimes necessary to poll a memory-mapped register until

Re: [Patch v2 07/16] x86/apic: Refine enable_IR_x2apic() and related functions

2015-01-15 Thread Thomas Gleixner
On Wed, 7 Jan 2015, Jiang Liu wrote: > Refine enable_IR_x2apic() and related functions for better readability. > > It also changes the way to handle IR in XAPIC mode when enabling X2APIC. > Previously it just skips X2APIC initialization without checking max CPU > APIC ID in system, which may caus

Re: [PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2015-01-15 Thread Thierry Reding
On Wed, Jan 14, 2015 at 07:17:50PM +, Will Deacon wrote: > On Wed, Jan 14, 2015 at 01:51:36PM +, Heiko Stübner wrote: > > Am Mittwoch, 14. Januar 2015, 10:46:10 schrieb Will Deacon: > > > On Wed, Jan 14, 2015 at 09:00:24AM +, Alexandre Courbot wrote: > > > > On 12/02/2014 01:57 AM, Will

Re: [PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2015-01-15 Thread Thierry Reding
On Wed, Jan 14, 2015 at 10:46:10AM +, Will Deacon wrote: > On Wed, Jan 14, 2015 at 09:00:24AM +, Alexandre Courbot wrote: [...] > > 2) Say you want to use the IOMMU API in your driver, and have an iommu > > property in your device's DT node. If by chance your IOMMU is registered > > early