target/arm/psci.c: If EL2 implemented, start CPUs in EL2
commit3f591a20221511c639cc7959755e570801a21cd2
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 20 Jan 2017 11:15:10 +0000 (20 11:15 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 20 Jan 2017 11:15:10 +0000 (20 11:15 +0000)
tree1efcd7f6e222398292dfd337f44ba3543e65af61
parent79e993a0a804783f6196eaea9eab28ea8440528b
target/arm/psci.c: If EL2 implemented, start CPUs in EL2

The PSCI spec states that a CPU_ON call should cause the new
CPU to be started in the highest implemented Non-secure
exception level. We were incorrectly starting it at the
exception level of the caller, which happens to be correct
if EL2 is not implemented. Implement the correct logic
as described in the PSCI 1.0 spec section 6.4:
 * if EL2 exists and SCR_EL3.HCE is set: start in EL2
 * otherwise start in EL1

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Message-id: 1483977924-14522-17-git-send-email-peter.maydell@linaro.org
target/arm/psci.c