From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lh5Ax-00058U-Vb for qemu-devel@nongnu.org; Tue, 10 Mar 2009 12:51:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lh5Ax-000588-2M for qemu-devel@nongnu.org; Tue, 10 Mar 2009 12:51:31 -0400 Received: from [199.232.76.173] (port=50433 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lh5Aw-000585-Pw for qemu-devel@nongnu.org; Tue, 10 Mar 2009 12:51:30 -0400 Received: from lizzard.sbs.de ([194.138.37.39]:17651) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lh5Aw-0001Ah-2Z for qemu-devel@nongnu.org; Tue, 10 Mar 2009 12:51:30 -0400 Received: from mail1.sbs.de (localhost [127.0.0.1]) by lizzard.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n2AGpOdt022085 for ; Tue, 10 Mar 2009 17:51:24 +0100 Received: from [139.25.109.167] (mchn012c.mchp.siemens.de [139.25.109.167] (may be forged)) by mail1.sbs.de (8.12.11.20060308/8.12.11) with ESMTP id n2AGpOHa019779 for ; Tue, 10 Mar 2009 17:51:24 +0100 Message-ID: <49B69A8C.7050403@siemens.com> Date: Tue, 10 Mar 2009 17:51:24 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <49B433EE.4080704@web.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH v3 1/2] Guest debugging support for KVM Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Blue Swirl wrote: > On 3/8/09, Jan Kiszka wrote: >> This is a backport of the guest debugging support for the KVM >> accelerator that is now part of the KVM tree. It implements the reworked >> KVM kernel API for guest debugging (KVM_CAP_SET_GUEST_DEBUG) which is >> not yet part of any mainline kernel but will probably be 2.6.30 stuff. >> So far supported is x86, but PPC is expected to catch up soon. >> >> Core features are: >> - unlimited soft-breakpoints via code patching >> - hardware-assisted x86 breakpoints and watchpoints > > The statically dimensioned arrays (hw_breakpoint[4], single > hw_watchpoint) make me wonder what would happen in the SMP case. Or is > only one CPU ever targeted at a time for debugging? > We have 4 hardware watch- or breakpoint on x86. KVM is able to set them per VCPU, that's why all relevant functions take a CPUState as argument. So that API is highly flexible. But, and that's the "famous" :) topic discussed here before /wrt plain qemu: gdb has no multicore or SMP model yet so that per-CPU breakpoints could be assigned and properly managed. Therefore qemu applies break- and watchpoints to all virtual CPUs, and with this patch also in kvm mode. That covers most of today's use cases, and with some care you can even apply it to systems which run different memory mappings and different code on their CPUs. [ Reminds me that I should repost my vCont patch... ] Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux