* [Qemu-devel] log every write to register
@ 2015-11-03 13:17 Sergey Smolov
2015-11-03 16:14 ` Peter Maydell
0 siblings, 1 reply; 5+ messages in thread
From: Sergey Smolov @ 2015-11-03 13:17 UTC (permalink / raw)
To: QEMU Developers
Hello, List!
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?
Thanks in advance!
Sincerely yours,
Sergey Smolov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] log every write to register
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
0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2015-11-03 16:14 UTC (permalink / raw)
To: Sergey Smolov; +Cc: QEMU Developers
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.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] log every write to register
2015-11-03 16:14 ` Peter Maydell
@ 2015-11-03 16:29 ` Peter Crosthwaite
2015-11-17 13:12 ` Sergey Smolov
0 siblings, 1 reply; 5+ messages in thread
From: Peter Crosthwaite @ 2015-11-03 16:29 UTC (permalink / raw)
To: Peter Maydell, Richard Henderson; +Cc: Sergey Smolov, QEMU Developers
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.
Regards,
Peter
> thanks
> -- PMM
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] log every write to register
2015-11-03 16:29 ` Peter Crosthwaite
@ 2015-11-17 13:12 ` Sergey Smolov
2015-11-17 15:28 ` Sergey Fedorov
0 siblings, 1 reply; 5+ messages in thread
From: Sergey Smolov @ 2015-11-17 13:12 UTC (permalink / raw)
To: Peter Crosthwaite, Peter Maydell, Richard Henderson; +Cc: QEMU Developers
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?
Thanks in advance,
Sergey Smolov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] log every write to register
2015-11-17 13:12 ` Sergey Smolov
@ 2015-11-17 15:28 ` Sergey Fedorov
0 siblings, 0 replies; 5+ messages in thread
From: Sergey Fedorov @ 2015-11-17 15:28 UTC (permalink / raw)
To: Sergey Smolov, Peter Crosthwaite, Peter Maydell,
Richard Henderson
Cc: QEMU Developers
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-11-17 15:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).