title: How to get process's virtual address in Linux kernel
body: <p>Currently, I'm trying to figure out how to get the virtual address (VA) of a specific process in the Linux kernel, since there are several functions taking VA as an argument related to different page directories, including pgd_offset(), pgd_index(), p4d_offset(), p4d_index()...</p>
  <ol>
  <li><p>Could anyone explain the functions of these functions, including xxx_offset(), xxx_index()?(xxx:pgd, p4d, pmd...) And how to use these functions？</p>
  </li>
  <li><p>What does the VA mean when it is taken as an argument of functions mentioned above, is that the virtual address of the process? And how can I get the VA of a specific process? I've already known that we can use process's task_struct-&gt;mm-&gt;mmap to get the range of the virtual address space, but no idea about how to get a specific virtual address.</p>
  </li>
  <li><p>Is the task_struct-&gt;mm-&gt;pgd_t indicating the base address of PGD_directory?</p>
  </li>
  </ol>