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:	Fri, 11 Dec 2009 23:39:42 +0200
From:	Maxim Levitsky <maximlevitsky@...il.com>
To:	linux-kernel <linux-kernel@...r.kernel.org>
Subject: Does pci_map_single magicly work on > 32 bit address for 32bit
 capable device?

Hi,

I am writing a driver, and I am faced with following problem:

I receive a kernel pointer, and I want device to dma into that memory.
However, device is only capable of 32 bit dma.

I can create a 'consistent' mapping and use memcpy from/to it, but it
feels like waste of performance.


According to Documentation/DMA-mapping.txt, I can tell that hw supports
32 bit dma using pci_set_dma_mask, however, what will happen if I pass
arbitrary kernel address into pci_map_single.
What will happen if the address is above 32 bit?

I tried to follow source of pci_map_single, but it is quite strongly
buried.
Also note that I don't need any scatter gather lists, because buffer
will always be 512 bytes long.


Note that I don't write the block driver itself, but a small driver that
plugs into that driver.
I am writing a driver for mtd subsystem and more precisely a nand
driver.

Unfortunately mtd system can call the driver with arbitrary kernel
pointer, although I am sure its not vmalloc'ed.
Usually it passes the pointer that is received from block subsystem.



Thanks in advance,
Maxim Levitsky

--
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