linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
@ 2013-04-11 23:21 Chris Friesen
  2014-04-22 12:43 ` shiva7
  2014-05-20  8:09 ` Deepak Pandian
  0 siblings, 2 replies; 10+ messages in thread
From: Chris Friesen @ 2013-04-11 23:21 UTC (permalink / raw)
  To: linuxppc-dev

Hi all,

Sorry for the bunch of emails, I'm working on some new stuff and running 
into issues.

For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP 
but not DBCR0_BRT.  Is that just because none of the code paths 
currently using DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?

Also, in sys_debug_setcontext() why does SIG_DBG_BRANCH_TRACING return 
-EINVAL if CONFIG_PPC_ADV_DEBUG_REGS is set?  Would it not be possible 
to use DBCR0_BRT?

Thanks,
Chris

-- 

Chris Friesen
Software Designer

500 Palladium Drive, Suite 2100
Ottawa, Ontario K2N 1C2, Canada
www.genband.com
office:+1.343.883.2717
chris.friesen@genband.com

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2013-04-11 23:21 questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS Chris Friesen
@ 2014-04-22 12:43 ` shiva7
  2014-04-22 22:31   ` Scott Wood
  2014-05-20  8:09 ` Deepak Pandian
  1 sibling, 1 reply; 10+ messages in thread
From: shiva7 @ 2014-04-22 12:43 UTC (permalink / raw)
  To: linuxppc-dev

I have the same question as like above posted by Mr. Chirs. 

Could someone help to understand why the debug BRT bit not handled in debug
context sys call? Intentional or need volunteer to finish up this part :)



--
View this message in context: http://linuxppc.10917.n7.nabble.com/questions-on-CONFIG-PPC-ADV-DEBUG-REGS-DBCR0-BRT-and-DBCR0-ACTIVE-EVENTS-tp70147p81732.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-04-22 12:43 ` shiva7
@ 2014-04-22 22:31   ` Scott Wood
  2014-04-22 22:37     ` Scott Wood
  0 siblings, 1 reply; 10+ messages in thread
From: Scott Wood @ 2014-04-22 22:31 UTC (permalink / raw)
  To: shiva7; +Cc: Chris Friesen, linuxppc-dev, Dave Kleikamp, Torez Smith

On Tue, 2014-04-22 at 05:43 -0700, shiva7 wrote:
> I have the same question as like above posted by Mr. Chirs. 

I had to google the subject to find what e-mail you were talking about
-- it was posted a year ago:

http://marc.info/?l=linuxppc-embedded&m=136572252330650&w=2

Next time please quote the e-mail if you're trying to revive a thread,
and keep the original poster on CC.

I've quoted it here:

> Sorry for the bunch of emails, I'm working on some new stuff and running 
> into issues.
> 
> For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP 
> but not DBCR0_BRT.  Is that just because none of the code paths 
> currently using DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?

Perhaps it was just an oversight.  I've CCed Dave Kleikamp and Torez
Smith, who added DBCR0_ACTIVE_EVENTS.

> Also, in sys_debug_setcontext() why does SIG_DBG_BRANCH_TRACING return 
> -EINVAL if CONFIG_PPC_ADV_DEBUG_REGS is set?  Would it not be possible 
> to use DBCR0_BRT?

