All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes@linuxcare.com>
To: Timur Tabi <ttabi@interactivesi.com>
Cc: Linux MM mailing list <linux-mm@kvack.org>,
	Linux Kernel Mailing list <linux-kernel@vger.rutgers.edu>
Subject: Re: phys-to-virt kernel mapping and ioremap()
Date: 20 Jul 2000 20:41:51 +0200	[thread overview]
Message-ID: <d31z0osky8.fsf@lxplus015.cern.ch> (raw)
In-Reply-To: Timur Tabi's message of "Thu, 20 Jul 2000 13:06:21 -0500"

>>>>> "Timur" == Timur Tabi <ttabi@interactivesi.com> writes:

Timur> I'm studying the code for __ioremap and I'm confused by
Timur> something.  The phys_to_virt and virt_to_phys macros are very
Timur> simple.  Basically, in kernel space, the virtual address is an
Timur> offset of the physical address, so it's very simple.

You are making a bad assumption here, that PCI shared memory can be
treated as regular memory which it cannot.

Timur> 1) Doesn't this mapping break the phys_to_virt and virt_to_phys
Timur> macros?

Those two macros are not defined on ioremap'ed regions so it is
irrelevant.

Timur> 2) kmalloc takes real physical memory from the kernel heap.
Timur> But then the virtual addresses are remapped to other physical
Timur> memory.  What happens to the physical memory that kmalloc
Timur> allocated?  Why isn't it freed?

I asume it is used to generate page tables for the io memory it is
mapping, but I haven't looked at the code.

Jes
--
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-07-20 18:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20000720174852Z156962-31297+1037@vger.rutgers.edu>
2000-07-20 18:41 ` Jes Sorensen [this message]
2000-07-20 18:53   ` phys-to-virt kernel mapping and ioremap() Timur Tabi
     [not found] ` <20000720183534Z156966-31297+1096@vger.rutgers.edu>
2000-07-20 19:06   ` Jes Sorensen
2000-07-20 19:12   ` Ivan Passos
2000-07-20 18:06 Timur Tabi
2000-07-21 13:49 ` Jeff Garzik

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=d31z0osky8.fsf@lxplus015.cern.ch \
    --to=jes@linuxcare.com \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=ttabi@interactivesi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.