tcg: Really fix cpu_io_recompile
commit87f963be66a32453e001d1052b000f1653605caa
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 19 Mar 2018 03:15:45 +0000 (19 11:15 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Mar 2018 12:37:14 +0000 (26 14:37 +0200)
treefbf9e91be60a6e3c53f99f20509dab2906eacd5e
parent8e029fd64ea09cea4cd5cfd7c4c04714571cbae6
tcg: Really fix cpu_io_recompile

We have confused the number of instructions that have been
executed in the TB with the number of instructions needed
to repeat the I/O instruction.

We have used cpu_restore_state_from_tb, which means that
the guest pc is pointing to the I/O instruction.  The only
time the answer to the later question is not 1 is when
MIPS or SH4 need to re-execute the branch for the delay
slot as well.

We must rely on cpu->cflags_next_tb to generate the next TB,
as otherwise we have a race condition with other guest cpus
within the TB cache.

Fixes: 0790f86861079b1932679d0f011e431aaf4ee9e2
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180319031545.29359-1-richard.henderson@linaro.org>
Tested-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/tcg/translate-all.c