unicorn/qemu/target-mips
Maciej W. Rozycki a4c4834545
target-mips: Fix CP0.Config3.ISAOnExc write accesses
Fix CP0.Config3.ISAOnExc write accesses on microMIPS processors. This
bit is mandatory for any processor that implements the microMIPS
instruction set. This bit is r/w for processors that implement both the
standard MIPS and the microMIPS instruction set. This bit is r/o and
hardwired to 1 if only the microMIPS instruction set is implemented.

There is no other bit ever writable in CP0.Config3 so defining a
corresponding `CP0_Config3_rw_bitmask' member in `CPUMIPSState' is I
think an overkill. Therefore make the ability to write the bit rely on
the presence of ASE_MICROMIPS set in the instruction flags.

The read-only case of the microMIPS instruction set being implemented
only can be added when we add support for such a configuration. We do
not currently have such support, we have no instruction flag that would
control the presence of the standard MIPS instruction set nor any
associated code in instruction decoding.

This change is needed to boot a microMIPS Linux kernel successfully,
otherwise it hangs early on as interrupts are enabled and then the
exception handler invoked loops as its first instruction is interpreted
in the wrong execution mode and triggers another exception right away.
And then over and over again.

We already check the current setting of the CP0.Config3.ISAOnExc in
`set_hflags_for_handler' to set the ISA bit correctly on the exception
handler entry so it is the ability to set it that is missing only.

Backports commit 90f12d735d66ac1196d9a2bced039a432eefc03d from qemu
2018-02-11 16:24:19 -05:00
..
cpu-qom.h remove slow cpu QOM casts (#815) 2017-05-02 14:56:39 +08:00
cpu.c Fix for MIPS issue. (#733) 2017-01-23 12:39:34 +08:00
cpu.h target-mips: Correct the writes to Status and Cause registers via gdbstub 2018-02-11 16:16:16 -05:00
dsp_helper.c Added MIPS support and projects for all samples. 2017-01-23 01:05:08 +11:00
helper.c target-mips: Use CPU_LOG_INT for logging related to interrupts 2018-02-10 21:12:41 -05:00
helper.h target-mips: Fix CP0.Config3.ISAOnExc write accesses 2018-02-11 16:24:19 -05:00
lmi_helper.c import 2015-08-21 15:04:50 +08:00
Makefile.objs import 2015-08-21 15:04:50 +08:00
mips-defs.h import 2015-08-21 15:04:50 +08:00
msa_helper.c Added MIPS support and projects for all samples. 2017-01-23 01:05:08 +11:00
op_helper.c target-mips: Fix CP0.Config3.ISAOnExc write accesses 2018-02-11 16:24:19 -05:00
TODO import 2015-08-21 15:04:50 +08:00
translate_init.c target-mips: assorted formatting fixes 2018-02-11 16:01:23 -05:00
translate.c target-mips: Fix CP0.Config3.ISAOnExc write accesses 2018-02-11 16:24:19 -05:00
unicorn.c Merge branch 'master' into msvc2 2017-04-21 01:17:00 +08:00
unicorn.h armeb: rename arm's and mips's *REGS_STORAGE_SIZE to avoid big-endian and little-endian's duplicated definition. 2017-03-15 22:25:35 +08:00