Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J22Tc-0005mR-H3 for qemu-devel@nongnu.org; Tue, 11 Dec 2007 05:36:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J22Tb-0005jN-3D for qemu-devel@nongnu.org; Tue, 11 Dec 2007 05:36:35 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J22Ta-0005iu-NM for qemu-devel@nongnu.org; Tue, 11 Dec 2007 05:36:34 -0500 Received: from web57005.mail.re3.yahoo.com ([66.196.97.109]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1J22Ta-0001EP-Pp for qemu-devel@nongnu.org; Tue, 11 Dec 2007 05:36:34 -0500 Date: Tue, 11 Dec 2007 02:36:33 -0800 (PST) From: "Balazs Attila-Mihaly \(Cd-MaN\)" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <964714.42413.qm@web57005.mail.re3.yahoo.com> Subject: [Qemu-devel] An architectural question 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 Hello all,=0A=0AFirst of all I want to apologize for this mail and hope tha= t I won't wast to much of your valuable time hacking on Qemu ;-). My goal i= s to implement a tracing system in Qemu, which would suspend the emulation = at certain points (determined by linear addresses), dump some information f= rom the memory and resume the execution.=0A=0AMy first attempt was to "hija= ck" the breakpoint system, by doing the following: I've placed a breakpoint= at the address of the instruction I wanted to trace and inside of the main= _loop function when the EXCP_DEBUG exception occurred I performed the loggi= ng after which I called vm_start to resume the operation. However the perfo= rmance was abyssal...=0A=0AMy next idea would be to replace the opcode gene= rated for the debug point with a procedure call (which would, instead of st= opping the emulation, perform the logging and let the emulation go on its w= ay). I've implemented a prototype for this by placing the address of the ca= llback procedure inside of the CPUState structure (given that this structur= e is accessible to the code fragments), however it segfaults.=0A=0AMy quest= ions would be:=0A- What would be the most optimal way to implement this? (S= omething that would allow the OS to run at a usable speed inside of the emu= lated machine...)=0A- What does the kernel level acceleration layer (kqemu)= exactly do? Does it create a separate address space (page directory) for t= he emulated process? Is it possible to perform a callback from the code run= ning under kqemu into a procedure defined in Qemu the way I'm trying to do = it (I see multiple possible obstacles here: is the code run in a separate a= ddress space? is it run with a separate privilege level - ring 0/1 vs ring = 3)? =0A- Do I understand correctly that when using full acceleration (ie. -= kernel-kqemu), the dynamic translation (ie. guest code -> translation block= ) is limited to code segments which cause exceptions? If so, do I infer cor= rectly that, unless the code I wish to trace is of such type, it will never= have the chance to call the logging procedure (because it would be include= d in the translation block)?=0A=0ABest regards and thank you for your time = and patience.=0A=0A=0A=0A=0A _________________________________________= __________________=0ASupport the World Aids Awareness campaign this month w= ith Yahoo! For Good http://uk.promotions.yahoo.com/forgood/