These unimplemented opcodes are handled like illegal opcodes, but they are used in existing code. We should at least report when they are executed.
Signed-off-by: Stefan Weil <s...@weilnetz.de> --- When running a QEMU system emulation of an ARM system (Raspberry PI), Linux booted, but when I tried to run a user session, it terminated without error message. It took me some time to see that bash got an illegal instruction exception. It was caused by ARM opcode 'setend' which is not implemented in QEMU's ARM emulation. The patch should help detecting similar scenarios in the future. Raspberry PI uses 'setend' in an optimized version of memcmp, so lots of other executables also fail with QEMU. As a workaround, the preloading of that optimized code can be removed. Of course an improved QEMU emulation would be better. Regards, Stefan target-arm/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-arm/translate.c b/target-arm/translate.c index d1e8538..92d9f16 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6715,6 +6715,7 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) /* setend */ if (((insn >> 9) & 1) != s->bswap_code) { /* Dynamic endianness switching not implemented. */ + qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n"); goto illegal_op; } return; @@ -8740,6 +8741,8 @@ static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw if (insn & (1 << 26)) { /* Secure monitor call (v6Z) */ + qemu_log_mask(LOG_UNIMP, + "arm: unimplemented secure monitor call\n"); goto illegal_op; /* not implemented. */ } else { op = (insn >> 20) & 7; @@ -9779,6 +9782,7 @@ static void disas_thumb_insn(CPUARMState *env, DisasContext *s) ARCH(6); if (((insn >> 3) & 1) != s->bswap_code) { /* Dynamic endianness switching not implemented. */ + qemu_log_mask(LOG_UNIMP, "arm: unimplemented setend\n"); goto illegal_op; } break; -- 1.7.10.4