From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZygzG-00065h-E3 for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:11:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZygzC-0005dZ-AY for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:11:58 -0500 Received: from smtp.ispras.ru ([83.149.199.79]:50964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZygzC-0005d6-3Q for qemu-devel@nongnu.org; Tue, 17 Nov 2015 09:11:54 -0500 References: <5638B3E4.8020906@ispras.ru> From: Sergey Smolov Message-ID: <564B27CB.7010302@ispras.ru> Date: Tue, 17 Nov 2015 17:12:43 +0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] log every write to register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , Peter Maydell , Richard Henderson Cc: QEMU Developers 03.11.2015 20:29, Peter Crosthwaite =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On Tue, Nov 3, 2015 at 8:14 AM, Peter Maydell wrote: >> On 3 November 2015 at 13:17, Sergey Smolov wrote: >>> I have a collection of ARMv8 register names. I need to add special lo= gging >>> mode to QEMU so that every time it is enabled, every write access to = any of >>> the specified registers will produce a new record to log, including r= egister >>> name and a value to be written. >>> >>> Is it possible to accomplish such a task? If yes, where shall I find >>> functions that implement "writing to register" functionality? >> This is difficult, because we don't have a single convenient >> location which all register accesses go through. (General purpose >> registers and some system registers will be optimised so that >> accesses are made directly from JIT generated code.) >> > You may be able to hack the TCG generation functions to call out to > helper context (which implements your log) on each op that updates > your specific regs. It will kill performance though if those registers > are hot. Thank you for your answer! Could you explain the idea in a more detailed way? Which TCG generation functions should i hack for write-to-specific-regs=20 logging? Thanks in advance, Sergey Smolov