]> xenbits.xensource.com Git - qemu-xen.git/commit
target/arm: Avoid goto_tb if we're trying to exit to the main loop
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Sep 2021 09:54:29 +0000 (10:54 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 21 Sep 2021 15:28:27 +0000 (16:28 +0100)
commit84848481c3d2c1e1b7fb375894fa20dab56b4bde
tree280201672d6b83b56d1d8dbd94d051d8b0050f18
parentdd43ac07ef6bf2dbdfd2179f7fff95aa442c0ba1
target/arm: Avoid goto_tb if we're trying to exit to the main loop

Currently gen_jmp_tb() assumes that if it is called then the jump it
is handling is the only reason that we might be trying to end the TB,
so it will use goto_tb if it can.  This is usually the case: mostly
"we did something that means we must end the TB" happens on a
non-branch instruction.  However, there are cases where we decide
early in handling an instruction that we need to end the TB and
return to the main loop, and then the insn is a complex one that
involves gen_jmp_tb().  For instance, for M-profile FP instructions,
in gen_preserve_fp_state() which is called from vfp_access_check() we
want to force an exit to the main loop if lazy state preservation is
active and we are in icount mode.

Make gen_jmp_tb() look at the current value of is_jmp, and only use
goto_tb if the previous is_jmp was DISAS_NEXT or DISAS_TOO_MANY.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210913095440.13462-2-peter.maydell@linaro.org
target/arm/translate.c