LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Page Table Addressing (https://www.linuxquestions.org/questions/linux-newbie-8/page-table-addressing-4175427438/)

kronus 09-15-2012 05:56 PM

Page Table Addressing
 
Hello,

I was reading about four level page tables implementation and I am not clear about one thing. Whether addresses stored in pud and pmd, are physical addresses or linear addresses.

I mean as far as I know, kernel itself cant de-reference a physical addresses directly. Correct??

johnsfine 09-15-2012 10:08 PM

Quote:

Originally Posted by kronus (Post 4781289)
Whether addresses stored in pud and pmd, are physical addresses or linear addresses.

Physical

Quote:

I mean as far as I know, kernel itself cant de-reference a physical addresses directly. Correct??
Correct, but maybe you are reading more into "de-reference ... directly" than is really there (if you see some contradiction between the answers to these two distantly related questions.

kronus 09-17-2012 12:40 PM

Quote:

Originally Posted by johnsfine (Post 4781370)
Physical



Correct, but maybe you are reading more into "de-reference ... directly" than is really there (if you see some contradiction between the answers to these two distantly related questions.

Thanks for your reply. However my point was, I see in code of pud_walk and pmd_walk that first thing these functions do is convert the received physical address into a linear address. So my point is, what is the advantage of storing physical addresses, when system has to convert it to logical address to access location content.

(pud_t *)pgd_page_vaddr(*pgd) + pud_index(address);

johnsfine 09-17-2012 01:20 PM

Quote:

Originally Posted by kronus (Post 4782484)
what is the advantage of storing physical addresses, when system has to convert it to logical address to access location content.

The page table structure is not a design choice in Linux in most architectures. The structure is defined by the CPU microcode. The main purpose of the whole thing is to communicate mapping information from the kernel to the portion of CPU microcode that handles TLB misses. That information must consist of physical addresses.

Linux itself sometimes also reads that information. But that is a secondary purpose. It is mainly written by the kernel to be read by the TLB miss microcode.


All times are GMT -5. The time now is 08:24 AM.