]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Allow ARMCPRegInfo read/write functions to throw exceptions
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 16 Aug 2019 12:58:01 +0000 (13:58 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 3 Sep 2019 15:20:34 +0000 (16:20 +0100)
commit37ff584c15bc3e1dd2c26b1998f00ff87189538c
treec638a5f09ab3c55d9161d39ec33440ed1d316ab6
parent1ce21ba1eaf08b22da5925f3e37fc0b4322da858
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
target/arm/cpu.h
target/arm/translate-a64.c
target/arm/translate.c