From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Date: Mon, 09 Jun 2008 14:57:26 +0000 Subject: Re: [PATCH 2 of 2] Add gdb break point support to PowerPC kvm Message-Id: <1213023446.3358.5.camel@localhost.localdomain> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: kvm-ppc@vger.kernel.org On Fri, 2008-06-06 at 15:23 -0500, Jerone Young wrote: >=20 > > > > > + case BOOKE_INTERRUPT_DEBUG: { > > > > > + u32 dbsr; > > > > > + struct kvm_guest_debug *dbg > &vcpu->guest_debug; > > > > > + > > > > > + vcpu->arch.pc =3D mfspr(SPRN_CSRR0); > > > > > + > > > > > + /* clear events in DBSR register */ > > > > > + dbsr =3D mfspr(SPRN_DBSR); > > > > > + > > > > > + if (vcpu->arch.pc =3D dbg->bp[0]) > > > > > + dbsr |=3D 1<<23; /* clear IAC1 event */ > > > > > + if (vcpu->arch.pc =3D dbg->bp[1]) > > > > > + dbsr |=3D 1<<22; /* clear IAC2 event */ > > > > > + if (vcpu->arch.pc =3D dbg->bp[2]) > > > > > + dbsr |=3D 1<<21; /* clear IAC3 event */ > > > > > + if (vcpu->arch.pc =3D dbg->bp[3]) > > > > > + dbsr |=3D 1<<20; /* clear IAC4 event */ > > > >=20 > > > > This doesn't seem like the right thing to do here. What if the > > > > breakpoint isn't due to any of the IACs? > > >=20 > > > If it is an IAC register that triggered the event then you have to > clear > > > it. The exact event in the DBSR. > >=20 > > That's my point: why are you using dbg->bp[] instead of DBSR bits? > If > > anything, I would expect an error message if unexpected DBSR bits > were > > set, and in any case: > > dbsr =3D mfspr(=EF=BB=BFSPRN_DBSR); > > mtspr(SPRN_DBSR, dbsr); >=20 > Oh the issue is if 2 debug interrupts got off from two different > registers. At least that was my train of the thought. Though the fact > if > that does happen that would mean they both had the exact same > breakpoint. So we would only wat to process one of them.=20 That may be your train of thought, but it's not mine. Please reread my comments and let me know if you still have questions. --=20 Hollis Blanchard IBM Linux Technology Center