public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: brace@beardog.cce.hp.com
Cc: linux-kernel@vger.kernel.org, scameron@beardog.cce.hp.com
Subject: Re: How to create a kernel virtual mapping for physical addresses.
Date: Tue, 19 Apr 2011 21:51:41 +0200	[thread overview]
Message-ID: <201104192151.41511.arnd@arndb.de> (raw)
In-Reply-To: <20110408220321.GA777@beardog.cce.hp.com>

On Saturday 09 April 2011 00:03:21 brace@beardog.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

  reply	other threads:[~2011-04-19 19:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08 22:03 How to create a kernel virtual mapping for physical addresses brace
2011-04-19 19:51 ` Arnd Bergmann [this message]
     [not found]   ` <20110421184600.GA29746@beardog.cce.hp.com>
2011-04-21 19:36     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201104192151.41511.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=brace@beardog.cce.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scameron@beardog.cce.hp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox