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:	Tue, 6 Jan 2009 19:22:08 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	joro@...tes.org
Cc:	fujita.tomonori@....ntt.co.jp, mingo@...e.hu,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 8/8] remove map_single and unmap_single in struct
 dma_mapping_ops

On Mon, 5 Jan 2009 19:00:38 +0100
Joerg Roedel <joro@...tes.org> wrote:

> Is it the right way to implement map_single in terms of map_page? Doing
> this you optimize for the map_page case. But a grep in drivers/ shows:
> 
> linux/drivers $ grep -r _map_page *|wc -l
> 126
> linux/drivers $ grep -r _map_single *|wc -l
> 613

The comparison is irrelevant since dma_map_page and dma_map_single
have different purposes.

If passing virtual memory address to an IOMMU is enough (and
convenient), then drivers use dma_map_single.

For some purposes, drivers need to pass a page frame and use
dma_map_page (or dma_map_sg).

We could have two hooks in dma_map_ops struct for dma_map_single and
dma_map_page. Say, we have map_single and map_page hooks. But the
map_page hook can be used to support both dma_map_single and
dma_map_page. Note that the map_single hook can't do that since it use
a virtual address as an argument. That's why I have only the map_page
hook in dma_map_ops struct.

As X86 does now, we could have map_single hook that use a physical
address to handle both dma_map_single and dma_map_page. However, it's
confusing since it means that the arguments of dma_map_single and its
hook (map_single) is inconsistent.


> There are a lot more users of map_single than of map_page. I think its
> better to optimize for the map_single case and implement map_page in
> terms of map_single.

As I wrote above, it doesn't make sense.
--
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