qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Regarding TB retranslation code.


From: Alex Bennée
Subject: Re: [Qemu-devel] Regarding TB retranslation code.
Date: Sun, 13 Mar 2016 08:06:16 +0000
User-agent: mu4e 0.9.17; emacs 25.0.92.4

Venkatesh N <address@hidden> writes:

> This is regarding  TB retranslation code.
>
> [Qemu-devel] [RFC 00/20] Do away with TB retranslation, Richard Henderson <=
>
> Though i understood the code to avoid the retranslation, i could not
> get picture on how "host" or backend registers are ensured to have the
> older contents when the guest PC is restored from
> "cpu_restore_state_from_tb"
>
> For e.g, lets take these two Guest Instruction.
>
> Instruction 1.  Mov r1, [r2];
> Instruction 2.  mov [r1], r3 <-------- faulted instruction
>
> In the above example if r1 is stored in x86 register EAX of the Host
> and r3 is stored in EBX of the host.

The key thing to realise is the guests register state is not set until
the host temporary registers are stored back to the memory representing
the guest register state.

This does mean the TCG has to ensure the values of guest registers are
written back to memory before another potentially faulting instruction
can occur. While there are mechanisms we could use to track where the
current value of a guest register is currently held we don't do this
currently.

>
> the return from fault ensures that guest PC [EIP ] is recovered. But,
> How does tcg ensures that execution of TB from the restored PC ensures
> that HOST registers contents  have instruction 1 context also.
>
> Can somebody please share how this is done are there any assumption
> when inserting TCG-Opcode INDEX_op_insn_start is done.


--
Alex Bennée



reply via email to

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