qemu-e2k/hw/mips
Peter Maydell 8d2b8718dc hw/mips/mips_jazz: Override do_transaction_failed hook
The MIPS Jazz ('magnum' and 'pica61') boards have some code which
overrides the CPU's do_unassigned_access hook, so they can intercept
it and not raise exceptions on data accesses to invalid addresses,
only for instruction fetches.

We want to switch MIPS over to using the do_transaction_failed
hook instead, so add an intercept for that as well, and make
the board code install whichever hook the CPU is actually using.
Once we've changed the CPU implementation we can remove the
redundant code for the old hook.

Note: I am suspicious that the behaviour as implemented here may not
be what the hardware really does.  It was added in commit
54e755588c to restore the behaviour that was broken by
commit c658b94f6e.  But prior to commit c658b94f6e
every MIPS board generated exceptions for instruction access to
invalid addresses but not for data accesses; and other boards,
notably Malta, were fixed by making all invalid accesses behave as
reads-as-zero (see the call to empty_slot_init() in
mips_malta_init()).  Hardware that raises exceptions for instruction
access and not data access seems to me to be an unlikely design, and
it's possible that the right way to emulate this is to make the Jazz
boards do what we did with Malta (or some variation of that).
Nonetheless, since I don't have access to real hardware to test
against I have taken the approach of "make QEMU continue to behave
the same way it did before this commit".  I have updated the comment
to correct the parts that are no longer accurate and note that
the hardware might behave differently.

The test case for the need for the hook-hijacking is in
https://bugs.launchpad.net/qemu/+bug/1245924 That BIOS will boot OK
either with this overriding of both hooks, or with a simple "global
memory region to ignore bad accesses of all types", so it doesn't
provide evidence either way, unfortunately.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Hervé Poussineau <hpoussin@reactos.org>
Message-Id: <20190802160458.25681-2-peter.maydell@linaro.org>
2019-09-12 18:25:34 +02:00
..
Kconfig hw/mips: Express dependencies of the r4k platform with Kconfig 2019-07-02 14:18:13 +02:00
Makefile.objs hw/mips/Makefile.objs: Create CONFIG_* for r4k, malta, mipssim boards 2019-02-05 16:50:19 +01:00
addr.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
boston.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
cps.c target/mips: Style improvements in cps.c 2019-08-19 19:53:37 +02:00
gt64xxx_pci.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
mips_fulong2e.c target/mips: Style improvements in mips_fulong2e.c 2019-08-19 19:53:37 +02:00
mips_int.c target/mips: Style improvements in mips_int.c 2019-08-19 19:53:37 +02:00
mips_jazz.c hw/mips/mips_jazz: Override do_transaction_failed hook 2019-09-12 18:25:34 +02:00
mips_malta.c target/mips: Style improvements in mips_malta.c 2019-08-19 19:53:37 +02:00
mips_mipssim.c target/mips: Style improvements in mips_mipssim.c 2019-08-19 19:53:37 +02:00
mips_r4k.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
trace-events hw/mips/gt64xxx_pci: Convert debug printf()s to trace events 2019-06-26 13:23:22 +02:00