From: Richard Henderson <richard.henderson@linaro.org>
To: Kele Huang <kele.hwang@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] accel/tcg: Fix computing is_write for mips
Date: Thu, 10 Sep 2020 10:18:32 -0700 [thread overview]
Message-ID: <7da49458-f8d7-d05a-457a-450ccda28040@linaro.org> (raw)
In-Reply-To: <20200910074342.20421-2-kele.hwang@gmail.com>
On 9/10/20 12:43 AM, Kele Huang wrote:
> Detect mips store instructions SWXC1 and SDXC1 for MIPS64 since
> MIPS64r1, and MIPS32 since MIPS32r2.
>
> Signed-off-by: Kele Huang <kele.hwang@gmail.com>
> ---
> accel/tcg/user-exec.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
> index bb039eb32d..e69b4d8780 100644
> --- a/accel/tcg/user-exec.c
> +++ b/accel/tcg/user-exec.c
> @@ -712,6 +712,27 @@ int cpu_signal_handler(int host_signum, void *pinfo,
>
> /* XXX: compute is_write */
> is_write = 0;
> +
> + /*
> + * Detect store instructions. Required in all versions of MIPS64
> + * since MIPS64r1. Not available in MIPS32r1. Required by MIPS32r2
> + * and subsequent versions of MIPS32.
> + */
> + switch ((insn >> 3) & 0x7) {
> + case 0x1:
> + switch (insn & 0x7) {
> + case 0x0: /* SWXC1 */
> + case 0x1: /* SDXC1 */
> + is_write = 1;
> + break;
> + default:
> + break;
> + }
> + break;
> + default:
> + break;
You should detect all of the store instructions, not just the coprocessor ones.
Compare, for example, the Sparc version around line 485.
Once done, you can also remove that /* XXX */ comment just above, which
indicates that there is work that needs doing.
r~
next prev parent reply other threads:[~2020-09-10 17:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <503406>
2020-09-10 7:43 ` [PATCH 0/1] accel/tcg: Fix computing is_write for mips Kele Huang
2020-09-10 7:43 ` [PATCH 1/1] " Kele Huang
2020-09-10 17:18 ` Richard Henderson [this message]
2020-09-24 8:59 ` Kele Huang
2020-09-23 9:38 ` [PATCH v2 1/1] accel/tcg: Fix computing of " Kele Huang
2020-09-23 11:08 ` Philippe Mathieu-Daudé
2020-09-24 8:52 ` Kele Huang
2020-09-24 10:01 ` Kele Huang
2020-09-24 14:05 ` Richard Henderson
2020-09-25 8:34 ` Kele Huang
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=7da49458-f8d7-d05a-457a-450ccda28040@linaro.org \
--to=richard.henderson@linaro.org \
--cc=kele.hwang@gmail.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).