Re: Bug: Discontigmem virt_to_page() [Alpha,ARM,Mips64?]

Daniel Phillips (phillips@bonn-fries.net)
Fri, 10 May 2002 01:22:11 +0200


On Friday 10 May 2002 01:00, Roman Zippel wrote:
> > Look at drivers/char/mem.c, read_mem. Clearly, the code is not dealing with
> > physical addresses. Yet it starts off with virt_to_phys, and thereafter works
> > in zero-offset addresses. Why? Because it's clearer and more efficient to do
> > that. The generic part of my nonlinear patch clarifies this usage by rewriting
> > it as virt_to_logical, which is really what's happening.
>
> Are we looking at the same code??? Where is that zero-offset thingie? It
> just works with virtual and physical addresses and needs to convert
> between them.

Show me where the 'physical' address is actually treated as a physical address.
You can't, because it isn't. The 'physical' address is merely a zero-based
logical address, and the code *relies* on it being contiguous.

Your code is going to do __pa there, and you are going to go walking into places
you don't expect. Even you need my logical address space abstraction, or else you
want to go making global changes to the common kernel code that just add cruft.

I enjoy the feeling of removing cruft, even when it's an uphill battle.

-- 
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/