Lines Matching refs:va

123 static bool get_pml4e(struct va_space *vs, uint64_t va, uint64_t *value)  in get_pml4e()  argument
125 uint64_t pa = (vs->dtb & 0xffffffffff000) | ((va & 0xff8000000000) >> 36); in get_pml4e()
130 static bool get_pdpi(struct va_space *vs, uint64_t va, uint64_t pml4e, in get_pdpi() argument
134 ((va & 0x7FC0000000) >> 27); in get_pdpi()
139 static uint64_t pde_index(uint64_t va) in pde_index() argument
141 return (va >> 21) & 0x1FF; in pde_index()
149 static bool get_pgd(struct va_space *vs, uint64_t va, uint64_t pdpe, in get_pgd() argument
152 uint64_t pgd_entry = pdba_base(pdpe) + pde_index(va) * 8; in get_pgd()
157 static uint64_t pte_index(uint64_t va) in pte_index() argument
159 return (va >> 12) & 0x1FF; in pte_index()
167 static bool get_pte(struct va_space *vs, uint64_t va, uint64_t pgd, in get_pte() argument
170 uint64_t pgd_val = ptba_base(pgd) + pte_index(va) * 8; in get_pte()
175 static uint64_t get_paddr(uint64_t va, uint64_t pte) in get_paddr() argument
177 return (pte & 0xFFFFFFFFFF000) | (va & 0xFFF); in get_paddr()
190 static uint64_t get_1GB_paddr(uint64_t va, uint64_t pdpte) in get_1GB_paddr() argument
192 return (pdpte & 0xfffffc0000000) | (va & 0x3fffffff); in get_1GB_paddr()
195 static uint64_t get_2MB_paddr(uint64_t va, uint64_t pgd_entry) in get_2MB_paddr() argument
197 return (pgd_entry & 0xfffffffe00000) | (va & 0x00000001fffff); in get_2MB_paddr()
200 static uint64_t va_space_va2pa(struct va_space *vs, uint64_t va) in va_space_va2pa() argument
204 if (!get_pml4e(vs, va, &pml4e) || !is_present(pml4e)) { in va_space_va2pa()
208 if (!get_pdpi(vs, va, pml4e, &pdpe) || !is_present(pdpe)) { in va_space_va2pa()
213 return get_1GB_paddr(va, pdpe); in va_space_va2pa()
216 if (!get_pgd(vs, va, pdpe, &pgd) || !is_present(pgd)) { in va_space_va2pa()
221 return get_2MB_paddr(va, pgd); in va_space_va2pa()
224 if (!get_pte(vs, va, pgd, &pte) || !is_present(pte)) { in va_space_va2pa()
228 return get_paddr(va, pte); in va_space_va2pa()
231 void *va_space_resolve(struct va_space *vs, uint64_t va) in va_space_resolve() argument
233 uint64_t pa = va_space_va2pa(vs, va); in va_space_resolve()