From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [kvm-userspace] new functions on_vcpu() causing segafault when trying to use breakpoints Date: Fri, 30 May 2008 22:23:12 +0200 Message-ID: <48406230.5040300@web.de> References: <1212175668.24409.9.camel@thinkpadL> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC1A33F401175D2F7F9A8A6A0" Cc: kvm To: jyoung5@us.ibm.com Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:33862 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753052AbYE3UXY (ORCPT ); Fri, 30 May 2008 16:23:24 -0400 In-Reply-To: <1212175668.24409.9.camel@thinkpadL> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC1A33F401175D2F7F9A8A6A0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Jerone Young wrote: > New code recently added to the repository has made some modifications t= o > the kvm_update_debugger() function in qemu-kvm.c. Where as no longer t= o > just call kvm_guest_debug...Now there is a new fuction on_vcpu() that > places things in work queues and launches them. >=20 > 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/qemu/qemu-kvm.c +++ b/qemu/qemu-kvm.c @@ -268,7 +268,7 @@ static void kvm_main_loop_wait(CPUState=20 exit(1); } =20 - + cpu_single_env =3D env; flush_queued_work(env); =20 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. >=20 > What exactly is the point of complicating this?=20 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. >=20 > 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. :-> Jan [1] http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/17968 --------------enigC1A33F401175D2F7F9A8A6A0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFIQGI1niDOoMHTA+kRAjo2AJ46qmSOHaJ1L7AEilJXOmUwqGV6lQCeJeon U+y9opNecf6jEDeK0rDlbOA= =WIZD -----END PGP SIGNATURE----- --------------enigC1A33F401175D2F7F9A8A6A0--