hw-breakpoints, perf: Fix broken mmiotrace due to dr6 by reference change

Commit 62edab9056a6cf0c9207339c8892c923a5217e45 (from June 2009
but merged in 2.6.33) changes notify_die to pass dr6 by
reference.

However, it forgets to fix the check for DR_STEP in kmmio.c,
breaking mmiotrace. It also passes a wrong value to the post
handler.

This simple fix makes mmiotrace work again.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Acked-by: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1263634770-14578-1-git-send-email-luca@luca-barbieri.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Luca Barbieri and committed by Ingo Molnar 0bb7a95f 8f06d7e6

+4 -3
+4 -3
arch/x86/mm/kmmio.c
··· 538 kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args) 539 { 540 struct die_args *arg = args; 541 542 - if (val == DIE_DEBUG && (arg->err & DR_STEP)) 543 - if (post_kmmio_handler(arg->err, arg->regs) == 1) { 544 /* 545 * Reset the BS bit in dr6 (pointed by args->err) to 546 * denote completion of processing 547 */ 548 - (*(unsigned long *)ERR_PTR(arg->err)) &= ~DR_STEP; 549 return NOTIFY_STOP; 550 } 551
··· 538 kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args) 539 { 540 struct die_args *arg = args; 541 + unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err); 542 543 + if (val == DIE_DEBUG && (*dr6_p & DR_STEP)) 544 + if (post_kmmio_handler(*dr6_p, arg->regs) == 1) { 545 /* 546 * Reset the BS bit in dr6 (pointed by args->err) to 547 * denote completion of processing 548 */ 549 + *dr6_p &= ~DR_STEP; 550 return NOTIFY_STOP; 551 } 552