hw-breakpoints: reset bits in dr6 after the corresponding exception is handled
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / x86 / mm / kmmio.c
index 16ccbd77917f22c1693b9b41fcb8dc7485acee39..11a4ad4d62530ff58b7bfa56d086ad69e3fc0bd1 100644 (file)
@@ -540,8 +540,14 @@ kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
        struct die_args *arg = args;
 
        if (val == DIE_DEBUG && (arg->err & DR_STEP))
-               if (post_kmmio_handler(arg->err, arg->regs) == 1)
+               if (post_kmmio_handler(arg->err, arg->regs) == 1) {
+                       /*
+                        * Reset the BS bit in dr6 (pointed by args->err) to
+                        * denote completion of processing
+                        */
+                       (*(unsigned long *)ERR_PTR(arg->err)) &= ~DR_STEP;
                        return NOTIFY_STOP;
+               }
 
        return NOTIFY_DONE;
 }