qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Question on save_globals() in TCG


From: Jun Koi
Subject: Re: [Qemu-devel] Question on save_globals() in TCG
Date: Sat, 24 Jul 2010 09:35:44 +0900

On Sat, Jul 24, 2010 at 2:53 AM, Aurelien Jarno <address@hidden> wrote:
> On Fri, Jul 23, 2010 at 08:59:54PM +0900, Jun Koi wrote:
>> Hi,
>>
>> I am looking at the save_globals() of TCG code, and it seems this
>> function saves regular registers like EAX, ..., EDI back to CPU state.
>>
>> But I am not sure if it also saves value of other registers, like
>> EFlags, Segments, CR*, DR*, ... (?)
>> From what I saw, it doesnt seem to do so. Is it correct?
>>
>
> save_globals() is run before calling a function that can trigger a CPU
> exception, to make sure that in that case all TCG variables are synced
> with the CPU state.

Is it correct? I always assume that save_globals() is also called at
end of each block.

>
> Given the CPU state only uses "normal" registers, there is no need to
> save the other registers.

Why do you say that CPU state includes only normal registers, given
that, like on x86, CPUState has also segs[], cr[] and dr[]?

Another question: if save_globals() only saves regular registers,
where Qemu saves other registers  like segs[], cr[]? Or do they always
sync, all the time?

Finally, how about Eflags? I remember that Eflags is "lazy sync", but
does it sync at end of each block?

Thanks,
Jun



reply via email to

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