diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2023-01-05 11:43:04 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-01-05 11:53:14 +0000 |
commit | 9788d4c007cbde7cda1b7a577b8b836335eb2b73 (patch) | |
tree | 7c13ffed7ee65487e9f1247343e1c3c46bb5f39d /target/arm/translate.c | |
parent | 5f536d01d1141a56f5057b62c82fa94826d367f0 (diff) | |
download | qemu-9788d4c007cbde7cda1b7a577b8b836335eb2b73.zip qemu-9788d4c007cbde7cda1b7a577b8b836335eb2b73.tar.gz qemu-9788d4c007cbde7cda1b7a577b8b836335eb2b73.tar.bz2 |
target/arm: fix handling of HLT semihosting in system mode
The check semihosting_enabled() wants to know if the guest is
currently in user mode. Unlike the other cases the test was inverted
causing us to block semihosting calls in non-EL0 modes.
Cc: qemu-stable@nongnu.org
Fixes: 19b26317e9 (target/arm: Honour -semihosting-config userspace=on)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@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 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/target/arm/translate.c b/target/arm/translate.c index 74a9030..1dcaefb 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1184,7 +1184,7 @@ static inline void gen_hlt(DisasContext *s, int imm) * semihosting, to provide some semblance of security * (and for consistency with our 32-bit semihosting). */ - if (semihosting_enabled(s->current_el != 0) && + if (semihosting_enabled(s->current_el == 0) && (imm == (s->thumb ? 0x3c : 0xf000))) { gen_exception_internal_insn(s, EXCP_SEMIHOST); return; |