]> Git Repo - linux.git/blobdiff - arch/arm64/kernel/probes/uprobes.c
Merge branches 'for-next/gcs', 'for-next/probes', 'for-next/asm-offsets', 'for-next...
[linux.git] / arch / arm64 / kernel / probes / uprobes.c
index d49aef2657cdf74311bbbb9f6e4415b92c114b3c..cb3d05af36e3d0e9ea603af64478c06472f3b9c5 100644 (file)
@@ -17,12 +17,20 @@ void arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
        void *xol_page_kaddr = kmap_atomic(page);
        void *dst = xol_page_kaddr + (vaddr & ~PAGE_MASK);
 
+       /*
+        * Initial cache maintenance of the xol page done via set_pte_at().
+        * Subsequent CMOs only needed if the xol slot changes.
+        */
+       if (!memcmp(dst, src, len))
+               goto done;
+
        /* Initialize the slot */
        memcpy(dst, src, len);
 
        /* flush caches (dcache/icache) */
        sync_icache_aliases((unsigned long)dst, (unsigned long)dst + len);
 
+done:
        kunmap_atomic(xol_page_kaddr);
 }
 
@@ -34,7 +42,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs)
 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
                unsigned long addr)
 {
-       probe_opcode_t insn;
+       u32 insn;
 
        /* TODO: Currently we do not support AARCH32 instruction probing */
        if (mm->context.flags & MMCF_AARCH32)
@@ -42,7 +50,7 @@ int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
        else if (!IS_ALIGNED(addr, AARCH64_INSN_SIZE))
                return -EINVAL;
 
-       insn = *(probe_opcode_t *)(&auprobe->insn[0]);
+       insn = le32_to_cpu(auprobe->insn);
 
        switch (arm_probe_decode_insn(insn, &auprobe->api)) {
        case INSN_REJECTED:
@@ -102,13 +110,13 @@ bool arch_uprobe_xol_was_trapped(struct task_struct *t)
 
 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
-       probe_opcode_t insn;
+       u32 insn;
        unsigned long addr;
 
        if (!auprobe->simulate)
                return false;
 
-       insn = *(probe_opcode_t *)(&auprobe->insn[0]);
+       insn = le32_to_cpu(auprobe->insn);
        addr = instruction_pointer(regs);
 
        if (auprobe->api.handler)
This page took 0.036899 seconds and 4 git commands to generate.