Either nobody has gotten around to implementing it, or the semantics
are different in some way (if the semantics are even defined anywhere
-- I couldn't find any documentation).

-Scott

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-04-22 22:31   ` Scott Wood
@ 2014-04-22 22:37     ` Scott Wood
  2014-05-18 23:38       ` shiva7
  0 siblings, 1 reply; 10+ messages in thread
From: Scott Wood @ 2014-04-22 22:37 UTC (permalink / raw)
  To: shiva7; +Cc: Chris Friesen, linuxppc-dev

On Tue, 2014-04-22 at 17:31 -0500, Scott Wood wrote:
> On Tue, 2014-04-22 at 05:43 -0700, shiva7 wrote:
> > I have the same question as like above posted by Mr. Chirs. 
> 
> I had to google the subject to find what e-mail you were talking about
> -- it was posted a year ago:
> 
> http://marc.info/?l=linuxppc-embedded&m=136572252330650&w=2
> 
> Next time please quote the e-mail if you're trying to revive a thread,
> and keep the original poster on CC.
> 
> I've quoted it here:
> 
> > Sorry for the bunch of emails, I'm working on some new stuff and running 
> > into issues.
> > 
> > For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP 
> > but not DBCR0_BRT.  Is that just because none of the code paths 
> > currently using DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?
> 
> Perhaps it was just an oversight.  I've CCed Dave Kleikamp and Torez
> Smith, who added DBCR0_ACTIVE_EVENTS.

...and both of those e-mails bounced, so it may be that nobody who is
listening knows the answer.  Feel free to submit a patch that adds it,
with the changelog explaining why it should be included.

-Scott

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-04-22 22:37     ` Scott Wood
@ 2014-05-18 23:38       ` shiva7
  2014-05-19 17:47         ` Scott Wood
  0 siblings, 1 reply; 10+ messages in thread
From: shiva7 @ 2014-05-18 23:38 UTC (permalink / raw)
  To: linuxppc-dev

Thanks Scott.

Apologize for not quoting the old email reference. I assumed the old archive
content always will be in the trail.

Any idea whether the DBCR0 BRT bit actually works(??), if I add  DBCR0 under
sys_debug context call? because this code seems like direct porting and
wondering why on first place not included under debug_context call. 

And also, anything special required for "server" family application code
porting here ?? as because in server family the trace exception used to viz
NORMAL exception proglog and uses SRR0 and SRR1 but in this ISA/embedded
case have dedicated DEBUG_DEBUG prolog and dedicated registers DSRR0 and
DSRR1.

I can see the debug handler already have HACK to simulate the branch taken
case and SIGTRAP to user space.

Thanks in Advance.



--
View this message in context: http://linuxppc.10917.n7.nabble.com/questions-on-CONFIG-PPC-ADV-DEBUG-REGS-DBCR0-BRT-and-DBCR0-ACTIVE-EVENTS-tp70147p82408.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-05-18 23:38       ` shiva7
@ 2014-05-19 17:47         ` Scott Wood
  2014-05-20 13:06           ` shiva7
  0 siblings, 1 reply; 10+ messages in thread
From: Scott Wood @ 2014-05-19 17:47 UTC (permalink / raw)
  To: shiva7; +Cc: linuxppc-dev

On Sun, 2014-05-18 at 16:38 -0700, shiva7 wrote:
> Thanks Scott.
> 
> Apologize for not quoting the old email reference.

You did it again. :-)

> I assumed the old archive content always will be in the trail.

It's in the archives (as I noted), but it's a pain to search for it
versus having relevant bits quoted.

> Any idea whether the DBCR0 BRT bit actually works(??),

Do you have reason to believe that it might not?

> if I add  DBCR0 under sys_debug context call? because this code seems
> like direct porting and wondering why on first place not included under
> debug_context call. 

Again, it was probably an oversight, but the people who might know for
sure are no longer reachable.

> And also, anything special required for "server" family application code
> porting here ?? as because in server family the trace exception used to viz
> NORMAL exception proglog and uses SRR0 and SRR1 but in this ISA/embedded
> case have dedicated DEBUG_DEBUG prolog and dedicated registers DSRR0 and
> DSRR1.

IIRC the branch taken mechanism does have different semantics than the
equivalent mechanism on server.  You can find discussion of this in the
archives. :-)

-Scott

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2013-04-11 23:21 questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS Chris Friesen
  2014-04-22 12:43 ` shiva7
@ 2014-05-20  8:09 ` Deepak Pandian
  1 sibling, 0 replies; 10+ messages in thread
From: Deepak Pandian @ 2014-05-20  8:09 UTC (permalink / raw)
  To: linuxppc-dev

unsubcribe linuxppc-dev

