* Hard-coded virtual address used by dma_alloc_coherent
@ 2008-07-24 19:19 Remi Machet
2008-07-24 19:29 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Remi Machet @ 2008-07-24 19:19 UTC (permalink / raw)
To: Linux PPC
Hi,
I have noticed that the DMA allocation for non-coherent PowerPC
architecture is using a hard coded virtual memory address for its memory
pool. This address is typically 0xFF100000 (set by
CONFIG_CONSISTENT_START) and can conflict with early ioremap in systems
that enable HIGHMEM.
Is there any reason why we have to use an arbitrary virtual address ? If
the virtual address must be known at compile time, can't we use fixmap ?
I also can't figure out why we need to use a virtual address known at
compilation time and cannot just allocate pages using get_free_pages and
mark them as non cacheable and non swappable.
For those of you that want to check it out, the code is in
arch/powerpc/lib/dma-noncoherent.c
Thanks,
Remi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hard-coded virtual address used by dma_alloc_coherent
2008-07-24 19:19 Hard-coded virtual address used by dma_alloc_coherent Remi Machet
@ 2008-07-24 19:29 ` Scott Wood
2008-07-24 21:43 ` Remi Machet
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2008-07-24 19:29 UTC (permalink / raw)
To: Remi Machet; +Cc: Linux PPC
Remi Machet wrote:
> I have noticed that the DMA allocation for non-coherent PowerPC
> architecture is using a hard coded virtual memory address for its memory
> pool. This address is typically 0xFF100000 (set by
> CONFIG_CONSISTENT_START) and can conflict with early ioremap in systems
> that enable HIGHMEM.
>
> Is there any reason why we have to use an arbitrary virtual address ? If
> the virtual address must be known at compile time, can't we use fixmap ?
The hardcoded address predates when fixmap was added to powerpc. It
should be updated to use fixmap.
> I also can't figure out why we need to use a virtual address known at
> compilation time and cannot just allocate pages using get_free_pages and
> mark them as non cacheable and non swappable.
We probably don't need a compile-time address, though we can't just
change the page attributes in-place as the pages will often covered by
large TLB entries.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hard-coded virtual address used by dma_alloc_coherent
2008-07-24 19:29 ` Scott Wood
@ 2008-07-24 21:43 ` Remi Machet
0 siblings, 0 replies; 3+ messages in thread
From: Remi Machet @ 2008-07-24 21:43 UTC (permalink / raw)
To: Scott Wood; +Cc: Linux PPC
On Thu, 2008-07-24 at 14:29 -0500, Scott Wood wrote:
> Remi Machet wrote:
> > I have noticed that the DMA allocation for non-coherent PowerPC
> > architecture is using a hard coded virtual memory address for its memory
> > pool. This address is typically 0xFF100000 (set by
> > CONFIG_CONSISTENT_START) and can conflict with early ioremap in systems
> > that enable HIGHMEM.
> >
> > Is there any reason why we have to use an arbitrary virtual address ? If
> > the virtual address must be known at compile time, can't we use fixmap ?
>
> The hardcoded address predates when fixmap was added to powerpc. It
> should be updated to use fixmap.
Ok, I will look into that.
> > I also can't figure out why we need to use a virtual address known at
> > compilation time and cannot just allocate pages using get_free_pages and
> > mark them as non cacheable and non swappable.
>
> We probably don't need a compile-time address, though we can't just
> change the page attributes in-place as the pages will often covered by
> large TLB entries.
If we use alloc_pages to allocate the physical memory and get_vm_area to
get a virtual address (and its associated PTE), wouldn't map_vm_area
take care of breaking the TLB into smaller chunks if necessary ?
Remi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-24 21:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 19:19 Hard-coded virtual address used by dma_alloc_coherent Remi Machet
2008-07-24 19:29 ` Scott Wood
2008-07-24 21:43 ` Remi Machet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).