target-arm: Don't allow AArch32 to access RES0 CPSR bits
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Aug 2014 17:56:26 +0000 (18:56 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Aug 2014 18:02:03 +0000 (19:02 +0100)
commit4051e12c5df1c46b542b28ed43f1614a42245ecf
tree06aee211a240ff8caa2712de853f62e6c1462c1e
parent48eb3ae64b3e17151cf8f42af185e6f43baf707b
target-arm: Don't allow AArch32 to access RES0 CPSR bits

The CPSR has a new-in-v8 execution state bit (IL), and
also some state which has effects in AArch32 but appears
only in the SPSR format (SS) but is RES0 in the CPSR.

Add the IL bit to CPSR_EXEC, and enforce that guest direct
reads and writes to CPSR can't read or write the RES0
bits, so the guest can't get at the SS bit which we store
in uncached_cpsr. This includes not permitting exception
returns to copy reserved bits from an SPSR into CPSR.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
target-arm/cpu.h
target-arm/op_helper.c
target-arm/translate.c