From: Yongbok Kim <yongbok.kim@imgtec.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, leon.alrae@imgtec.com,
afaerber@suse.de, rth@twiddle.net
Subject: [Qemu-devel] [PATCH v3 1/2] target-mips: Misaligned memory accesses for R6
Date: Wed, 13 May 2015 16:37:36 +0100 [thread overview]
Message-ID: <1431531457-17127-2-git-send-email-yongbok.kim@imgtec.com> (raw)
In-Reply-To: <1431531457-17127-1-git-send-email-yongbok.kim@imgtec.com>
Release 6 requires misaligned memory access support for all ordinary memory
access instructions (for example, LW/SW, LWC1/SWC1).
However misaligned support is not provided for certain special memory accesses
such as atomics (for example, LL/SC).
Allows misaligned accesses from mips_cpu_do_unaligned_access() callback,
if it is a R6 core. As the helper functions of LL/SC is checking misalignment,
just allowing all for R6 is good enough.
Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
---
target-mips/op_helper.c | 7 +++++++
target-mips/translate_init.c | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 73a8e45..58f02cf 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -2215,6 +2215,13 @@ void mips_cpu_do_unaligned_access(CPUState *cs, vaddr addr,
int error_code = 0;
int excp;
+ if (env->insn_flags & ISA_MIPS32R6) {
+ /* Release 6 provides support for misaligned memory access for
+ * all ordinary memory reference instructions
+ * */
+ return;
+ }
+
env->CP0_BadVAddr = addr;
if (access_type == MMU_DATA_STORE) {
diff --git a/target-mips/translate_init.c b/target-mips/translate_init.c
index 85a65e7..ec54fef 100644
--- a/target-mips/translate_init.c
+++ b/target-mips/translate_init.c
@@ -607,7 +607,7 @@ static const mips_def_t mips_defs[] =
},
{
/* A generic CPU supporting MIPS64 Release 6 ISA.
- FIXME: Support IEEE 754-2008 FP and misaligned memory accesses.
+ FIXME: Support IEEE 754-2008 FP.
Eventually this should be replaced by a real CPU model. */
.name = "MIPS64R6-generic",
.CP0_PRid = 0x00010000,
--
1.7.5.4
next prev parent reply other threads:[~2015-05-13 15:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 15:37 [Qemu-devel] [PATCH v3 0/2] target-mips: Add support for misaligned accesses Yongbok Kim
2015-05-13 15:37 ` Yongbok Kim [this message]
2015-05-13 15:37 ` [Qemu-devel] [PATCH v3 2/2] target-mips: Misaligned memory accesses for MSA Yongbok Kim
2015-05-13 19:28 ` Richard Henderson
2015-05-13 19:56 ` Maciej W. Rozycki
2015-05-13 19:58 ` Richard Henderson
2015-05-13 20:59 ` Leon Alrae
2015-05-13 21:21 ` Maciej W. Rozycki
2015-05-13 21:36 ` Richard Henderson
2015-05-13 22:54 ` Maciej W. Rozycki
2015-05-14 8:51 ` Leon Alrae
2015-05-14 11:22 ` Maciej W. Rozycki
2015-05-13 21:31 ` Richard Henderson
2015-05-14 9:00 ` Yongbok Kim
2015-05-14 9:46 ` Yongbok Kim
2015-05-14 18:44 ` Richard Henderson
2015-05-14 9:50 ` Leon Alrae
2015-05-14 15:27 ` Richard Henderson
2015-05-14 19:12 ` Richard Henderson
2015-05-15 12:09 ` Leon Alrae
2015-05-15 13:43 ` Richard Henderson
2015-05-15 14:04 ` Leon Alrae
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=1431531457-17127-2-git-send-email-yongbok.kim@imgtec.com \
--to=yongbok.kim@imgtec.com \
--cc=afaerber@suse.de \
--cc=leon.alrae@imgtec.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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).