Re: phys-to-virt kernel mapping and ioremap()

From: Jes Sorensen (jes@linuxcare.com)
Date: Thu Jul 20 2000 - 13:41:51 EST


>>>>> "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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:14 EST