On Fri, Apr 12, 2013 at 4:51 AM, Chris Friesen
<chris.friesen@genband.com> wrote:
> Hi all,
>
> Sorry for the bunch of emails, I'm working on some new stuff and running
> into issues.
>
> For CONFIG_BOOKE it appears that DBCR0_ACTIVE_EVENTS includes DBCR0_ICMP but
> not DBCR0_BRT.  Is that just because none of the code paths currently using
> DBCR0_ACTIVE_EVENTS need to check DBCR0_BT?
>
> Also, in sys_debug_setcontext() why does SIG_DBG_BRANCH_TRACING return
> -EINVAL if CONFIG_PPC_ADV_DEBUG_REGS is set?  Would it not be possible to
> use DBCR0_BRT?
>
> Thanks,
> Chris
>
> --
>
> Chris Friesen
> Software Designer
>
> 500 Palladium Drive, Suite 2100
> Ottawa, Ontario K2N 1C2, Canada
> www.genband.com
> office:+1.343.883.2717
> chris.friesen@genband.com
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev



-- 
With Regards,
Deepak Pandian
"Deconstructing world one piece at a time"

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-05-19 17:47         ` Scott Wood
@ 2014-05-20 13:06           ` shiva7
  2014-05-26 22:20             ` shiva7
  0 siblings, 1 reply; 10+ messages in thread
From: shiva7 @ 2014-05-20 13:06 UTC (permalink / raw)
  To: linuxppc-dev

Thanks again Scott.

/> Any idea whether the DBCR0 BRT bit actually works(??), 

> Do you have reason to believe that it might not? /

I'm facing a strange problem which was not there on server processor. Let me
try to give brief flow.

Server :

Set BE bit (thru system call or sigreturn) for specific thread -> for every
branch -> trace exception -> Normal exception prolog (STD_EXCEPTION_COMMON)
SRR0 and SRR1

Embedded/BOOKE:

Set DE & BRT bit (thru system call or sigreturn) for specific thread -> for
every branch taken -> Debug exception -> DEBUG_DEBUG prolog ->
return_dbg_except DSRR0 & DSRR1

In server case, able to capture the branches as expected, but wherein BOOKE
though branch taken exception are generated, at the certain stage (mostly
after turn on BRT & DE bit)  user process is deviated (not taking the same
flow as like server) and leading to different corruption/unexpected
behavior.

/> And also, anything special required for "server" family application code 
> porting here ?? as because in server family the trace exception used to
> viz 
> NORMAL exception proglog and uses SRR0 and SRR1 but in this ISA/embedded 
> case have dedicated DEBUG_DEBUG prolog and dedicated registers DSRR0 and 
> DSRR1. 

> IIRC the branch taken mechanism does have different semantics than the 
> equivalent mechanism on server.  You can find discussion of this in the 
> archives. :-) /

Most of the discussions so far I have surfed are related to branch
taken/fall through(not taken) semantics related. But, in general, if I have
an application running on server where tracing was based on BE bit and same
can run on e500mc with DE & BRT combination?


Thanks In Advance.



--
View this message in context: http://linuxppc.10917.n7.nabble.com/questions-on-CONFIG-PPC-ADV-DEBUG-REGS-DBCR0-BRT-and-DBCR0-ACTIVE-EVENTS-tp70147p82485.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-05-20 13:06           ` shiva7
@ 2014-05-26 22:20             ` shiva7
  2014-05-29 21:08               ` Scott Wood
  0 siblings, 1 reply; 10+ messages in thread
From: shiva7 @ 2014-05-26 22:20 UTC (permalink / raw)
  To: linuxppc-dev

shiva7 wrote
> Thanks again Scott.
/
>> Any idea whether the DBCR0 BRT bit actually works(??), 
> 
>> Do you have reason to believe that it might not? 
/
> 
> I'm facing a strange problem which was not there on server processor. Let
> me try to give brief flow.
> 
> Server :
> 
> Set BE bit (thru system call or sigreturn) for specific thread -> for
> every branch -> trace exception -> Normal exception prolog
> (STD_EXCEPTION_COMMON) SRR0 and SRR1
> 
> Embedded/BOOKE:
> 
> Set DE & BRT bit (thru system call or sigreturn) for specific thread ->
> for every branch taken -> Debug exception -> DEBUG_DEBUG prolog ->
> return_dbg_except DSRR0 & DSRR1
> 
> In server case, able to capture the branches as expected, but wherein
> BOOKE though branch taken exception are generated, at the certain stage
> (mostly after turn on BRT & DE bit)  user process is deviated (not taking
> the same flow as like server) and leading to different
> corruption/unexpected behavior.
/
>> And also, anything special required for "server" family application code 
>> porting here ?? as because in server family the trace exception used to
>> viz 
>> NORMAL exception proglog and uses SRR0 and SRR1 but in this ISA/embedded 
>> case have dedicated DEBUG_DEBUG prolog and dedicated registers DSRR0 and 
>> DSRR1. 
> 
>> IIRC the branch taken mechanism does have different semantics than the 
>> equivalent mechanism on server.  You can find discussion of this in the 
>> archives. :-) 
/
> 
> Most of the discussions so far I have surfed are related to branch
> taken/fall through(not taken) semantics related. But, in general, if I
> have an application running on server where tracing was based on BE bit
> and same can run on e500mc with DE & BRT combination?
> 
> 
> Thanks In Advance.

