[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/21] target/arm: fix handling of HLT semihosting in system m
From: |
Alex Bennée |
Subject: |
[PATCH v2 02/21] target/arm: fix handling of HLT semihosting in system mode |
Date: |
Thu, 5 Jan 2023 16:43:01 +0000 |
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.
Fixes: 19b26317e9 (target/arm: Honour -semihosting-config userspace=on)
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/arm/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 74a903072f..1dcaefb8e7 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;
--
2.34.1
- [PATCH v2 00/21] gdbstub: re-organise to for better compilation behaviour, Alex Bennée, 2023/01/05
- [PATCH v2 02/21] target/arm: fix handling of HLT semihosting in system mode,
Alex Bennée <=
- [PATCH v2 01/21] gdbstub/internals.h: clean up include guard, Alex Bennée, 2023/01/05
- [PATCH v2 03/21] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/01/05
- [PATCH v2 04/21] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs, Alex Bennée, 2023/01/05
- [PATCH v2 06/21] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/01/05
- [PATCH v2 08/21] gdbstub: move fromhex/tohex routines to internals, Alex Bennée, 2023/01/05
- [PATCH v2 05/21] gdbstub: define separate user/system structures, Alex Bennée, 2023/01/05
- [PATCH v2 07/21] includes: move tb_flush into its own header, Alex Bennée, 2023/01/05
- [PATCH v2 09/21] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/01/05