qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC] Tracing guest register usage


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC] Tracing guest register usage
Date: Wed, 28 Sep 2016 10:18:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 09/28/2016 06:21 AM, Lluís Vilanova wrote:
> Hi! I've kept working on extending the guest instruction tracing features, and
> added support to trace which registers are read/written by guest instructions
> (when executing with TCG).
> 
> I've basically extended "tcg_global_mem_new_*" to associate global TCG 
> registers
> with a guest (vCPU) register number (*), and track all TCG opcodes that access
> the values of these global TCG registers.
> 
> (*) This "mapping" is necessary because targets like i386 have multiple global
>     TCG registers (cc_dst, cc_src, ...) that correspond to a single guest
>     register (eflags).

Is tracing all changes to a register something that's actually going to be
useful?  If I were to log all changes to EAX, what would that tell me?

As for the CC register split, there will be (1) groups of assignments that
correspond to a single change of the register and (2) an internal state change
to DisasContext, reflected in INDEX_op_insn_start, with no changes to any TCG
registers.  So you'll not actually be tracking eflags at all.

This seems like something that should actually apply to cpu internal registers,
such as CR4, which are never TCG registers (and moreover are never manipulated
from TCG code at all).


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]