|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [PATCH] aarch64: use TSX for ldrex/strex |
Date: | Wed, 17 Aug 2016 11:41:28 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |