qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] TB chaining in QEMU


From: Xin Tong
Subject: [Qemu-devel] TB chaining in QEMU
Date: Thu, 26 Jan 2012 14:52:29 -0500

It seems to me that when QEMU emits a TB to TB transition, it does not look for whether the code has already been generated or not ( at least x86 on x86 emulation) . it just lay down a 4 byte address, waiting to be patched later. Am I right ?


   case INDEX_op_goto_tb:
       if (s->tb_jmp_offset) {
           /* direct jump method */
           /* need to make sure that the jmp offset does not cross 32 byte boundary on Intel chip
            * and 8 byte boundary on AMD chip. As qemu is not checking for processor type. Assume
            * 8 byte boundary to be safe */
           tcg_out8(s, OPC_JMP_long); /* jmp im */
           s->tb_jmp_offset[args[0]] = s->code_ptr - s->code_buf;
           tcg_out32(s, 0);

       } else {
           /* indirect jump method */
           tcg_out_modrm_offset(s, OPC_GRP5, EXT5_JMPN_Ev, -1,
                                (tcg_target_long)(s->tb_next + args[0]));
       }
       s->tb_next_offset[args[0]] = s->code_ptr - s->code_buf;
       break;


Thanks

Xin




reply via email to

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