lkml.org 
[lkml]   [2005]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Will __pa(vmalloc()) ever work?
Timur Tabi wrote:
> Gerd Knorr wrote:
>
>> Can you fix that? If so, try that. Would be the best.
>
>
> No, I cannot. The memory is passed to my driver from some other driver
> that I do not
> control.

What kind of driver are you writing, and what other driver is giving you
this address?

>> I think you can't. What is "anywhere else"? Does that include
>> userspace addresses?
>
> No, but it might include the stack.
>
>> Not sure how portable that is, but comparing the vaddr against
>> the vmalloc address space could work. There are macros for
>> that, VMALLOC_START & VMALLOC_END IIRC.
>
>
> Thanks, I'll try that.
>
> I still haven't gotten an answer to my question about whether
> pgd/pud/pmd/pte_offset will obtain the physical address for a kmalloc'd
> buffer.

Walking the page tables isn't guaranteed to work for all addresses on
all arches. On some you have to deal with large pages, on others you
have parts of the address space that are mapped by different mechanisms.
This isn't something that drivers should be getting involved in.

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

\
 
 \ /
  Last update: 2005-05-31 22:50    [W:0.396 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site