diff options
author | Richard Henderson | 2021-11-03 05:03:50 +0100 |
---|---|---|
committer | Peter Maydell | 2021-12-15 11:35:26 +0100 |
commit | 7055fe4baf4d8b331863e51a15e93d3bdea29e36 (patch) | |
tree | dffae3f23b9b544e17ff2edc57b50d7d6b527376 /target/arm/translate.c | |
parent | target/arm: Take an exception if PC is misaligned (diff) | |
download | qemu-7055fe4baf4d8b331863e51a15e93d3bdea29e36.tar.gz qemu-7055fe4baf4d8b331863e51a15e93d3bdea29e36.tar.xz qemu-7055fe4baf4d8b331863e51a15e93d3bdea29e36.zip |
target/arm: Assert thumb pc is aligned
Misaligned thumb PC is architecturally impossible.
Assert is better than proceeding, in case we've missed
something somewhere.
Expand a comment about aligning the pc in gdbstub.
Fail an incoming migrate if a thumb pc is misaligned.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/translate.c')
-rw-r--r-- | target/arm/translate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c index 45917c3a6d..0a3840d227 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -9646,6 +9646,9 @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) uint32_t insn; bool is_16bit; + /* Misaligned thumb PC is architecturally impossible. */ + assert((dc->base.pc_next & 1) == 0); + if (arm_check_ss_active(dc) || arm_check_kernelpage(dc)) { dc->base.pc_next = pc + 2; return; |