Lines Matching refs:vmaddr
355 static int __gmap_unlink_by_vmaddr(struct gmap *gmap, unsigned long vmaddr) in __gmap_unlink_by_vmaddr() argument
362 entry = radix_tree_delete(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); in __gmap_unlink_by_vmaddr()
380 unsigned long vmaddr; in __gmap_unmap_by_gaddr() local
382 vmaddr = (unsigned long) radix_tree_delete(&gmap->guest_to_host, in __gmap_unmap_by_gaddr()
384 return vmaddr ? __gmap_unlink_by_vmaddr(gmap, vmaddr) : 0; in __gmap_unmap_by_gaddr()
475 unsigned long vmaddr; in __gmap_translate() local
477 vmaddr = (unsigned long) in __gmap_translate()
480 return vmaddr ? (vmaddr | (gaddr & ~PMD_MASK)) : -EFAULT; in __gmap_translate()
511 unsigned long vmaddr) in gmap_unlink() argument
518 flush = __gmap_unlink_by_vmaddr(gmap, vmaddr); in gmap_unlink()
539 int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr) in __gmap_link() argument
581 pgd = pgd_offset(mm, vmaddr); in __gmap_link()
583 p4d = p4d_offset(pgd, vmaddr); in __gmap_link()
585 pud = pud_offset(p4d, vmaddr); in __gmap_link()
590 pmd = pmd_offset(pud, vmaddr); in __gmap_link()
603 vmaddr >> PMD_SHIFT, table); in __gmap_link()
638 unsigned long vmaddr; in gmap_fault() local
646 vmaddr = __gmap_translate(gmap, gaddr); in gmap_fault()
647 if (IS_ERR_VALUE(vmaddr)) { in gmap_fault()
648 rc = vmaddr; in gmap_fault()
651 if (fixup_user_fault(gmap->mm, vmaddr, fault_flags, in gmap_fault()
663 rc = __gmap_link(gmap, gaddr, vmaddr); in gmap_fault()
676 unsigned long vmaddr; in __gmap_zap() local
681 vmaddr = (unsigned long) radix_tree_lookup(&gmap->guest_to_host, in __gmap_zap()
683 if (vmaddr) { in __gmap_zap()
684 vmaddr |= gaddr & ~PMD_MASK; in __gmap_zap()
686 vma = vma_lookup(gmap->mm, vmaddr); in __gmap_zap()
691 ptep = get_locked_pte(gmap->mm, vmaddr, &ptl); in __gmap_zap()
693 ptep_zap_unused(gmap->mm, vmaddr, ptep, 0); in __gmap_zap()
702 unsigned long gaddr, vmaddr, size; in gmap_discard() local
709 vmaddr = (unsigned long) in gmap_discard()
712 if (!vmaddr) in gmap_discard()
714 vmaddr |= gaddr & ~PMD_MASK; in gmap_discard()
716 vma = find_vma(gmap->mm, vmaddr); in gmap_discard()
726 zap_page_range(vma, vmaddr, size); in gmap_discard()
880 unsigned long vmaddr, int prot) in gmap_pte_op_fixup() argument
888 if (fixup_user_fault(mm, vmaddr, fault_flags, &unlocked)) in gmap_pte_op_fixup()
894 return __gmap_link(gmap, gaddr, vmaddr); in gmap_pte_op_fixup()
1049 unsigned long vmaddr, dist; in gmap_protect_range() local
1081 vmaddr = __gmap_translate(gmap, gaddr); in gmap_protect_range()
1082 if (IS_ERR_VALUE(vmaddr)) in gmap_protect_range()
1083 return vmaddr; in gmap_protect_range()
1084 rc = gmap_pte_op_fixup(gmap, gaddr, vmaddr, prot); in gmap_protect_range()
1137 unsigned long address, vmaddr; in gmap_read_table() local
1162 vmaddr = __gmap_translate(gmap, gaddr); in gmap_read_table()
1163 if (IS_ERR_VALUE(vmaddr)) { in gmap_read_table()
1164 rc = vmaddr; in gmap_read_table()
1167 rc = gmap_pte_op_fixup(gmap, gaddr, vmaddr, PROT_READ); in gmap_read_table()
1183 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, in gmap_insert_rmap() argument
1189 slot = radix_tree_lookup_slot(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT); in gmap_insert_rmap()
1196 radix_tree_insert(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT, in gmap_insert_rmap()
1216 unsigned long vmaddr; in gmap_protect_rmap() local
1224 vmaddr = __gmap_translate(parent, paddr); in gmap_protect_rmap()
1225 if (IS_ERR_VALUE(vmaddr)) in gmap_protect_rmap()
1226 return vmaddr; in gmap_protect_rmap()
1243 gmap_insert_rmap(sg, vmaddr, rmap); in gmap_protect_rmap()
1250 rc = gmap_pte_op_fixup(parent, paddr, vmaddr, PROT_READ); in gmap_protect_rmap()
2115 unsigned long vmaddr, paddr; in gmap_shadow_page() local
2132 vmaddr = __gmap_translate(parent, paddr); in gmap_shadow_page()
2133 if (IS_ERR_VALUE(vmaddr)) { in gmap_shadow_page()
2134 rc = vmaddr; in gmap_shadow_page()
2155 gmap_insert_rmap(sg, vmaddr, rmap); in gmap_shadow_page()
2165 rc = gmap_pte_op_fixup(parent, paddr, vmaddr, prot); in gmap_shadow_page()
2179 static void gmap_shadow_notify(struct gmap *sg, unsigned long vmaddr, in gmap_shadow_notify() argument
2205 head = radix_tree_delete(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT); in gmap_shadow_notify()
2241 void ptep_notify(struct mm_struct *mm, unsigned long vmaddr, in ptep_notify() argument
2254 vmaddr >> PMD_SHIFT); in ptep_notify()
2265 gmap_shadow_notify(sg, vmaddr, gaddr); in ptep_notify()
2308 static void gmap_pmdp_clear(struct mm_struct *mm, unsigned long vmaddr, in gmap_pmdp_clear() argument
2319 vmaddr >> PMD_SHIFT); in gmap_pmdp_clear()
2340 void gmap_pmdp_invalidate(struct mm_struct *mm, unsigned long vmaddr) in gmap_pmdp_invalidate() argument
2342 gmap_pmdp_clear(mm, vmaddr, 0); in gmap_pmdp_invalidate()
2351 void gmap_pmdp_csp(struct mm_struct *mm, unsigned long vmaddr) in gmap_pmdp_csp() argument
2353 gmap_pmdp_clear(mm, vmaddr, 1); in gmap_pmdp_csp()
2362 void gmap_pmdp_idte_local(struct mm_struct *mm, unsigned long vmaddr) in gmap_pmdp_idte_local() argument
2372 vmaddr >> PMD_SHIFT); in gmap_pmdp_idte_local()
2397 void gmap_pmdp_idte_global(struct mm_struct *mm, unsigned long vmaddr) in gmap_pmdp_idte_global() argument
2407 vmaddr >> PMD_SHIFT); in gmap_pmdp_idte_global()
2466 unsigned long gaddr, unsigned long vmaddr) in gmap_sync_dirty_log_pmd() argument
2481 for (i = 0; i < _PAGE_ENTRIES; i++, vmaddr += PAGE_SIZE) { in gmap_sync_dirty_log_pmd()
2482 ptep = pte_alloc_map_lock(gmap->mm, pmdp, vmaddr, &ptl); in gmap_sync_dirty_log_pmd()
2485 if (ptep_test_and_clear_uc(gmap->mm, vmaddr, ptep)) in gmap_sync_dirty_log_pmd()