qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Sergey Smolov <smolov@ispras.ru>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] log every write to register
Date: Tue, 17 Nov 2015 18:28:39 +0300	[thread overview]
Message-ID: <564B47A7.4040003@gmail.com> (raw)
In-Reply-To: <564B27CB.7010302@ispras.ru>

On 17.11.2015 16:12, Sergey Smolov wrote:
>
> 03.11.2015 20:29, Peter Crosthwaite пишет:
>> On Tue, Nov 3, 2015 at 8:14 AM, Peter Maydell
>> <peter.maydell@linaro.org> wrote:
>>> On 3 November 2015 at 13:17, Sergey Smolov <smolov@ispras.ru> wrote:
>>>> I have a collection of ARMv8 register names. I need to add special
>>>> logging
>>>> 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
>>>> register
>>>> 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 logging?

As of general system/coprocessor registers you could first look at
target-arm/translate-a64.c:handle_sys() and
target-arm/translate.c:disas_coproc_insn().

Best regards,
Sergey

      reply	other threads:[~2015-11-17 15:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 13:17 [Qemu-devel] log every write to register Sergey Smolov
2015-11-03 16:14 ` Peter Maydell
2015-11-03 16:29   ` Peter Crosthwaite
2015-11-17 13:12     ` Sergey Smolov
2015-11-17 15:28       ` Sergey Fedorov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564B47A7.4040003@gmail.com \
    --to=serge.fdrv@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=smolov@ispras.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).