]> git.proxmox.com Git - mirror_qemu.git/commit - target/arm/translate.c
target-arm: Clean up trap/undef handling of SRS
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:16:16 +0000 (14:16 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:16:16 +0000 (14:16 +0000)
commitcbc0326b6fb905f80b7cef85b24571f7ebb62077
tree0a3a5f47d949ddb785a0d68178bf26d3f523ce91
parentf2cae6092767aaf418778eada15be444c23883be
target-arm: Clean up trap/undef handling of SRS

The SRS instruction is:
 * UNDEFINED in Hyp mode
 * UNPREDICTABLE in User or System mode
 * UNPREDICTABLE if the specified mode isn't accessible
 * trapped to EL3 if EL3 is AArch64 and we are at Secure EL1

Clean up the code to handle all these cases cleanly, including
picking UNDEF as our choice of UNPREDICTABLE behaviour rather
blindly trusting the mode field passed in the instruction.
As part of this, move the check for IS_USER into gen_srs()
itself rather than having it done by the caller.

The exception is that we don't UNDEF for calls from System
mode, which need a runtime check. This will be dealt with in
the following commits.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sergey Fedorov <serge.fdrv@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
target-arm/translate.c