Could someone help on this regard?




--
View this message in context: http://linuxppc.10917.n7.nabble.com/questions-on-CONFIG-PPC-ADV-DEBUG-REGS-DBCR0-BRT-and-DBCR0-ACTIVE-EVENTS-tp70147p82686.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.

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

* Re: questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS
  2014-05-26 22:20             ` shiva7
@ 2014-05-29 21:08               ` Scott Wood
  0 siblings, 0 replies; 10+ messages in thread
From: Scott Wood @ 2014-05-29 21:08 UTC (permalink / raw)
  To: shiva7; +Cc: linuxppc-dev

On Mon, 2014-05-26 at 15:20 -0700, shiva7 wrote:
> shiva7 wrote
> > Thanks again Scott.
> /
> >> Any idea whether the DBCR0 BRT bit actually works(??), 
> > 
> >> Do you have reason to believe that it might not? 
> /
> > 
> > I'm facing a strange problem which was not there on server processor. Let
> > me try to give brief flow.
> > 
> > Server :
> > 
> > Set BE bit (thru system call or sigreturn) for specific thread -> for
> > every branch -> trace exception -> Normal exception prolog
> > (STD_EXCEPTION_COMMON) SRR0 and SRR1
> > 
> > Embedded/BOOKE:
> > 
> > Set DE & BRT bit (thru system call or sigreturn) for specific thread ->
> > for every branch taken -> Debug exception -> DEBUG_DEBUG prolog ->
> > return_dbg_except DSRR0 & DSRR1
> > 
> > In server case, able to capture the branches as expected, but wherein
> > BOOKE though branch taken exception are generated, at the certain stage
> > (mostly after turn on BRT & DE bit)  user process is deviated (not taking
> > the same flow as like server) and leading to different
> > corruption/unexpected behavior.
> /
> >> And also, anything special required for "server" family application code 
> >> porting here ?? as because in server family the trace exception used to
> >> viz 
> >> NORMAL exception proglog and uses SRR0 and SRR1 but in this ISA/embedded 
> >> case have dedicated DEBUG_DEBUG prolog and dedicated registers DSRR0 and 
> >> DSRR1. 
> > 
> >> IIRC the branch taken mechanism does have different semantics than the 
> >> equivalent mechanism on server.  You can find discussion of this in the 
> >> archives. :-) 
> /
> > 
> > Most of the discussions so far I have surfed are related to branch
> > taken/fall through(not taken) semantics related. But, in general, if I
> > have an application running on server where tracing was based on BE bit
> > and same can run on e500mc with DE & BRT combination?
> > 
> > 
> > Thanks In Advance.
> 
> Could someone help on this regard?

I think you'll need to debug it, and send a patch if you find a bug.  As
for "in general" that depends on whether your application cares about
the difference in semantics that was noted.

-Scott

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

end of thread, other threads:[~2014-05-29 21:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-11 23:21 questions on CONFIG_PPC_ADV_DEBUG_REGS, DBCR0_BRT, and DBCR0_ACTIVE_EVENTS Chris Friesen
2014-04-22 12:43 ` shiva7
2014-04-22 22:31   ` Scott Wood
2014-04-22 22:37     ` Scott Wood
2014-05-18 23:38       ` shiva7
2014-05-19 17:47         ` Scott Wood
2014-05-20 13:06           ` shiva7
2014-05-26 22:20             ` shiva7
2014-05-29 21:08               ` Scott Wood
2014-05-20  8:09 ` Deepak Pandian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).