Lines Matching refs:vaddr
110 unsigned long vaddr; /* Page(s) of instruction slots */ member
136 static loff_t vaddr_to_offset(struct vm_area_struct *vma, unsigned long vaddr) in vaddr_to_offset() argument
138 return ((loff_t)vma->vm_pgoff << PAGE_SHIFT) + (vaddr - vma->vm_start); in vaddr_to_offset()
244 static void copy_from_page(struct page *page, unsigned long vaddr, void *dst, int len) in copy_from_page() argument
247 memcpy(dst, kaddr + (vaddr & ~PAGE_MASK), len); in copy_from_page()
251 static void copy_to_page(struct page *page, unsigned long vaddr, const void *src, int len) in copy_to_page() argument
254 memcpy(kaddr + (vaddr & ~PAGE_MASK), src, len); in copy_to_page()
258 static int verify_opcode(struct page *page, unsigned long vaddr, uprobe_opcode_t *new_opcode) in verify_opcode() argument
272 copy_from_page(page, vaddr, &old_opcode, UPROBE_SWBP_INSN_SIZE); in verify_opcode()
345 unsigned long vaddr = offset_to_vaddr(vma, uprobe->ref_ctr_offset); in valid_ref_ctr_vma() local
351 vma->vm_start <= vaddr && in valid_ref_ctr_vma()
352 vma->vm_end > vaddr; in valid_ref_ctr_vma()
368 __update_ref_ctr(struct mm_struct *mm, unsigned long vaddr, short d) in __update_ref_ctr() argument
376 if (!vaddr || !d) in __update_ref_ctr()
379 ret = get_user_pages_remote(mm, vaddr, 1, in __update_ref_ctr()
390 ptr = kaddr + (vaddr & ~PAGE_MASK); in __update_ref_ctr()
394 "curr val: %d, delta: %d\n", vaddr, *ptr, d); in __update_ref_ctr()
465 unsigned long vaddr, uprobe_opcode_t opcode) in uprobe_write_opcode() argument
481 ret = get_user_pages_remote(mm, vaddr, 1, gup_flags, in uprobe_write_opcode()
486 ret = verify_opcode(old_page, vaddr, &opcode); in uprobe_write_opcode()
514 new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, vaddr); in uprobe_write_opcode()
520 copy_to_page(new_page, vaddr, &opcode, UPROBE_SWBP_INSN_SIZE); in uprobe_write_opcode()
528 index = vaddr_to_offset(vma, vaddr & PAGE_MASK) >> PAGE_SHIFT; in uprobe_write_opcode()
546 ret = __replace_page(vma, vaddr, old_page, new_page); in uprobe_write_opcode()
561 collapse_pte_mapped_thp(mm, vaddr); in uprobe_write_opcode()
575 int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) in set_swbp() argument
577 return uprobe_write_opcode(auprobe, mm, vaddr, UPROBE_SWBP_INSN); in set_swbp()
590 set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) in set_orig_insn() argument
592 return uprobe_write_opcode(auprobe, mm, vaddr, in set_orig_insn()
839 struct mm_struct *mm, unsigned long vaddr) in prepare_uprobe() argument
859 ret = arch_uprobe_analyze_insn(&uprobe->arch, mm, vaddr); in prepare_uprobe()
897 struct vm_area_struct *vma, unsigned long vaddr) in install_breakpoint() argument
902 ret = prepare_uprobe(uprobe, vma->vm_file, mm, vaddr); in install_breakpoint()
914 ret = set_swbp(&uprobe->arch, mm, vaddr); in install_breakpoint()
924 remove_breakpoint(struct uprobe *uprobe, struct mm_struct *mm, unsigned long vaddr) in remove_breakpoint() argument
927 return set_orig_insn(&uprobe->arch, mm, vaddr); in remove_breakpoint()
954 unsigned long vaddr; member
1004 info->vaddr = offset_to_vaddr(vma, offset); in build_map_info()
1057 vma = find_vma(mm, info->vaddr); in register_for_each_vma()
1062 if (vma->vm_start > info->vaddr || in register_for_each_vma()
1063 vaddr_to_offset(vma, info->vaddr) != uprobe->offset) in register_for_each_vma()
1070 err = install_breakpoint(uprobe, mm, vma, info->vaddr); in register_for_each_vma()
1074 err |= remove_breakpoint(uprobe, mm, info->vaddr); in register_for_each_vma()
1244 unsigned long vaddr; in unapply_uprobe() local
1256 vaddr = offset_to_vaddr(vma, uprobe->offset); in unapply_uprobe()
1257 err |= remove_breakpoint(uprobe, mm, vaddr); in unapply_uprobe()
1331 unsigned long vaddr; in delayed_ref_ctr_inc() local
1342 vaddr = offset_to_vaddr(vma, du->uprobe->ref_ctr_offset); in delayed_ref_ctr_inc()
1343 ret = __update_ref_ctr(vma->vm_mm, vaddr, 1); in delayed_ref_ctr_inc()
1392 unsigned long vaddr = offset_to_vaddr(vma, uprobe->offset); in uprobe_mmap() local
1393 install_breakpoint(uprobe, vma->vm_mm, vma, vaddr); in uprobe_mmap()
1454 if (!area->vaddr) { in xol_add_vma()
1456 area->vaddr = get_unmapped_area(NULL, TASK_SIZE - PAGE_SIZE, in xol_add_vma()
1458 if (IS_ERR_VALUE(area->vaddr)) { in xol_add_vma()
1459 ret = area->vaddr; in xol_add_vma()
1464 vma = _install_special_mapping(mm, area->vaddr, PAGE_SIZE, in xol_add_vma()
1481 static struct xol_area *__create_xol_area(unsigned long vaddr) in __create_xol_area() argument
1504 area->vaddr = vaddr; in __create_xol_area()
1600 slot_addr = area->vaddr + (slot_nr * UPROBE_XOL_SLOT_BYTES); in xol_take_insn_slot()
1648 vma_end = area->vaddr + PAGE_SIZE; in xol_free_insn_slot()
1649 if (area->vaddr <= slot_addr && slot_addr < vma_end) { in xol_free_insn_slot()
1653 offset = slot_addr - area->vaddr; in xol_free_insn_slot()
1668 void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, in arch_uprobe_copy_ixol() argument
1672 copy_to_page(page, vaddr, src, len); in arch_uprobe_copy_ixol()
1699 return utask->vaddr; in uprobe_get_trap_addr()
1823 t->utask->dup_xol_addr = area->vaddr; in uprobe_copy_process()
1842 trampoline_vaddr = area->vaddr; in get_trampoline_vaddr()
1943 utask->vaddr = bp_vaddr; in pre_ssout()
2009 static int is_trap_at_addr(struct mm_struct *mm, unsigned long vaddr) in is_trap_at_addr() argument
2015 if (WARN_ON_ONCE(!IS_ALIGNED(vaddr, UPROBE_SWBP_INSN_SIZE))) in is_trap_at_addr()
2019 result = __get_user(opcode, (uprobe_opcode_t __user *)vaddr); in is_trap_at_addr()
2031 result = get_user_pages_remote(mm, vaddr, 1, FOLL_FORCE, &page, in is_trap_at_addr()
2036 copy_from_page(page, vaddr, &opcode, UPROBE_SWBP_INSN_SIZE); in is_trap_at_addr()