[PATCH] xmon breakpoints fix for Power4/5

Jake Moilanen moilanen at austin.ibm.com
Thu Jan 6 01:42:02 EST 2005


On Wed, 5 Jan 2005 10:53:34 +1100
Paul Mackerras <paulus at samba.org> wrote:

> Jake Moilanen writes:
> 
> > Looks like xmon breakpoints were not working on Power4/5.  Here's a fix
> > to the problem.  
> 
> You mean the 'bi' command didn't make a breakpoint?  Just use the 'b'
> command instead.  Also you take out the if (bp != NULL) check which is
> needed.

I may have misunderstood what Anton wanted when I talked w/ him
yesterday, but I was under the impression that he wanted 'bi' and 'bd'
fixed for Power4/5/LPAR.  

I pretty much just made 'bi' work like 'b' for Power4/5.  I should have
been a little more explicit when I wrote up the description of the
patch. 

If I misunderstood, please just throw this follow up patch away.  

In the follow up, I also included the (bp != NULL) even though it should
not matter because we reuse the same bp everytime.  I do agree that it
should still have the check.  

I will be posting the 'bd' fix for LPAR shortly.

Thanks,
Jake

Signed-off-by: Jake Moilanen <moilanen at austin.ibm.com>

---


diff -puN arch/ppc64/xmon/xmon.c~xmon-lpar-bp arch/ppc64/xmon/xmon.c
--- linux-2.6-bk/arch/ppc64/xmon/xmon.c~xmon-lpar-bp	Wed Jan  5 08:14:09 2005
+++ linux-2.6-bk-moilanen/arch/ppc64/xmon/xmon.c	Wed Jan  5 08:15:48 2005
@@ -1050,7 +1050,7 @@ static char *breakpoint_help_string = 
     "b <addr> [cnt]   set breakpoint at given instr addr\n"
     "bc               clear all breakpoints\n"
     "bc <n/addr>      clear breakpoint number n or at addr\n"
-    "bi <addr> [cnt]  set hardware instr breakpoint (broken?)\n"
+    "bi <addr> [cnt]  set hardware instr breakpoint\n"
     "bd <addr> [cnt]  set hardware data breakpoint (broken?)\n"
     "";
 
@@ -1088,11 +1088,6 @@ bpt_cmds(void)
 		break;
 
 	case 'i':	/* bi - hardware instr breakpoint */
-		if (!(cur_cpu_spec->cpu_features & CPU_FTR_IABR)) {
-			printf("Hardware instruction breakpoint "
-			       "not supported on this cpu\n");
-			break;
-		}
 		if (iabr) {
 			iabr->enabled &= ~(BP_IABR | BP_IABR_TE);
 			iabr = NULL;
@@ -1101,11 +1096,16 @@ bpt_cmds(void)
 			break;
 		if (!check_bp_loc(a))
 			break;
+
 		bp = new_breakpoint(a);
-		if (bp != NULL) {
-			bp->enabled |= BP_IABR | BP_IABR_TE;
-			iabr = bp;
+		if (bp) {
+			if (cur_cpu_spec->cpu_features & CPU_FTR_IABR) {		
+				bp->enabled |= BP_IABR | BP_IABR_TE;
+				iabr = bp;
+			} else 
+				bp->enabled |= BP_TRAP;
 		}
+		
 		break;
 
 	case 'c':

_



More information about the Linuxppc64-dev mailing list