aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/events/uprobes.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index d1edc5e6fd03..adcd76a96839 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1291,14 +1291,8 @@ static unsigned long xol_get_insn_slot(struct uprobe *uprobe)
1291 if (unlikely(!xol_vaddr)) 1291 if (unlikely(!xol_vaddr))
1292 return 0; 1292 return 0;
1293 1293
1294 /* Initialize the slot */ 1294 arch_uprobe_copy_ixol(area->page, xol_vaddr,
1295 copy_to_page(area->page, xol_vaddr, 1295 &uprobe->arch.ixol, sizeof(uprobe->arch.ixol));
1296 &uprobe->arch.ixol, sizeof(uprobe->arch.ixol));
1297 /*
1298 * We probably need flush_icache_user_range() but it needs vma.
1299 * This should work on supported architectures too.
1300 */
1301 flush_dcache_page(area->page);
1302 1296
1303 return xol_vaddr; 1297 return xol_vaddr;
1304} 1298}
@@ -1341,6 +1335,21 @@ static void xol_free_insn_slot(struct task_struct *tsk)
1341 } 1335 }
1342} 1336}
1343 1337
1338void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
1339 void *src, unsigned long len)
1340{
1341 /* Initialize the slot */
1342 copy_to_page(page, vaddr, src, len);
1343
1344 /*
1345 * We probably need flush_icache_user_range() but it needs vma.
1346 * This should work on most of architectures by default. If
1347 * architecture needs to do something different it can define
1348 * its own version of the function.
1349 */
1350 flush_dcache_page(page);
1351}
1352
1344/** 1353/**
1345 * uprobe_get_swbp_addr - compute address of swbp given post-swbp regs 1354 * uprobe_get_swbp_addr - compute address of swbp given post-swbp regs
1346 * @regs: Reflects the saved state of the task after it has hit a breakpoint 1355 * @regs: Reflects the saved state of the task after it has hit a breakpoint