From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPFLD-0007Y7-Iw for qemu-devel@nongnu.org; Thu, 26 Sep 2013 13:27:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPFL6-0001O6-8C for qemu-devel@nongnu.org; Thu, 26 Sep 2013 13:27:03 -0400 Received: from mout.web.de ([212.227.15.4]:57878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPFL5-0001Nl-F1 for qemu-devel@nongnu.org; Thu, 26 Sep 2013 13:26:56 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LaCqs-1W8yxP0eXG-00lzBm for ; Thu, 26 Sep 2013 19:26:53 +0200 Message-ID: <52446E5C.6040707@web.de> Date: Thu, 26 Sep 2013 19:26:52 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <5243CF52.6020400@web.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VaPW1Pq2jJbpUowS56TixgjIbuWv8nc8r" Subject: Re: [Qemu-devel] Fwd: Guest VM debug (Int 3 panic) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Yaohui Cc: qemu-devel@nongnu.org, kvm This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VaPW1Pq2jJbpUowS56TixgjIbuWv8nc8r Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-09-26 16:14, Hu Yaohui wrote: > Hi Jan, > Thanks for your reply. > On Thu, Sep 26, 2013 at 2:08 AM, Jan Kiszka wrote: >=20 >> On 2013-09-25 20:08, Hu Yaohui wrote: >>> Hi All, >>> I am trying to debug guest OS through qemu with kvm enabled. >>> Following is what I have done: >>> 1: fire the qemu-kvm >>> >>> sudo qemu-system-x86_64 -hda vdisk.img -m 4096 -smp 2 -vnc :2 -boot c= -s >>> >>> >>> 2: wait until login into guest OS (ubuntu 10.04) >>> >>> 3: fire gdb >>> >>> gdb vmlinux >>> target remote :1234 >>> b do_fork >>> set arch i386:x86-64 >> >> "set arch" is unneeded. vmlinux already tells gdb that you are debuggi= ng >> x86-64. >> >>> c >>> >>> >>> 4: after I typed "ls" in guest OS. The guest OS paniced with some mes= sage >>> related to "int 3 blah blah". Then crashed. >>> >>> Someone said we should use hardware breakpoint when kvm is enabled, o= r >> >> You can use hardware breakpoints as well but it is not required unless= >> the target code can be overwritten (e.g. due to a reset). >> >>> "monitor system_reset" after set the breakpoint, but it didn't work f= or >> me. >>> The hardware breakpoint could not been hit anyway. >>> >>> I have tried with "-no-kvm", it works normally with breakpoints. But = I >> want >>> to debug the guest OS with kvm enabled. I don't know whether someone = has >>> met this similar situation. >> >> You didn't tell us which version of QEMU (or is it old qemu-kvm?) you >> are using, what host kernel and which CPU type (AMD vs. Intel). Did yo= u >> try a recent version of all of them already? I'm currently not aware o= f >> gdb problems with QEMU/KVM, I'm rather using it on an almost daily bas= is >> (typically git head versions). >> > I am using a nested VM. Oh, "minor" detail ;) - why nested? But this used to work for me with a patched 3.9+ kernel some while ago. > My CPU type is intel. > On L0, the QEMU-KVM version is 1.0, host kernel version: 2.6.32.10, > kvm-kmod version: 3.2 Try at least the latest kvm-kmod version, but there are even more fixes in kvm.git. Not sure if any of them has direct impact on your scenario, but it's generally better to use a recent kernel with this still experimental feature (VMX nesting). As this is likely a KVM issue, I'm also CC'ing the corresponding list Jan > On L1, the QEMU-KVM version is 1.2, kernel version: 3.2.2, kvm-kmod > version: 3.2 > On L2, guest kernel version: 2.6.32.10 > I am trying to debug L2 guest kernel on L1 QEMU. It gives me "INT 3" > related kernel oops. > I also have tried to debug the L1 guest kernel through L0 QEMU which wo= rks > fine. >=20 >> >> If you want to debug your issue: there is ftrace to record what KVM >> events happen, and you can switch gdb into verbose mode as well, >> comparing the communication between KVM on/off: set debug remote 1. >> >> Thanks for your suggestion! I will give that a try. >=20 >> Jan >> >> >> >=20 --VaPW1Pq2jJbpUowS56TixgjIbuWv8nc8r 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.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJEblwACgkQitSsb3rl5xReswCgiF8LzFaphbdWy01LwmF5Sj4b mV4An3ClZ6mLhPoZzLcmy8++q3Kuvk1G =VXCG -----END PGP SIGNATURE----- --VaPW1Pq2jJbpUowS56TixgjIbuWv8nc8r--