All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix broken mmiotrace due to dr6 by reference change
@ 2010-01-16  9:39 Luca Barbieri
  2010-01-16 19:58 ` K.Prasad
  2010-01-17 18:30 ` [tip:perf/urgent] hw-breakpoints, perf: " tip-bot for Luca Barbieri
  0 siblings, 2 replies; 4+ messages in thread
From: Luca Barbieri @ 2010-01-16  9:39 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: K.Prasad, Frederic Weisbecker, linux-kernel, Luca Barbieri

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.

Please send to Linus for inclusion in 2.6.33

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
---
 arch/x86/mm/kmmio.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index c0f6198..536fb68 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -538,14 +538,15 @@ static int
 kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
 {
 	struct die_args *arg = args;
+	unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err);
 
-	if (val == DIE_DEBUG && (arg->err & DR_STEP))
-		if (post_kmmio_handler(arg->err, arg->regs) == 1) {
+	if (val == DIE_DEBUG && (*dr6_p & DR_STEP))
+		if (post_kmmio_handler(*dr6_p, 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;
+			*dr6_p &= ~DR_STEP;
 			return NOTIFY_STOP;
 		}
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix broken mmiotrace due to dr6 by reference change
  2010-01-16  9:39 [PATCH] Fix broken mmiotrace due to dr6 by reference change Luca Barbieri
@ 2010-01-16 19:58 ` K.Prasad
  2010-01-16 20:29   ` Luca Barbieri
  2010-01-17 18:30 ` [tip:perf/urgent] hw-breakpoints, perf: " tip-bot for Luca Barbieri
  1 sibling, 1 reply; 4+ messages in thread
From: K.Prasad @ 2010-01-16 19:58 UTC (permalink / raw)
  To: Luca Barbieri; +Cc: Ingo Molnar, Frederic Weisbecker, linux-kernel

On Sat, Jan 16, 2010 at 10:39:30AM +0100, Luca Barbieri wrote:
> 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.
> 

Yes, looks like I missed it...must have hunted down all those registered
to the die notifier...to propagate the fix.

> This simple fix makes mmiotrace work again.
> 
> Please send to Linus for inclusion in 2.6.33
> 
> Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Acked-by: K.Prasad <prasad@linux.vnet.ibm.com>

Thanks,
K.Prasad

> ---
>  arch/x86/mm/kmmio.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
> index c0f6198..536fb68 100644
> --- a/arch/x86/mm/kmmio.c
> +++ b/arch/x86/mm/kmmio.c
> @@ -538,14 +538,15 @@ static int
>  kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
>  {
>  	struct die_args *arg = args;
> +	unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err);
> 
> -	if (val == DIE_DEBUG && (arg->err & DR_STEP))
> -		if (post_kmmio_handler(arg->err, arg->regs) == 1) {
> +	if (val == DIE_DEBUG && (*dr6_p & DR_STEP))
> +		if (post_kmmio_handler(*dr6_p, 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;
> +			*dr6_p &= ~DR_STEP;
>  			return NOTIFY_STOP;
>  		}
> 
> -- 
> 1.6.3.3
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix broken mmiotrace due to dr6 by reference change
  2010-01-16 19:58 ` K.Prasad
@ 2010-01-16 20:29   ` Luca Barbieri
  0 siblings, 0 replies; 4+ messages in thread
From: Luca Barbieri @ 2010-01-16 20:29 UTC (permalink / raw)
  To: prasad; +Cc: Ingo Molnar, Frederic Weisbecker, linux-kernel

It seems kgdb needs to be fixed too.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:perf/urgent] hw-breakpoints, perf: Fix broken mmiotrace due to dr6 by reference change
  2010-01-16  9:39 [PATCH] Fix broken mmiotrace due to dr6 by reference change Luca Barbieri
  2010-01-16 19:58 ` K.Prasad
@ 2010-01-17 18:30 ` tip-bot for Luca Barbieri
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Luca Barbieri @ 2010-01-17 18:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, luca, tglx, prasad, mingo

Commit-ID:  0bb7a95f5455cd87e6a69e5818bc1f509a98d187
Gitweb:     http://git.kernel.org/tip/0bb7a95f5455cd87e6a69e5818bc1f509a98d187
Author:     Luca Barbieri <luca@luca-barbieri.com>
AuthorDate: Sat, 16 Jan 2010 10:39:30 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 17 Jan 2010 08:01:44 +0100

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>
---
 arch/x86/mm/kmmio.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index c0f6198..536fb68 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -538,14 +538,15 @@ static int
 kmmio_die_notifier(struct notifier_block *nb, unsigned long val, void *args)
 {
 	struct die_args *arg = args;
+	unsigned long* dr6_p = (unsigned long *)ERR_PTR(arg->err);
 
-	if (val == DIE_DEBUG && (arg->err & DR_STEP))
-		if (post_kmmio_handler(arg->err, arg->regs) == 1) {
+	if (val == DIE_DEBUG && (*dr6_p & DR_STEP))
+		if (post_kmmio_handler(*dr6_p, 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;
+			*dr6_p &= ~DR_STEP;
 			return NOTIFY_STOP;
 		}
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-17 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16  9:39 [PATCH] Fix broken mmiotrace due to dr6 by reference change Luca Barbieri
2010-01-16 19:58 ` K.Prasad
2010-01-16 20:29   ` Luca Barbieri
2010-01-17 18:30 ` [tip:perf/urgent] hw-breakpoints, perf: " tip-bot for Luca Barbieri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.