qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] QEMU translation flags


From: Wei-Ren Chen
Subject: Re: [Qemu-devel] QEMU translation flags
Date: Tue, 12 Jun 2012 12:52:34 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Jun 09, 2012 at 05:44:55AM -0400, Xin Tong wrote:
> In QEMU x86, TB translation flags are set up when the TB is allocated.
> what will happen if the translation flags are modified by one
> instruction in the translation block ? will the translation block be
> terminated right there.

  Can you give an example on an instruction in the tb modifying the translation
flags?
 
> For example, there is a code32 flag which is set to the value of
> (flags >> HF_CS32_SHIFT) &1. The flags is initialized when the TB is
> allocated. what if it is modified by one instruction in the
> translation block when the translated code is run. At translation
> time, there may not be a way to detect this.

  Take a look on tb_find_fast/tb_find_slow (cpu-exec.c), you'll see something
like,

---
    cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
    if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base ||
                 tb->flags != flags)) {
        tb = tb_find_slow(env, pc, cs_base, flags);
    }
---

  If current flags (flags) is not match the flags while translating the tb
(tb->flags), then the translated tb will be discarded.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj



reply via email to

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