<p dir="ltr">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.</p>
<p dir="ltr">Thanks,<br>
Mohammad</p>
<div class="gmail_quote">On Feb 7, 2016 16:43, "Mike Krinkin" <<a href="mailto:krinkin.m.u@gmail.com">krinkin.m.u@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Feb 07, 2016 at 04:24:08PM -0500, Mohammad A Khasawneh wrote:<br>
> Hello everyone,<br>
><br>
> I am attempting to dump the page table of a process in terms of virtual<br>
> addresses and the corresponding physical addresses. I am looking for<br>
> information whether the pointers I am using are correct for this purpose:<br>
><br>
> 1. Can I say that pte_page(pte_t) returns the virtual address of the page<br>
> that the PTE points at?<br>
<br>
pte_page returns struct page pointer (virtual address of the struct page, but<br>
i suppose it's not the virtual address you need), it has nothing to do with a<br>
virtual address the pte corresponds to.<br>
<br>
><br>
> 2. can I say that page_to_phys(struct page) returns the physical address of<br>
> that same entry?<br>
<br>
page_to_phys returns physical address the struct page corresponds to, so yes.<br>
<br>
><br>
> Thank you,<br>
> Mohammad<br>
<br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" rel="noreferrer" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
</blockquote></div>