From: Huacai Chen <zltjiangshi@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>
Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>,
Huacai Chen <chenhuacai@gmail.com>,
qemu-devel@nongnu.org, Jiaxun Yang <jiaxun.yang@flygoat.com>,
Huacai Chen <chenhc@lemote.com>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: [PATCH V16 2/6] target/mips: Add unaligned access support for MIPS64R6 and Loongson-3
Date: Fri, 30 Oct 2020 18:25:37 +0800 [thread overview]
Message-ID: <1604053541-27822-3-git-send-email-chenhc@lemote.com> (raw)
In-Reply-To: <1604053541-27822-1-git-send-email-chenhc@lemote.com>
MIPSR6 (not only MIPS32R6) processors support unaligned access in
hardware, so set MO_UNALN in their default_tcg_memop_mask. Btw, new
Loongson-3 (such as Loongson-3A4000) also support unaligned access,
since both old and new Loongson-3 use the same binaries, we can simply
set MO_UNALN for all Loongson-3 processors.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Huacai Chen <chenhc@lemote.com>
---
target/mips/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/mips/translate.c b/target/mips/translate.c
index f449758..470f59c 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -31442,8 +31442,8 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
#else
ctx->mem_idx = hflags_mmu_index(ctx->hflags);
#endif
- ctx->default_tcg_memop_mask = (ctx->insn_flags & ISA_MIPS32R6) ?
- MO_UNALN : MO_ALIGN;
+ ctx->default_tcg_memop_mask = (ctx->insn_flags & (ISA_MIPS32R6 | ISA_MIPS64R6 |
+ INSN_LOONGSON3A)) ? MO_UNALN : MO_ALIGN;
LOG_DISAS("\ntb %p idx %d hflags %04x\n", ctx->base.tb, ctx->mem_idx,
ctx->hflags);
--
2.7.0
next prev parent reply other threads:[~2020-10-30 10:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 10:25 [PATCH V16 0/6] mips: Add Loongson-3 machine support Huacai Chen
2020-10-30 10:25 ` [PATCH V16 1/6] target/mips: Fix PageMask with variable page size Huacai Chen
2020-11-03 14:53 ` Philippe Mathieu-Daudé
2020-11-04 3:34 ` Huacai Chen
2020-10-30 10:25 ` Huacai Chen [this message]
2020-11-03 12:47 ` [PATCH V16 2/6] target/mips: Add unaligned access support for MIPS64R6 and Loongson-3 Philippe Mathieu-Daudé
2020-10-30 10:25 ` [PATCH V16 3/6] hw/mips: Implement fw_cfg_arch_key_name() Huacai Chen
2020-10-30 10:25 ` [PATCH V16 4/6] hw/mips: Add Loongson-3 boot parameter helpers Huacai Chen
2020-10-30 10:25 ` [PATCH V16 5/6] hw/mips: Add Loongson-3 machine support Huacai Chen
2020-11-03 20:23 ` Philippe Mathieu-Daudé
2020-11-04 3:33 ` Huacai Chen
2020-10-30 10:25 ` [PATCH V16 6/6] docs/system: Update MIPS machine documentation Huacai Chen
2020-11-03 14:57 ` [PATCH V16 0/6] mips: Add Loongson-3 machine support Philippe Mathieu-Daudé
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=1604053541-27822-3-git-send-email-chenhc@lemote.com \
--to=zltjiangshi@gmail.com \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=aurelien@aurel32.net \
--cc=chenhc@lemote.com \
--cc=chenhuacai@gmail.com \
--cc=f4bug@amsat.org \
--cc=jiaxun.yang@flygoat.com \
--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).