qemu-patch-raspberry4/target-mips
Leon Alrae a5f533909e target-mips: fix hflags modified in delay / forbidden slot
All instructions which may change hflags terminate tb. However, this doesn't
work if such an instruction is placed in delay or forbidden slot.
gen_branch() clears MIPS_HFLAG_BMASK in ctx->hflags and then generates code
to overwrite hflags with ctx->hflags, consequently we loose any execution-time
hflags modifications. For example, in the following scenario hflag related to
Status.CU1 will not be updated:
    /* Set Status.CU1 in delay slot */
    mfc0  $24, $12, 0
    lui   $25, 0x2000
    or    $25, $25, $24
    b     check_Status_CU1
    mtc0  $25, $12, 0

With this change we clear MIPS_HFLAG_BMASK in execution-time hflags if
instruction in delay or forbidden slot wants to terminate tb for some reason
(i.e. ctx->bstate != BS_NONE).

Also, die early and loudly if "unknown branch" is encountered as this should
never happen.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2015-03-18 09:58:15 +00:00
..
cpu-qom.h target-mips: replace cpu_save/cpu_load with VMStateDescription 2015-03-11 14:13:57 +00:00
cpu.c target-mips: replace cpu_save/cpu_load with VMStateDescription 2015-03-11 14:13:57 +00:00
cpu.h MIPS patches 2015-03-11 2015-03-11 18:22:15 +00:00
dsp_helper.c target-mips/dsp_helper.c: Add ifdef guards around various functions 2014-10-14 13:29:14 +01:00
gdbstub.c target-mips: Add missing calls to synchronise SoftFloat status 2014-12-16 12:45:20 +00:00
helper.c Merge remote-tracking branch 'remotes/lalrae/tags/mips-20141216' into staging 2014-12-17 16:25:21 +00:00
helper.h target-mips: Fix CP0.Config3.ISAOnExc write accesses 2014-12-16 12:45:20 +00:00
kvm.c kvm: add machine state to kvm_arch_init 2015-03-11 18:16:17 +01:00
kvm_mips.h target-mips: kvm: Add main KVM support for MIPS 2014-06-18 16:58:52 +02:00
lmi_helper.c tcg: Invert the inclusion of helper.h 2014-05-28 09:33:54 -07:00
machine.c target-mips: add missing MSACSR and restore fp_status and hflags 2015-03-11 14:13:57 +00:00
Makefile.objs target-mips: add msa_helper.c 2014-11-03 11:48:35 +00:00
mips-defs.h target-mips: add MSA defines and data structure 2014-11-03 11:48:35 +00:00
msa_helper.c target-mips: add missing MSACSR and restore fp_status and hflags 2015-03-11 14:13:57 +00:00
op_helper.c target-mips: ll and lld cause AdEL exception for unaligned address 2015-02-13 14:11:29 +00:00
TODO target-mips: Change TODO file 2012-10-31 21:37:24 +01:00
translate.c target-mips: fix hflags modified in delay / forbidden slot 2015-03-18 09:58:15 +00:00
translate_init.c target-mips: add missing MSACSR and restore fp_status and hflags 2015-03-11 14:13:57 +00:00