From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: [PATCH] [RFC] Fix for kvm qemu to return control to gdb stub on breakpoints Date: Thu, 22 May 2008 11:21:48 -0500 Message-ID: <5efefbab7b0f97c983a1.1211473308@thinkpadL> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:35691 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753389AbYEVQV7 (ORCPT ); Thu, 22 May 2008 12:21:59 -0400 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e2.ny.us.ibm.com (8.13.8/8.13.8) with ESMTP id m4MGLvvc022541 for ; Thu, 22 May 2008 12:21:57 -0400 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4MGLtaQ1486914 for ; Thu, 22 May 2008 12:21:56 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4MGLtqk002853 for ; Thu, 22 May 2008 10:21:55 -0600 Received: from [127.0.1.1] (thinkpadL.austin.ibm.com [9.53.41.205]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m4MGLtk4002834 for ; Thu, 22 May 2008 10:21:55 -0600 Sender: kvm-owner@vger.kernel.org List-ID: 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); env->interrupt_request &= ~CPU_INTERRUPT_EXIT; kvm_main_loop_wait(env, 0); if (info->reload_regs) {