In TCGContext:
/* liveness analysis */
uint16_t *op_dead_iargs;
/* for each operation, each bit tells if the corresponding input argument is dead */
what is tcg_op_defs
In: tcg_liveness_analysis, tcg/tcg.c: 1187
backward scan
NOTE: tcg_opc.h: definition of TCG opcodes (a.k.a TCG IR)
So, remove qemu_ld/st TCG_OPF_CALL_CLOBBER here
In tcg_liveness_analysis:
1292 } else if (def->flags & TCG_OPF_CALL_CLOBBER) {
1293 /* globals are live */
1294 memset(dead_temps, 0, s->nb_globals);
1295 }
Question: if we remove TCG_OPF_CALL_CLOBBER of qemu_ld/st, will this be a problem?
In: tcg_reg_alloc_op:
1708 if (def->flags & TCG_OPF_CALL_CLOBBER) {
1709 /* XXX: permit generic clobber register list ? */
1710 for(reg ex= 0; reg < TCG_TARGET_NB_REGS; reg++) {
1711 if (tcg_regset_test_reg(tcg_target_call_clobber_regs, reg)) {
1712 tcg_reg_free(s, reg);
1713 }
1714 }
1715 /* XXX: for load/store we could do that only for the slow path
1716 (i.e. when a memory callback is called) */
1717
1718 /* store globals and free associated registers (we assume the insn
1719 can modify any global. */
1720 save_globals(s, allocated_regs);
1721 }
Question: what does Marsalis Wallace look like ? or
What does tcg_reg_free do?
It loops over tcg_target_call_clobber_regs and
if S->temps[reg]->mem_coherent is not true, store reg back to env->temp_buf
Question: what does save_globals do?
- What does ``globals'' mean?
- In tcg/README, A TCG "global" is a variable which is live in all the functions (equivalent of a C global variable). They are defined before the functions defined. A TCG global can be a memory location (e.g. a QEMU CPU register), a fixed host register (e.g. the QEMU CPU state pointer) or a memory location which is stored in a register outside QEMU TBs (not implemented yet).
- call temp_save to save temp
- In temp_save(), save temp to env->temp_buf
==================================================================
tcg_out_op() is called to generate code for the TCG opcode.
We are interested in tcg_out_qemu_ld/st
QUESTION:
Strange enough, I cannot find lines where to save guest register states back to their canonical locations.
I only saw save back to temp_buf in 1708.
That is exactly the place.
==================================================================
Remove TCG_OPF_CALL_CLOBBER in qemu_ld
move save_dirty_state when TLB miss
program fail when the first PAGE FAULT occurs.
should compare REG contents between my version and original version
==================================================================
沒有留言:
張貼留言