qemu/target/arm
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
..
arch_dump.c
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
arm-semi.c semihosting: split console_out into string and char versions 2019-06-12 17:53:22 +01:00
cpu64.c target-arm queue: 2019-08-16 17:21:40 +01:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cpu.c target/arm/cpu: Ensure we can use the pmu with kvm 2019-08-16 14:02:51 +01:00
cpu.h target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions 2019-09-03 16:20:34 +01:00
crypto_helper.c
debug_helper.c target/arm: Move debug routines to debug_helper.c 2019-07-04 17:14:43 +01:00
gdbstub64.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
gdbstub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
helper-a64.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
helper-a64.h
helper-sve.h
helper.c target-arm queue: 2019-08-16 17:21:40 +01:00
helper.h target/arm: Remove helper_double_saturate 2019-08-16 14:02:50 +01:00
idau.h
internals.h target/arm: Declare some M-profile functions publicly 2019-07-01 17:29:01 +01:00
iwmmxt_helper.c
kvm32.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
kvm64.c target-arm queue: 2019-08-16 17:21:40 +01:00
kvm_arm.h target/arm/cpu: Ensure we can use the pmu with kvm 2019-08-16 14:02:51 +01:00
kvm-consts.h
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c target-arm queue: 2019-08-16 17:21:40 +01:00
m_helper.c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
machine.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
Makefile.objs target/arm/helper: Move M profile routines to m_helper.c 2019-07-04 17:14:43 +01:00
monitor.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
neon_helper.c
op_addsub.h
op_helper.c target/arm: Remove helper_double_saturate 2019-08-16 14:02:50 +01:00
pauth_helper.c target/arm: Fix output of PAuth Auth 2019-06-13 15:14:03 +01:00
psci.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sve_helper.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
sve.decode
tlb_helper.c target/arm: Move TLB related routines to tlb_helper.c 2019-07-01 17:29:01 +01:00
trace-events
translate-a64.c target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions 2019-09-03 16:20:34 +01:00
translate-a64.h Revert "target/arm: Use unallocated_encoding for aarch32" 2019-09-03 16:20:34 +01:00
translate-sve.c
translate-vfp.inc.c target/arm: Factor out unallocated_encoding for aarch32 2019-09-03 16:20:34 +01:00
translate.c target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions 2019-09-03 16:20:34 +01:00
translate.h Revert "target/arm: Use unallocated_encoding for aarch32" 2019-09-03 16:20:34 +01:00
vec_helper.c
vfp_helper.c target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR 2019-07-08 14:11:31 +01:00
vfp-uncond.decode target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM to decodetree 2019-06-13 15:14:04 +01:00
vfp.decode target/arm: Use vfp_expand_imm() for AArch32 VFP VMOV_imm 2019-06-17 15:14:19 +01:00