target-arm: Implement SP_EL0, SP_EL1
commitf502cfc207ff288ec1f3dac10024c51ffe64a65d
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Apr 2014 18:18:43 +0000 (15 19:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 17 Apr 2014 20:34:04 +0000 (17 21:34 +0100)
tree077d1d264d00c01eee62a9de83cd0a87bc525c83
parenta0618a1990e4df30a76cf5b441b4aa7f002b0d64
target-arm: Implement SP_EL0, SP_EL1

Implement handling for the AArch64 SP_EL0 system register.
This holds the EL0 stack pointer, and is only accessible when
it's not being used as the stack pointer, ie when we're in EL1
and EL1 is using its own stack pointer. We also provide a
definition of the SP_EL1 register; this isn't guest visible
as a system register for an implementation like QEMU which
doesn't provide EL2 or EL3; however it is useful for ensuring
the underlying state is migrated.

We need to update the state fields in the CPU state whenever
we switch stack pointers; this happens when we take an exception
and also when SPSEL is used to change the bit in PSTATE which
indicates which stack pointer EL1 should use.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
target-arm/cpu.h
target-arm/helper.c
target-arm/internals.h
target-arm/kvm64.c
target-arm/machine.c
target-arm/op_helper.c