In 64-bit Linux, IA-32E paging
is used with 4 levels of paging structures (PML4
/PDPT
/PD
/PT
). The entries in the former three structures give the physical address of the corresponding next structure. My question is that will the physical addresses of all these paging structures be mapped in the paging table? If they are mapped, in which mode (User
/Supervisor
)? Thanks very much!
I captured some specific memory addresses which a vcpu
have accessed during a period in KVM
. These addresses are in the gfn
(guest physical frame number) form. I wanted to tell if these gfns
were mapped in kernel or userspace. So I traversed the guest's (virtual machine) paging table to find out the corresponding page table entries mapping to these gfns
. See my previous question here.
I found that the physical addresses of some paging structures are mapped in the paging table while some are not. That is, the physical addresses of some paging structures (such as the address of PT
given by a PDE
) do not have valid corresponding PTE
in the page table. Since I have changed the memory mechanism of the KVM
a lot, I am afraid that maybe this phenomenon is caused by my code or maybe there is something wrong with my page-table-walking code.
So I want to know in a normal Linux, how these stuffs are handled.
Thanks very much!