Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-24 Thread Stefano Stabellini
On Wed, 23 Oct 2013, Konrad Rzeszutek Wilk wrote: > On Wed, Oct 23, 2013 at 06:34:13PM +0100, Stefano Stabellini wrote: > > > On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: > > > > xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to > > > > is_xen_swiotlb_buffer

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-24 Thread Stefano Stabellini
On Wed, 23 Oct 2013, Konrad Rzeszutek Wilk wrote: On Wed, Oct 23, 2013 at 06:34:13PM +0100, Stefano Stabellini wrote: On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Konrad Rzeszutek Wilk
On Wed, Oct 23, 2013 at 06:34:13PM +0100, Stefano Stabellini wrote: > > On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: > > > xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to > > > is_xen_swiotlb_buffer that calls xen_bus_to_phys again. > > > > It does? > > > >

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Stefano Stabellini
> On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: > > xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to > > is_xen_swiotlb_buffer that calls xen_bus_to_phys again. > > It does? > > I see it call mfn_to_local_pfn which calls pfn_to_mfn and > get_phys_to_machine

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Konrad Rzeszutek Wilk
On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: > xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to > is_xen_swiotlb_buffer that calls xen_bus_to_phys again. It does? I see it call mfn_to_local_pfn which calls pfn_to_mfn and get_phys_to_machine (which I presume

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Konrad Rzeszutek Wilk
On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls xen_bus_to_phys again. It does? I see it call mfn_to_local_pfn which calls pfn_to_mfn and get_phys_to_machine (which I presume is

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Stefano Stabellini
On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls xen_bus_to_phys again. It does? I see it call mfn_to_local_pfn which calls pfn_to_mfn and get_phys_to_machine (which I

Re: [PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-23 Thread Konrad Rzeszutek Wilk
On Wed, Oct 23, 2013 at 06:34:13PM +0100, Stefano Stabellini wrote: On Thu, Oct 17, 2013 at 06:43:33PM +0100, Stefano Stabellini wrote: xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls xen_bus_to_phys again. It does? I see it call

[PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-17 Thread Stefano Stabellini
xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls xen_bus_to_phys again. xen_bus_to_phys is potentially a slow operation that might involve walking a tree. We can avoid calling xen_bus_to_phys twice by removing the is_xen_swiotlb_buffer call and doing

[PATCH v8 18/19] swiotlb-xen: no need to do execute two bus_to_phys translations in a row

2013-10-17 Thread Stefano Stabellini
xen_unmap_single calls xen_bus_to_phys, then passes dev_addr to is_xen_swiotlb_buffer that calls xen_bus_to_phys again. xen_bus_to_phys is potentially a slow operation that might involve walking a tree. We can avoid calling xen_bus_to_phys twice by removing the is_xen_swiotlb_buffer call and doing