Re: new bootmem structure

Russell King (rmk@arm.linux.org.uk)
Tue, 2 Nov 1999 21:49:25 +0000 (GMT)


Roman Zippel writes:
> > > Second, I would like to get a final answer on the purpose of the __pa/__va
> > > macros. So far I thought they could be used for fast address conversion
> > > on kernel memory, but since they not widely used in the kernel, they
> > > basically dummys in the m68k port. But bootmem.c uses them now quite often
> > > and in the new pre-patch I see that the arm people did change these macros
> > > and it makes no sense to me, except that it seems they want to get the
> > > bootmem stuff working with virtual addresses (or better a faked continuous
> > > physical address range).
^^^^ I seem to be missing this message...

Roman, if this is indeed your writing, you seem to have misinterpreted my patch.
We do not do any "faking" at all. On a machine with a non-contiguous address
space, we do not "fake" a contiguous address space, but we do a straight conversion,
ie, phys = (virt - offset) or some other simple mathematical function.

> > This is just Ingo being bad. He should have used virt_to_phys() and
> > friends, not __pa().

IMHO, __pa should not be the same as virt_to_phys(). If they are indeed
supposed to be the same, can we loose one of the names? It's a needless
complication which should not be there, and can lead to needless confusion.

However, as Roman points out, if the bootmem stuff is to use virt_to_phys(),
unless a "start" page number is passed in, the bit array could be
unnecessarily large, and may in certain systems cause major problems
(systems with many small (512KB) banks of memory).

> That's not really a problem, if we could define that __pa()/__va() works
> only specific memory areas and is completly undefined for others (except
> for __va(), see other mail for that).

I believe that virt_to_phys() ought to behave as we expect - convert a kernel
virtual address to a physical address, but __pa() or maybe a renamed __pa()
should return the offset into physical memory of the virtual address.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |

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