Re: Cache incoherencies [example code]

Benjamin Herrenschmidt (bh40@calva.net)
Mon, 30 Aug 1999 14:43:19 +0200


On Mon, Aug 30, 1999, Philip Blundell <Philip.Blundell@pobox.com> wrote:

>>datas are not correctly read by the chip, so I beleive this is because
>>virt_to_bus doesn't work with vmalloc addresses, am I wrong ?
>
>That's true, it doesn't. To get the physical address you need to walk
>pagetables as someone (either Roger or Ralf I think) pointed out. I think
>there is code in ptrace.c that shows how this is done but it's not really
>recommended practice.
>
>So, maybe the vmalloc idea wasn't such a good one after all and some
>completely new routine is needed.

OK. However, I need to find a temporary solution before someone
implements this new mecanism (I don't think I can do it with my current
knowledge of Linux mm). I would prefer avoiding walking the page tables,
this is complex and I've seen all Linus promises of quick death to
whoever would try to do that ;-)

What happens if I simply try to create an additional mapping for an
existing page ? Basically, what happens if I use ioremap on the physical
location of a kmalloc'ed page ?

Of course, I will end up having two virtual mappings to the same page,
but if I make sure to only actually use the uncachable one, will there be
a problem ? Would something prevent ioremap from creating a mapping for a
physical page in the SDRAM range ?

Regards,
Benjamin.

-- 
           Perso. e-mail: <mailto:bh40@calva.net>
           Work   e-mail: <mailto:benh@mipsys.com>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

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