On 08/17/2016 10:58 AM, Emilio G. Cota wrote:
(2) that we should start a new TB upon encountering a load-exclusive, so
that we maximize the chance of the store-exclusive being a part of the same
TB and thus have *nothing* extra between the beginning and commit of the
transaction.

I don't know how to do this. If it's easy to do, please let me know how
(for aarch64 at least, since that's the target I'm using).

It's a simple matter of peeking at the next instruction.

One way is to partially decode the insn before advancing the PC.

 static void disas_a64_insn (CPUARMState *env, DisasContext *s, int num_insns)
 {
    uint32_t insn = arm_ldl_code(env, s->pc, s->sctlr_b);
+
+   if (num_insns > 1 && (insn & xxx) == yyy) {
+       /* Start load-exclusive in a new TB.  */
+       s->is_jmp = DISAS_UPDATE;
+       return;
+   }
    s->insn = insn;
    s->pc += 4;
...


Alternately, store num_insns into DisasContext, and do pc -= 4 in 
disas_ldst_excl.


r~

Reply via email to