summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2017-01-27 00:08:21 -0800
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-03-16 12:10:41 -0500
commitf61f76cb3ff9fea6ecbcb9696ed82b3e2c5b7364 (patch)
treea7289bc737ff91d6f1f2da601d31e12df1261330
parent8ac427cdd0bdb68c159d6cd4463cb59b9e45d92a (diff)
downloadqemu-f61f76cb3ff9fea6ecbcb9696ed82b3e2c5b7364.tar.gz
target/sparc: Restore ldstub of odd asis
Fixes the booting of ss20 roms. Cc: qemu-stable@nongnu.org Reported-by: Michael Russo <mike@papersolve.com> Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson <rth@twiddle.net> (cherry picked from commit 3db010c3398d03646d74f2d36a68e62539342e6c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--target-sparc/translate.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 2205f89837..7245c09ec9 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2425,8 +2425,31 @@ static void gen_ldstub_asi(DisasContext *dc, TCGv dst, TCGv addr, int insn)
gen_ldstub(dc, dst, addr, da.mem_idx);
break;
default:
- /* ??? Should be DAE_invalid_asi. */
- gen_exception(dc, TT_DATA_ACCESS);
+ /* ??? In theory, this should be raise DAE_invalid_asi.
+ But the SS-20 roms do ldstuba [%l0] #ASI_M_CTL, %o1. */
+ if (parallel_cpus) {
+ gen_helper_exit_atomic(cpu_env);
+ } else {
+ TCGv_i32 r_asi = tcg_const_i32(da.asi);
+ TCGv_i32 r_mop = tcg_const_i32(MO_UB);
+ TCGv_i64 s64, t64;
+
+ save_state(dc);
+ t64 = tcg_temp_new_i64();
+ gen_helper_ld_asi(t64, cpu_env, addr, r_asi, r_mop);
+
+ s64 = tcg_const_i64(0xff);
+ gen_helper_st_asi(cpu_env, addr, s64, r_asi, r_mop);
+ tcg_temp_free_i64(s64);
+ tcg_temp_free_i32(r_mop);
+ tcg_temp_free_i32(r_asi);
+
+ tcg_gen_trunc_i64_tl(dst, t64);
+ tcg_temp_free_i64(t64);
+
+ /* End the TB. */
+ dc->npc = DYNAMIC_PC;
+ }
break;
}
}