From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [kvm-devel] [RFC][PATCH 3/4] kvm-vmx: KVM_EXIT_DEBUG on #BP exceptions Date: Thu, 22 May 2008 16:58:00 +0300 Message-ID: <48357BE8.5090104@qumranet.com> References: <482D9198.7040801@web.de> <482DAFFD.8060500@web.de> <4834474B.7030600@qumranet.com> <483575C2.1040303@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-devel , Hollis Blanchard To: Jan Kiszka Return-path: Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194]:46566 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421AbYEVN6E (ORCPT ); Thu, 22 May 2008 09:58:04 -0400 In-Reply-To: <483575C2.1040303@web.de> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > Avi Kivity wrote: > >> Jan Kiszka wrote: >> >>> In order to allow the gdbstub of QEMU to push (soft) breakpoint handling >>> completely into the gdb frontend, this patch enables guest exits also >>> for #BP exceptions - in case guest debugging was turned on. >>> >>> Along this enhancement, this patch also fixes the flag manipulation for >>> the singlestep mode. >>> >>> >> Suppose userspace determines the exception is due to a guest >> breakpoint. How does it inject the debug exception? >> > > Good question. Is there no "inject exception #XX" mechanism in kvm yet? > > No userspace interface for it. The kernel injects plenty (kvm_queue_exception). > 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 that > signals "inject breakpoint trap" (both for guest soft-BP hits as well as > guests already in single step mode)? A debug specific thing may allow us to limit the generality of the implementation. Or maybe, disable int 3 trapping, single step, reenable int 3 trapping -> no need to inject vectors. -- error compiling committee.c: too many arguments to function