From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Subject: Re: [kvm-userspace] new functions on_vcpu() causing segafault when trying to use breakpoints Date: Fri, 30 May 2008 15:55:33 -0500 Message-ID: <1212180933.17626.4.camel@thinkpadL> References: <1212175668.24409.9.camel@thinkpadL> <48406230.5040300@web.de> Reply-To: jyoung5@us.ibm.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm To: Jan Kiszka Return-path: Received: from e33.co.us.ibm.com ([32.97.110.151]:58524 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752718AbYE3Uze (ORCPT ); Fri, 30 May 2008 16:55:34 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m4UKtXEk001794 for ; Fri, 30 May 2008 16:55:33 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4UKtXdc093698 for ; Fri, 30 May 2008 14:55:33 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4UKtWfR031574 for ; Fri, 30 May 2008 14:55:32 -0600 In-Reply-To: <48406230.5040300@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2008-05-30 at 22:23 +0200, Jan Kiszka wrote: > Jerone Young wrote: > > New code recently added to the repository has made some modifications to > > the kvm_update_debugger() function in qemu-kvm.c. Where as no longer to > > just call kvm_guest_debug...Now there is a new fuction on_vcpu() that > > places things in work queues and launches them. > > > > The problem is when kvm_invold_guest_debug() gets called, it segfaults > > calling kvm_guest_debug(). > > I bet this piece from [1] will solve it: > > Index: b/qemu/qemu-kvm.c > =================================================================== > --- a/qemu/qemu-kvm.c > +++ b/qemu/qemu-kvm.c > @@ -268,7 +268,7 @@ static void kvm_main_loop_wait(CPUState > exit(1); > } > > - > + cpu_single_env = env; > flush_queued_work(env); > > if (vcpu_info[env->cpu_index].stop) { > > > I didn't bother posting it separately as I (obviously wrongly) assumed > this wouldn't trigger for the existing code. Yeap that was it. Works fine now. Your going to want to send this patch out. > > > > > What exactly is the point of complicating this? > > The old code quickly live-locked when you invoked kvm_guest_debug while > the target vcpu was still running. I suggested to stop the vcpu when > invoking this (and other problematic) services, Avi preferred the > on_vcpu aproach. And that, indeed, turned out to be cleaner and easier > reusable. ah I see. > > > > > This code does segfault on x86 also. For now I have just placed the old > > code back locally. > > I would be happy if you could give my patches a spin as well. I was > using them for kernel debugging during this week, but I guess I'm still > alone. :-> I would help, but I'm having a fun time debugging this week myself ;-) I'll let you if/when I can help out though. > > Jan > > [1] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/17968 >