title: Linux kernel virtual to physical address translation
body: <p>I have a virtual address that lies in the kernel virtual address space i.e 
  3GB &lt;= vaddr &lt;= 4GB which I want to translate to a physical address.</p>
  
  <p>Taking a look at the kernel source I can see virt_to_phys () function which in turn uses :
   __pa(x) ((unsigned long)(x) - VIRT_PHYS_OFFSET). 
  So does this mean that any virtual address can be converted to a physical address by this equation ? </p>
  
  <p>phys_addr = virt_addr - PAGE_OFFSET (where 3GB &lt;= virt_addr &lt;= 4GB) or does this address translation works for some different range of virt_addr.</p>
  
  <p>Does this mean that if the address of the .text section of a dynamically loaded kernel module KMod 0xf23dc038, then the physical address at which the module symbols are available will be 
  0xf23dc038 - 0xc0000000 ?</p>
  
  <p>If this is the case then what is the use of Kernel page tables ?</p>
  
  <p>Thanks in advance.</p>