uprobes: Flush cache after xol write
authorRabin Vincent <rabin@rab.in>
Wed, 14 Nov 2012 17:27:07 +0000 (18:27 +0100)
committerOleg Nesterov <oleg@redhat.com>
Wed, 14 Nov 2012 17:32:24 +0000 (18:32 +0100)
Flush the cache so that the instructions written to the XOL area are
visible.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
kernel/events/uprobes.c

index 39c75cc..5ce99cf 100644 (file)
@@ -1199,6 +1199,11 @@ static unsigned long xol_get_insn_slot(struct uprobe *uprobe, unsigned long slot
        vaddr = kmap_atomic(area->page);
        memcpy(vaddr + offset, uprobe->arch.insn, MAX_UINSN_BYTES);
        kunmap_atomic(vaddr);
+       /*
+        * We probably need flush_icache_user_range() but it needs vma.
+        * This should work on supported architectures too.
+        */
+       flush_dcache_page(area->page);
 
        return current->utask->xol_vaddr;
 }