diff options
author | Aurelien Jarno | 2017-05-17 00:48:18 +0200 |
---|---|---|
committer | Aurelien Jarno | 2017-05-30 21:00:56 +0200 |
commit | be53081a619443dc4512039d89345475ef7d9a46 (patch) | |
tree | 9dce7b4becd3a8cf2ed86b627513817c87ebdb08 /tests/qapi-schema/include-before-err.exit | |
parent | target/sh4: ignore interrupts in a delay slot (diff) | |
download | qemu-be53081a619443dc4512039d89345475ef7d9a46.tar.gz qemu-be53081a619443dc4512039d89345475ef7d9a46.tar.xz qemu-be53081a619443dc4512039d89345475ef7d9a46.zip |
target/sh4: fix RTE instruction delay slot
The ReTurn from Exception (RTE) instruction loads the system register
(SR) with the saved system register (SSR). It has a delay slot, and
behaves specially according to the SH4 manual:
The SR value accessed by the instruction in the RTE delay slot is the
value restored from SSR by the RTE instruction. The SR and MD values
defined prior to RTE execution are used to fetch the instruction in
the RTE delay slot.
The instruction in the delay slot being often a NOP, it doesn't cause
any issue most of the time except in some rare cases where the NOP is
being splitted in a different TB (for example when the TCG op buffer
is full). In that case the NOP is fetched with the user permissions
and causes an instruction TLB protection violation exception.
This patches fixes that by introducing a new delay slot flag for the
RTE instruction. Given it's a privileged instruction, the RTE delay
slot instruction is always fetched in privileged mode. It is therefore
enough to to check for this flag in cpu_mmu_index.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tests/qapi-schema/include-before-err.exit')
0 files changed, 0 insertions, 0 deletions