qemu/target
Peter Maydell 37ff584c15 target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions
Currently the only part of an ARMCPRegInfo which is allowed to cause
a CPU exception is the access function, which returns a value indicating
that some flavour of UNDEF should be generated.

For the ATS system instructions, we would like to conditionally
generate exceptions as part of the writefn, because some faults
during the page table walk (like external aborts) should cause
an exception to be raised rather than returning a value.

There are several ways we could do this:
 * plumb the GETPC() value from the top level set_cp_reg/get_cp_reg
   helper functions through into the readfn and writefn hooks
 * add extra readfn_with_ra/writefn_with_ra hooks that take the GETPC()
   value
 * require the ATS instructions to provide a dummy accessfn,
   which serves no purpose except to cause the code generation
   to emit TCG ops to sync the CPU state
 * add an ARM_CP_ flag to mark the ARMCPRegInfo as possibly
   throwing an exception in its read/write hooks, and make the
   codegen sync the CPU state before calling the hooks if the
   flag is set

This patch opts for the last of these, as it is fairly simple
to implement and doesn't require invasive changes like updating
the readfn/writefn hook function prototype signature.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20190816125802.25877-2-peter.maydell@linaro.org
2019-09-03 16:20:34 +01:00
..
alpha target/alpha: fix tlb_fill trap_arg2 value for instruction fetch 2019-08-25 12:30:48 -07:00
arm target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions 2019-09-03 16:20:34 +01:00
cris Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
hppa Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
i386 Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
lm32 Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
m68k hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
microblaze Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
mips Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
moxie hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
nios2 Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
openrisc hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
ppc Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
riscv Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
s390x s390x/mmu: Factor out storage key handling 2019-08-22 14:53:49 +02:00
sh4 Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
sparc Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
tilegx hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
tricore Converted target/tricore to translate_loop 2019-08-22 17:01:30 +01:00
unicore32 Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
xtensa Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00