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-next>] [day] [month] [year] [list]
Date:   Sat, 15 Jul 2017 18:24:03 -0700
From:   Vineet Gupta <Vineet.Gupta1@...opsys.com>
To:     "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Christoph Hellwig <hch@....de>, <bart.vanassche@...disk.com>,
        Alexander Duyck <alexander.h.duyck@...el.com>,
        Krzysztof Kozlowski <k.kozlowski@...sung.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>
CC:     lkml <linux-kernel@...r.kernel.org>,
        arcml <linux-snps-arc@...ts.infradead.org>
Subject: semantics of dma_map_single()

P.S. Apologies in advance for the explicit TO list, it seemed adding people who've 
touched the dma mapping code (for ARC atleast), would respond sooner ;-)

The question is does dma_map_single() imply a single region (possibly > PAGE_SIZE) 
or does it imply PAGE_SIZE. Documentation/DMA-API* is not explicit about one or 
the other and the code below seems to point to "a" struct page, although it could 
also mean multiple pages, specially if the pages are contiguous, say as those 
returned by alloc_pages(with order > 0)


	static inline dma_addr_t dma_map_single_attrs(dev, size, dir, attrs)
	{
		addr = ops->map_page(dev,
			virt_to_page(ptr), <--- this is one struct page
			offset_in_page(ptr), size, dir, attrs);
	}

ARC dma_map_single() currently only handles cache coherency for only one struct 
page or PAGE_SIZE worth of memory, and we have a customer who seem to assume that 
it handles a region.

Looking at other arches dma mapping backend, it is not clear either what the 
semantics are.

Thx,
-Vineet

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