Re: [PATCH] gurantee DMA area for alloc_bootmem_low() ver. 2.

Dave Hansen
2005-08-10T03:06:34Z

On Tue, 2005-08-09 at 14:15 -0700, Mike Kravetz wrote:
> On Tue, Aug 09, 2005 at 08:11:20PM +0900, Yasunori Goto wrote:
> > I modified the patch which guarantees allocation of DMA area
> > at alloc_bootmem_low().
>
> I was going to replace more instances of __pa(MAX_DMA_ADDRESS) with
> max_dma_physaddr(). However, when grepping for MAX_DMA_ADDRESS I
> noticed instances of virt_to_phys(MAX_DMA_ADDRESS) as well. Can
> someone tell me what the differences are between __pa() and virt_to_phys().

At least one is that virt_to_phys()'s argument is usually 'volatile'
while __pa() is not. This, of course, varies from arch to arch.

If somebody wants to go and rip __pa() out from all of the arches, I
won't be especially sorry :)

Actually, it would be nice to have one arch-generic version which is
just the usual (vaddr - PAGE_OFFSET). That would probably take care of
80% of the individual implementations.

-- Dave