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] [day] [month] [year] [list]
Message-Id: <201104192151.41511.arnd@arndb.de>
Date:	Tue, 19 Apr 2011 21:51:41 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	brace@...rdog.cce.hp.com
Cc:	linux-kernel@...r.kernel.org, scameron@...rdog.cce.hp.com
Subject: Re: How to create a kernel virtual mapping for physical addresses.

On Saturday 09 April 2011 00:03:21 brace@...rdog.cce.hp.com wrote:
> Given a physical address and a length (which may span contiguous pages), how
> does one go about creating a virtual mapping for that address? That address may
> be in high memory (above 4GB) in a 32bit system.
> 
> ioremap() wants a 32bit physical address on 32bit systems. kmap() and
> kmap_atomic() wants a struct page which I am not sure how to get from a physical
> address.

Use kmap() on the page you get from pfn_to_page().

> If there already is a kernel mapping, then using the existing kernel mapping
> would be fine if I could figure out how to get it, but if there is not one,
> then I need to make one.
> 
> I think setting the DMA mask to 32bit would mean that I do not have to deal
> with highmem addresses in my particular case, but I still do not know how to
> get a virtual address from a physical.
 
DMA mask is only about devices doing DMA to your data, not about the
kernel touching it.

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