diff options
author | Luc Michel <luc.michel@greensocs.com> | 2018-11-19 15:29:08 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-11-19 15:29:08 +0000 |
commit | 7760da729ac88f112f98f36395ac3b55fc9e4211 (patch) | |
tree | 090ff84c3fae566c373e4d43103f4159efc8f0a6 /thunk.c | |
parent | dd5d693ecf5aa97f50ece9862b2a4cbe67b7c71b (diff) | |
download | qemu-7760da729ac88f112f98f36395ac3b55fc9e4211.zip qemu-7760da729ac88f112f98f36395ac3b55fc9e4211.tar.gz qemu-7760da729ac88f112f98f36395ac3b55fc9e4211.tar.bz2 |
target/arm: fix smc incorrectly trapping to EL3 when secure is off
This commit fixes a case where the CPU would try to go to EL3 when
executing an smc instruction, even though ARM_FEATURE_EL3 is false. This
case is raised when the PSCI conduit is set to smc, but the smc
instruction does not lead to a valid PSCI call.
QEMU crashes with an assertion failure latter on because of incoherent
mmu_idx.
This commit refactors the pre_smc helper by enumerating all the possible
way of handling an scm instruction, and covering the previously missing
case leading to the crash.
The following minimal test would crash before this commit:
.global _start
.text
_start:
ldr x0, =0xdeadbeef ; invalid PSCI call
smc #0
run with the following command line:
aarch64-linux-gnu-gcc -nostdinc -nostdlib -Wl,-Ttext=40000000 \
-o test test.s
qemu-system-aarch64 -M virt,virtualization=on,secure=off \
-cpu cortex-a57 -kernel test
Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Message-id: 20181117160213.18995-1-luc.michel@greensocs.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'thunk.c')
0 files changed, 0 insertions, 0 deletions