Re: does pmd_offset return the physical address or virtual address of the page table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tsai,
   The Page Table Entries contain physical addresses. The PGD and PMD
entries are always present whereas as the PTE entries can be in memory
or swap. But the xxx_offset macros return the virtual address as they
use __va(address) to convert these physical addresses to virtual
addresses. This can be done because these are valid kernel virtual
addresses.

-------------
Raj.

On Apr 6, 2005 6:02 PM, nitin ahuja <nitin2ahuja@xxxxxxxxxxxxx> wrote:
> This is what Mel Gormen says:
> 
> pgd_offset() takes an address and the mm_struct for the process and returns the PGD entry that covers the requested address. pmd_offset() takes a PGD entry and an address and returns the relevant PMD. pte_offset() takes a PMD and returns the relevant PTE.
> 
> Physical address space is flat, no concept of PGDs, PMDs and PTEs. So, the address returned by pmd_offset is virtual address as one would access it inside kernel.
> 
> Nitin
> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
>

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux