From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [kvm-devel] [RFC][PATCH 3/4] kvm-vmx: KVM_EXIT_DEBUG on #BP exceptions Date: Thu, 22 May 2008 16:24:48 +0200 Message-ID: <48358230.1000407@web.de> References: <482D9198.7040801@web.de> <482DAFFD.8060500@web.de> <4834474B.7030600@qumranet.com> <483575C2.1040303@web.de> <48357BE8.5090104@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC431B798E7A4376EA4AB9F10" Cc: kvm-devel , Hollis Blanchard To: Avi Kivity Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:37613 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbYEVOYy (ORCPT ); Thu, 22 May 2008 10:24:54 -0400 In-Reply-To: <48357BE8.5090104@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC431B798E7A4376EA4AB9F10 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Avi Kivity wrote: > Jan Kiszka wrote: >> Avi Kivity wrote: >> =20 >>> Jan Kiszka wrote: >>> =20 >>>> In order to allow the gdbstub of QEMU to push (soft) breakpoint >>>> handling >>>> completely into the gdb frontend, this patch enables guest exits als= o >>>> for #BP exceptions - in case guest debugging was turned on. >>>> >>>> Along this enhancement, this patch also fixes the flag manipulation = for >>>> the singlestep mode. >>>> =20 >>> Suppose userspace determines the exception is due to a guest >>> breakpoint. How does it inject the debug exception? >>> =20 >> >> Good question. Is there no "inject exception #XX" mechanism in kvm yet= ? >> >> =20 >=20 > No userspace interface for it. The kernel injects plenty > (kvm_queue_exception). >=20 >> Will need this, as my current impression is that we better keep track = of >> breakpoints at qemu level to tell guest soft-BPs apart from host >> injected ones. Would you suggest to add a separate IOCTL for exception= >> injection then? Or should the new guest debug IOCTL contain a flag tha= t >> signals "inject breakpoint trap" (both for guest soft-BP hits as well = as >> guests already in single step mode)? >=20 > A debug specific thing may allow us to limit the generality of the > implementation. >=20 > Or maybe, disable int 3 trapping, single step, reenable int 3 trapping > -> no need to inject vectors. /me is still trying to find explicit statements in the Intel docs about what happens to the TF flag when the CPU enters an interrupt or an exception handler. This influences how single stepping guests can be realized, specifically when trying to step into guest's int3 handling... Jan --------------enigC431B798E7A4376EA4AB9F10 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 iD8DBQFINYI0niDOoMHTA+kRAtFzAJ4oy7TlGPfj1kDPDS+3l0x6sRXcRgCdEeOq +Zp/SCqqSX5KCwSJLAKK6Pg= =pSa1 -----END PGP SIGNATURE----- --------------enigC431B798E7A4376EA4AB9F10--