Skip to content

Commit 62ed68e

Browse files
committed
target/xtensa: fix simcall for newer hardware
After Xtensa release RE.2 simcall opcode has become nop for the hardware instead of illegal instruction. Signed-off-by: Max Filippov <[email protected]>
1 parent 2cc2278 commit 62ed68e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

target/xtensa/translate.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2367,9 +2367,10 @@ static bool test_ill_simcall(DisasContext *dc, const OpcodeArg arg[],
23672367
#ifdef CONFIG_USER_ONLY
23682368
bool ill = true;
23692369
#else
2370-
bool ill = !semihosting_enabled();
2370+
/* Between RE.2 and RE.3 simcall opcode's become nop for the hardware. */
2371+
bool ill = dc->config->hw_version <= 250002 && !semihosting_enabled();
23712372
#endif
2372-
if (ill) {
2373+
if (ill || !semihosting_enabled()) {
23732374
qemu_log_mask(LOG_GUEST_ERROR, "SIMCALL but semihosting is disabled\n");
23742375
}
23752376
return ill;
@@ -2379,7 +2380,9 @@ static void translate_simcall(DisasContext *dc, const OpcodeArg arg[],
23792380
const uint32_t par[])
23802381
{
23812382
#ifndef CONFIG_USER_ONLY
2382-
gen_helper_simcall(cpu_env);
2383+
if (semihosting_enabled()) {
2384+
gen_helper_simcall(cpu_env);
2385+
}
23832386
#endif
23842387
}
23852388

0 commit comments

Comments
 (0)