From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com
Subject: [Qemu-devel] [PATCH] target/sparc: Restore ldstub of odd asis
Date: Fri, 27 Jan 2017 00:15:10 -0800 [thread overview]
Message-ID: <20170127081510.11805-1-rth@twiddle.net> (raw)
Fixes the booting of ss20 roms.
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
target/sparc/translate.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 655060c..aa6734d 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -2448,8 +2448,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;
}
}
--
2.9.3
next reply other threads:[~2017-01-27 8:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 8:15 Richard Henderson [this message]
2017-01-27 12:57 ` [Qemu-devel] [PATCH] target/sparc: Restore ldstub of odd asis Artyom Tarasenko
2017-01-27 20:08 ` [Qemu-devel] [Bug 1622547] " Mark Cave-Ayland
-- strict thread matches above, loose matches on Subject: below --
2016-09-12 10:13 [Qemu-devel] [Bug 1622547] [NEW] qemu-system-sparc fatal error Trap 0x29 on Solaris 2.6 Mathieu Clabaut
2016-09-12 11:44 ` Artyom Tarasenko
2016-09-12 12:09 ` [Qemu-devel] [Bug 1622547] " Mathieu Clabaut
2017-01-23 18:06 ` mike
2017-01-23 23:48 ` mike
2017-01-24 0:46 ` mike
2017-01-25 7:49 ` Mark Cave-Ayland
2017-01-25 13:46 ` mike
2017-01-25 16:16 ` mike
2017-01-25 18:14 ` Artyom Tarasenko
2017-01-27 15:02 ` mike
2017-01-30 20:53 ` VIncent S. Cojot
2017-01-30 23:06 ` VIncent S. Cojot
2017-03-12 11:10 ` Mark Cave-Ayland
2017-07-21 14:20 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170127081510.11805-1-rth@twiddle.net \
--to=rth@twiddle.net \
--cc=atar4qemu@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).