arm64: hw_breakpoint: fix watchpoint matching for tagged pointers
[linux-2.6-microblaze.git] / arch / arm64 / kernel / hw_breakpoint.c
index 0296e79..749f817 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/traps.h>
 #include <asm/cputype.h>
 #include <asm/system_misc.h>
+#include <asm/uaccess.h>
 
 /* Breakpoint currently in use for each BRP. */
 static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[ARM_MAX_BRP]);
@@ -721,6 +722,8 @@ static u64 get_distance_from_watchpoint(unsigned long addr, u64 val,
        u64 wp_low, wp_high;
        u32 lens, lene;
 
+       addr = untagged_addr(addr);
+
        lens = __ffs(ctrl->len);
        lene = __fls(ctrl->len);