lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Sep 2015 15:27:47 -0400
From:	Jerome Glisse <jglisse@...hat.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:	Alex Deucher <alexander.deucher@....com>,
	Dave Airlie <airlied@...hat.com>,
	iommu@...ts.linux-foundation.org, Joerg Roedel <jroedel@...e.de>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] dma/swiotlb: Add helper for device driver to opt-out
 from swiotlb.

On Thu, Sep 17, 2015 at 03:24:25PM -0400, Konrad Rzeszutek Wilk wrote:
> On Thu, Sep 17, 2015 at 03:11:14PM -0400, Jerome Glisse wrote:
> > On Thu, Sep 17, 2015 at 03:06:57PM -0400, Konrad Rzeszutek Wilk wrote:
> > > On Thu, Sep 17, 2015 at 03:02:51PM -0400, Konrad Rzeszutek Wilk wrote:
> > > > On Thu, Sep 17, 2015 at 02:22:38PM -0400, jglisse@...hat.com wrote:
> > > > > From: Jérôme Glisse <jglisse@...hat.com>
> > > > > 
> > > > > The swiotlb dma backend is not appropriate for some devices like
> > > > > GPU where bounce buffer or slow dma page allocations is just not
> > > > > acceptable. With that helper device drivers can opt-out from the
> > > > > swiotlb and just do sane things without wasting CPU cycles inside
> > > > > the swiotlb code.
> > > > 
> > > > What if SWIOTLB is the only one available?
> > > > 
> > > > And what can't the devices use the TTM DMA backend which sets up
> > > > buffers which don't need bounce buffer or slow dma page allocations?
> > > 
> > > And then the followup question. If it opts out - how can it do
> > > sane things without an DMA API available? It would assume physical
> > > addresses match the bus addresses which is not always the sane
> > > thing.
> > 
> > This is why this is an arch specific function, on x86 with pci device,
> > the driver knows what is the dma mask and thus if it can access directly
> > all the memory or not. So in the end swiotlb vs no_mmu gives the same
> > physical address to the device so there is no difference there.
> 
> Not with Intel or AMD IOMMUs. The bus address it gives is not the same
> as the physical address.

Yes but this patch never overidde if the dma_ops are the one from any IOMMU
thus it can only override if there is a 1 to 1 mapping btw bus address and
physical address.

Cheers,
Jérôme
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