From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: Re: [PATCH] [RFC] Fix for kvm qemu to return control to gdb stub on breakpoints Date: Thu, 22 May 2008 13:10:17 -0500 Message-ID: <1211479817.6964.9.camel@thinkpadL> References: <5efefbab7b0f97c983a1.1211473308@thinkpadL> <4835A29C.2090407@web.de> Reply-To: jyoung5@us.ibm.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Jan Kiszka Return-path: Received: from e5.ny.us.ibm.com ([32.97.182.145]:33436 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbYEVSKV (ORCPT ); Thu, 22 May 2008 14:10:21 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m4MIAKT6024716 for ; Thu, 22 May 2008 14:10:20 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4MIAHXG133314 for ; Thu, 22 May 2008 14:10:17 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4MIAHhR006109 for ; Thu, 22 May 2008 14:10:17 -0400 In-Reply-To: <4835A29C.2090407@web.de> Sender: kvm-owner@vger.kernel.org List-ID: This is mainly to try and fix the current debug state with using hardware breakpoints (until your software breakpoint work is ready for primetime). I actually do need to submit another patch outside of this for initialization of some variables (which I see is in your patch too), as it ends up passing down garbage. For now this is a patch mainly just to get qemu to break into the gdb stub when a debug interrupt comes in. Though I have a feeling more may be needed. On Thu, 2008-05-22 at 18:43 +0200, Jan Kiszka wrote: > Jerone Young wrote: > > 1 file changed, 2 insertions(+) > > qemu/qemu-kvm.c | 2 ++ > > > > > > Currently breakpoints do not fully work for x86 or any other arch with kvm enable qemu. Control is not being returned by to the gdb stub. This patch add back this ability to return control to the gdb stub when a debug interrupt is hit. > > > > This is in the io thread so it's best to get comments on this. Is it in the best place? Should more be done here? > > > > Signed-off-by: Jerone Young > > > > diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c > > --- a/qemu/qemu-kvm.c > > +++ b/qemu/qemu-kvm.c > > @@ -352,6 +352,8 @@ static int kvm_main_loop_cpu(CPUState *e > > update_regs_for_init(env); > > if (!(env->hflags & HF_HALTED_MASK) && !info->init) > > kvm_cpu_exec(env); > > + if (env->exception_index == EXCP_DEBUG) > > + vm_stop(EXCP_DEBUG); > > This isn't enough, please see > > http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/17660 > > and the rest of that series - just RFC, but already usable. > > Jan >