* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
@ 2008-06-09 20:51 ` Hollis Blanchard
2008-06-09 21:08 ` Jerone Young
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-06-09 20:51 UTC (permalink / raw)
To: kvm-ppc
On Mon, 2008-06-09 at 13:19 -0500, Jerone Young wrote:
> 4 files changed, 128 insertions(+), 2 deletions(-)
> arch/powerpc/kvm/booke_guest.c | 16 +++++
> arch/powerpc/kvm/booke_interrupts.S | 3
> arch/powerpc/kvm/powerpc.c | 106 ++++++++++++++++++++++++++++++++++-
> include/asm-powerpc/kvm_host.h | 5 +
>
>
> * Boiled down conditional for dbsr to one line, when handling debug interrupts.
> Renamed load_guest_debug_registers() to guest_load_debug_registers()
>
> This patch adds the ability to use breakpoints from a gdb stub in userpace (currently qemu). It does this through the use of hardware debug registers.
>
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
You still have not renamed restore_host_debug_state() and
guest_load_debug_registers(), which you agreed to previously.
You still have not renamed guest_debug(), which you also agreed to
previously. I don't see why you have a separate function for this
anyways.
You also have not addressed the case I pointed out where an IAC matches
after you've programmed it but before you've entered the guest.
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
2008-06-09 20:51 ` Hollis Blanchard
@ 2008-06-09 21:08 ` Jerone Young
2008-06-09 22:56 ` Hollis Blanchard
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jerone Young @ 2008-06-09 21:08 UTC (permalink / raw)
To: kvm-ppc
On Mon, 2008-06-09 at 15:51 -0500, Hollis Blanchard wrote:
> On Mon, 2008-06-09 at 13:19 -0500, Jerone Young wrote:
> > 4 files changed, 128 insertions(+), 2 deletions(-)
> > arch/powerpc/kvm/booke_guest.c | 16 +++++
> > arch/powerpc/kvm/booke_interrupts.S | 3
> > arch/powerpc/kvm/powerpc.c | 106 ++++++++++++++++++++++++++++++++++-
> > include/asm-powerpc/kvm_host.h | 5 +
> >
> >
> > * Boiled down conditional for dbsr to one line, when handling debug interrupts.
> > Renamed load_guest_debug_registers() to guest_load_debug_registers()
> >
> > This patch adds the ability to use breakpoints from a gdb stub in userpace (currently qemu). It does this through the use of hardware debug registers.
> >
> > Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
>
> You still have not renamed restore_host_debug_state() and
> guest_load_debug_registers(), which you agreed to previously.
My bad. I was mainly just addressing the issues we went over this
morning. I'll fix the names.
>
> You still have not renamed guest_debug(), which you also agreed to
> previously. I don't see why you have a separate function for this
> anyways.
>
> You also have not addressed the case I pointed out where an IAC matches
> after you've programmed it but before you've entered the guest.
Basically can disable them in the dbcr0 before we do any switching out
of registers.
If an IAC is matched before we enter the guest it will be caught host
that catches it.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
2008-06-09 20:51 ` Hollis Blanchard
2008-06-09 21:08 ` Jerone Young
@ 2008-06-09 22:56 ` Hollis Blanchard
2008-06-09 23:56 ` Jerone Young
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-06-09 22:56 UTC (permalink / raw)
To: kvm-ppc
On Mon, 2008-06-09 at 16:08 -0500, Jerone Young wrote:
>
> > You also have not addressed the case I pointed out where an IAC
> matches
> > after you've programmed it but before you've entered the guest.
>
> Basically can disable them in the dbcr0 before we do any switching out
> of registers.
We'll have to enable DBCR0 some time, right?
> If an IAC is matched before we enter the guest it will be caught host
> that catches it.
But that won't happen because you've disabled MSR[DE].
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (2 preceding siblings ...)
2008-06-09 22:56 ` Hollis Blanchard
@ 2008-06-09 23:56 ` Jerone Young
2008-06-10 15:12 ` Hollis Blanchard
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jerone Young @ 2008-06-09 23:56 UTC (permalink / raw)
To: kvm-ppc
On Mon, 2008-06-09 at 17:56 -0500, Hollis Blanchard wrote:
> On Mon, 2008-06-09 at 16:08 -0500, Jerone Young wrote:
> >
> > > You also have not addressed the case I pointed out where an IAC
> > matches
> > > after you've programmed it but before you've entered the guest.
> >
> > Basically can disable them in the dbcr0 before we do any switching out
> > of registers.
>
> We'll have to enable DBCR0 some time, right?
>
Yes it gets enabled when when the guest cuts on the bits it wants & the
we restre the host DBCR0.
> > If an IAC is matched before we enter the guest it will be caught host
> > that catches it.
>
> But that won't happen because you've disabled MSR[DE].
Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
=0 and an IAC will go off but not at the exact address. This was fun
figuring out.
I also have a bug in this patch. I placed the wrong definitions when
disabling the debug interrupts. I'll respin again. Look things over more
carefully this time.
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (3 preceding siblings ...)
2008-06-09 23:56 ` Jerone Young
@ 2008-06-10 15:12 ` Hollis Blanchard
2008-06-10 15:33 ` Jerone Young
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-06-10 15:12 UTC (permalink / raw)
To: kvm-ppc
On Mon, 2008-06-09 at 18:56 -0500, Jerone Young wrote:
> On Mon, 2008-06-09 at 17:56 -0500, Hollis Blanchard wrote:
> > On Mon, 2008-06-09 at 16:08 -0500, Jerone Young wrote:
> > >
> > > > You also have not addressed the case I pointed out where an IAC
> > > matches
> > > > after you've programmed it but before you've entered the guest.
> > >
> > > Basically can disable them in the dbcr0 before we do any switching out
> > > of registers.
> >
> > We'll have to enable DBCR0 some time, right?
> >
> Yes it gets enabled when when the guest cuts on the bits it wants & the
> we restre the host DBCR0.
>
>
> > > If an IAC is matched before we enter the guest it will be caught host
> > > that catches it.
> >
> > But that won't happen because you've disabled MSR[DE].
>
> Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
> =0 and an IAC will go off but not at the exact address. This was fun
> figuring out.
Right. Now, when will the deferred debug event fire, and who will handle
it? What can we do about that?
> I also have a bug in this patch. I placed the wrong definitions when
> disabling the debug interrupts. I'll respin again. Look things over more
> carefully this time.
I think you're respinning these patches too frequently, before
conversation has concluded.
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (4 preceding siblings ...)
2008-06-10 15:12 ` Hollis Blanchard
@ 2008-06-10 15:33 ` Jerone Young
2008-06-10 15:45 ` Hollis Blanchard
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jerone Young @ 2008-06-10 15:33 UTC (permalink / raw)
To: kvm-ppc
On Tue, 2008-06-10 at 10:12 -0500, Hollis Blanchard wrote:
> On Mon, 2008-06-09 at 18:56 -0500, Jerone Young wrote:
> > On Mon, 2008-06-09 at 17:56 -0500, Hollis Blanchard wrote:
> > > On Mon, 2008-06-09 at 16:08 -0500, Jerone Young wrote:
> > > >
> > > > > You also have not addressed the case I pointed out where an IAC
> > > > matches
> > > > > after you've programmed it but before you've entered the guest.
> > > >
> > > > Basically can disable them in the dbcr0 before we do any switching out
> > > > of registers.
> > >
> > > We'll have to enable DBCR0 some time, right?
> > >
> > Yes it gets enabled when when the guest cuts on the bits it wants & the
> > we restre the host DBCR0.
> >
> >
> > > > If an IAC is matched before we enter the guest it will be caught host
> > > > that catches it.
> > >
> > > But that won't happen because you've disabled MSR[DE].
> >
> > Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
> > =0 and an IAC will go off but not at the exact address. This was fun
> > figuring out.
>
> Right. Now, when will the deferred debug event fire, and who will handle
> it? What can we do about that?
If the debug registers are turned off before we disable MSR[DE], there
will be no debug events at all.
This is what I was talking about in my first couple of emails. If a
debug event does go off and the host does not handle it, the only way to
know is the dbsr register (and there is no way to save that off). So in
the end it could end up going off in the guest.
This is why I said you should not do host debugging if you want to do
guest debugging at the sametime, as a work around for now.
Really can be addressed in a patch on top of this patch. Though I really
don't want to linger on this problem as it is not critical at the moment
as nobody is using these registers in the host currently.
I can clear the dbsr registers also when disabling the debug interrupts
as a solution?
>
> > I also have a bug in this patch. I placed the wrong definitions when
> > disabling the debug interrupts. I'll respin again. Look things over more
> > carefully this time.
>
> I think you're respinning these patches too frequently, before
> conversation has concluded.
I think respining has helped in the conversation to be honest. As I can
better demonstrate what I am thinking (though better without mistakes).
Also I figured this was concluded. I will not spin anymore patches till
we can agree on an answer for everything.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (5 preceding siblings ...)
2008-06-10 15:33 ` Jerone Young
@ 2008-06-10 15:45 ` Hollis Blanchard
2008-06-10 15:54 ` Jerone Young
2008-06-10 16:27 ` Jerone Young
8 siblings, 0 replies; 10+ messages in thread
From: Hollis Blanchard @ 2008-06-10 15:45 UTC (permalink / raw)
To: kvm-ppc
On Tue, 2008-06-10 at 10:33 -0500, Jerone Young wrote:
> On Tue, 2008-06-10 at 10:12 -0500, Hollis Blanchard wrote:
> > On Mon, 2008-06-09 at 18:56 -0500, Jerone Young wrote:
> > > > > If an IAC is matched before we enter the guest it will be caught host
> > > > > that catches it.
> > > >
> > > > But that won't happen because you've disabled MSR[DE].
> > >
> > > Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
> > > =0 and an IAC will go off but not at the exact address. This was fun
> > > figuring out.
> >
> > Right. Now, when will the deferred debug event fire, and who will handle
> > it? What can we do about that?
>
> If the debug registers are turned off before we disable MSR[DE], there
> will be no debug events at all.
>
> This is what I was talking about in my first couple of emails. If a
> debug event does go off and the host does not handle it, the only way to
> know is the dbsr register (and there is no way to save that off). So in
> the end it could end up going off in the guest.
>
> This is why I said you should not do host debugging if you want to do
> guest debugging at the sametime, as a work around for now.
As I said before, forget host debugging!
In fact, here is the exact text I sent to you on Friday, which you don't
appear to have read, in which I said exactly the same thing:
On Fri, 2008-06-06 at 14:27 -0500, Hollis Blanchard wrote:
> On Fri, 2008-06-06 at 14:11 -0500, Jerone Young wrote:
> > That is an issue if you are using the IAC registers in the host
> also > at the same time.
>
> That is a totally separate issue. Imagine this in the host:
>
> 0xc0001000 load_guest_debug_registers:
> MSR[DE] = 0
> IAC[0] = 0xc0001080
> ...
> 0xc0001080
> ...
> enter guest
>
> IAC1 matched. Now what happens?
Please think about this scenario.
> I can clear the dbsr registers also when disabling the debug interrupts
> as a solution?
I think you're on the right track, but what you propose here simply
won't affect the above scenario.
--
Hollis Blanchard
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (6 preceding siblings ...)
2008-06-10 15:45 ` Hollis Blanchard
@ 2008-06-10 15:54 ` Jerone Young
2008-06-10 16:27 ` Jerone Young
8 siblings, 0 replies; 10+ messages in thread
From: Jerone Young @ 2008-06-10 15:54 UTC (permalink / raw)
To: kvm-ppc
On Tue, 2008-06-10 at 10:45 -0500, Hollis Blanchard wrote:
> On Tue, 2008-06-10 at 10:33 -0500, Jerone Young wrote:
> > On Tue, 2008-06-10 at 10:12 -0500, Hollis Blanchard wrote:
> > > On Mon, 2008-06-09 at 18:56 -0500, Jerone Young wrote:
> > > > > > If an IAC is matched before we enter the guest it will be caught host
> > > > > > that catches it.
> > > > >
> > > > > But that won't happen because you've disabled MSR[DE].
> > > >
> > > > Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
> > > > =0 and an IAC will go off but not at the exact address. This was fun
> > > > figuring out.
> > >
> > > Right. Now, when will the deferred debug event fire, and who will handle
> > > it? What can we do about that?
> >
> > If the debug registers are turned off before we disable MSR[DE], there
> > will be no debug events at all.
> >
> > This is what I was talking about in my first couple of emails. If a
> > debug event does go off and the host does not handle it, the only way to
> > know is the dbsr register (and there is no way to save that off). So in
> > the end it could end up going off in the guest.
> >
> > This is why I said you should not do host debugging if you want to do
> > guest debugging at the sametime, as a work around for now.
>
> As I said before, forget host debugging!
If it's not about host debugging then I'm confused where you are going
with this. Please be more clear.
>
> In fact, here is the exact text I sent to you on Friday, which you don't
> appear to have read, in which I said exactly the same thing:
>
> On Fri, 2008-06-06 at 14:27 -0500, Hollis Blanchard wrote:
> > On Fri, 2008-06-06 at 14:11 -0500, Jerone Young wrote:
> > > That is an issue if you are using the IAC registers in the host
> > also > at the same time.
> >
> > That is a totally separate issue. Imagine this in the host:
> >
> > 0xc0001000 load_guest_debug_registers:
> > MSR[DE] = 0
> > IAC[0] = 0xc0001080
> > ...
> > 0xc0001080
> > ...
> > enter guest
> >
> > IAC1 matched. Now what happens?
>
> Please think about this scenario.
Again I'm lost on where you are going here. We are in the guest it
matches. I'm not sure what you are trying to say here?
>
> > I can clear the dbsr registers also when disabling the debug interrupts
> > as a solution?
>
> I think you're on the right track, but what you propose here simply
> won't affect the above scenario.
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH] [v5] Add gdb break point support to PowerPC kvm
2008-06-09 18:19 [PATCH] [v5] Add gdb break point support to PowerPC kvm Jerone Young
` (7 preceding siblings ...)
2008-06-10 15:54 ` Jerone Young
@ 2008-06-10 16:27 ` Jerone Young
8 siblings, 0 replies; 10+ messages in thread
From: Jerone Young @ 2008-06-10 16:27 UTC (permalink / raw)
To: kvm-ppc
On Tue, 2008-06-10 at 10:45 -0500, Hollis Blanchard wrote:
> On Tue, 2008-06-10 at 10:33 -0500, Jerone Young wrote:
> > On Tue, 2008-06-10 at 10:12 -0500, Hollis Blanchard wrote:
> > > On Mon, 2008-06-09 at 18:56 -0500, Jerone Young wrote:
> > > > > > If an IAC is matched before we enter the guest it will be caught host
> > > > > > that catches it.
> > > > >
> > > > > But that won't happen because you've disabled MSR[DE].
> > > >
> > > > Ah... you don't rember the whole imprecise interrupts ;-) . When MSR[DE]
> > > > =0 and an IAC will go off but not at the exact address. This was fun
> > > > figuring out.
> > >
> > > Right. Now, when will the deferred debug event fire, and who will handle
> > > it? What can we do about that?
> >
> > If the debug registers are turned off before we disable MSR[DE], there
> > will be no debug events at all.
> >
> > This is what I was talking about in my first couple of emails. If a
> > debug event does go off and the host does not handle it, the only way to
> > know is the dbsr register (and there is no way to save that off). So in
> > the end it could end up going off in the guest.
> >
> > This is why I said you should not do host debugging if you want to do
> > guest debugging at the sametime, as a work around for now.
>
> As I said before, forget host debugging!
>
> In fact, here is the exact text I sent to you on Friday, which you don't
> appear to have read, in which I said exactly the same thing:
>
> On Fri, 2008-06-06 at 14:27 -0500, Hollis Blanchard wrote:
> > On Fri, 2008-06-06 at 14:11 -0500, Jerone Young wrote:
> > > That is an issue if you are using the IAC registers in the host
> > also > at the same time.
> >
> > That is a totally separate issue. Imagine this in the host:
> >
> > 0xc0001000 load_guest_debug_registers:
> > MSR[DE] = 0
> > IAC[0] = 0xc0001080
> > ...
> > 0xc0001080
> > ...
> > enter guest
> >
> > IAC1 matched. Now what happens?
>
> Please think about this scenario.
Oh it hit me. So we *could* get an imprecise interrupt once we enable
dbcr0.
So do you want to enable dbcr0 once we enable MSR_DE in
__kvmppc_vcpu_run() ?
(In the future please just plainly state the issue..it saves
emails..which I guess saves trees .. in someway).
>
> > I can clear the dbsr registers also when disabling the debug interrupts
> > as a solution?
>
> I think you're on the right track, but what you propose here simply
> won't affect the above scenario.
>
^ permalink raw reply [flat|nested] 10+ messages in thread