[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fwd: Re: How CPU(x86) resolve kernel address
> phyAddress = pte_page(*pte) ;
> ...
> where virtAddress is the address i passed from application so every time
> phyAddress i got is start with somthing like (C1081234) which is actually
> a kernel address space. why it is like so.
I don't think pte_page does what you think it does:
#define pte_page(x) (mem_map+((unsigned long)(((x).pte_low
>>PAGE_SHIFT))))
seems to return the address of the struct page for that physaddr,
not the physaddr itself. pte.pte_low might be closer to what you
want, but as has been pointed out already, that's not accurate if
it's been swapped out.
M.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/