Thread (4 messages) 4 messages, 2 authors, 2016-02-08

Virtual and physical page address

From: Mohammad A Khasawneh <hidden>
Date: 2016-02-08 13:57:01

Thank you for your answer. Is there a way to get the virtual address by
traversing the pgd->pte->page hierarchy? I'm not sure I can use the
phys_to_virt() function.

Thanks,
Mohammad
On Feb 7, 2016 16:43, "Mike Krinkin" [off-list ref] wrote:
On Sun, Feb 07, 2016 at 04:24:08PM -0500, Mohammad A Khasawneh wrote:
quoted
Hello everyone,

I am attempting to dump the page table of a process in terms of virtual
addresses and the corresponding physical addresses. I am looking for
information whether the pointers I am using are correct for this purpose:

1. Can I say that pte_page(pte_t) returns the virtual address of the page
that the PTE points at?
pte_page returns struct page pointer (virtual address of the struct page,
but
i suppose it's not the virtual address you need), it has nothing to do
with a
virtual address the pte corresponds to.
quoted
2. can I say that page_to_phys(struct page) returns the physical address
of
quoted
that same entry?
page_to_phys returns physical address the struct page corresponds to, so
yes.
quoted
Thank you,
Mohammad
quoted
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160208/6ac720c6/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help