linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: BenHanokh Gabriel <gabriel@SANgate.com>
Cc: Linux-MM mailing list <linux-mm@kvack.org>
Subject: Re: how to translate virtual memory addresss into physical address ?
Date: Wed, 20 Sep 2000 10:53:08 +0100	[thread overview]
Message-ID: <20000920105308.K4608@redhat.com> (raw)
In-Reply-To: <39C86AF6.1040200@SANgate.com>; from gabriel@SANgate.com on Wed, Sep 20, 2000 at 10:44:54AM +0300

Hi,

On Wed, Sep 20, 2000 at 10:44:54AM +0300, BenHanokh Gabriel wrote:
> 
> how do i get in a kernel module the physical address from a virtual memory 
> addreess ( where the virual address can be either main-memory address or mmaped 
> pci memory) ?

When you say "main memory", do you mean user space virtual addresses
or just kernel space?

For kernel-space main memory, you just use virt_to_phys().

For pci memory, you usually don't do anything --- you *start* with the
physical address and work from there, creating a virtual address with
ioremap().  You can do the translation backwards, but only by walking
page tables.

You might want to use map_user_kiobuf() for user-space addresses if
you are running on 2.4 (or 2.2 with the raw IO patches).  I've got
diffs for a map_kernel_kiobuf() too, for 2.4 only.  Those will also
deal properly with things like locking user pages in memory and
dealing with high memory on Intel boxes.

Cheers,
 Stephen
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  reply	other threads:[~2000-09-20  9:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-20  7:44 BenHanokh Gabriel
2000-09-20  9:53 ` Stephen C. Tweedie [this message]
2000-09-20 10:26   ` BenHanokh Gabriel
2000-09-20 11:20     ` Stephen C. Tweedie
2000-09-20 12:16       ` BenHanokh Gabriel

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=20000920105308.K4608@redhat.com \
    --to=sct@redhat.com \
    --cc=gabriel@SANgate.com \
    --cc=linux-mm@kvack.org \
    /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