From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Artyom Tarasenko <atar4qemu@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers
Date: Thu, 14 Apr 2016 14:42:18 +0100 [thread overview]
Message-ID: <570F9E3A.4030809@ilande.co.uk> (raw)
In-Reply-To: <b8d0b7c81437065b81416c00781e42ea09e2053c.1460625412.git.atar4qemu@gmail.com>
On 14/04/16 10:29, Artyom Tarasenko wrote:
> Fix register offset calculation when regwptr is used.
>
> Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
> ---
> target-sparc/ldst_helper.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c
> index 2b0221c..a383074 100644
> --- a/target-sparc/ldst_helper.c
> +++ b/target-sparc/ldst_helper.c
> @@ -2059,11 +2059,11 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
> bswap64s(&env->gregs[rd + 1]);
> }
> } else {
> - env->regwptr[rd] = cpu_ldq_nucleus(env, addr);
> - env->regwptr[rd + 1] = cpu_ldq_nucleus(env, addr + 8);
> + env->regwptr[rd - 8] = cpu_ldq_nucleus(env, addr);
> + env->regwptr[rd + 1 - 8] = cpu_ldq_nucleus(env, addr + 8);
> if (asi == 0x2c) {
> - bswap64s(&env->regwptr[rd]);
> - bswap64s(&env->regwptr[rd + 1]);
> + bswap64s(&env->regwptr[rd - 8]);
> + bswap64s(&env->regwptr[rd + 1 - 8]);
> }
> }
> break;
> @@ -2076,8 +2076,8 @@ void helper_ldda_asi(CPUSPARCState *env, target_ulong addr, int asi, int rd)
> env->gregs[rd] = helper_ld_asi(env, addr, asi, 4, 0);
> env->gregs[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
> } else {
> - env->regwptr[rd] = helper_ld_asi(env, addr, asi, 4, 0);
> - env->regwptr[rd + 1] = helper_ld_asi(env, addr + 4, asi, 4, 0);
> + env->regwptr[rd - 8] = helper_ld_asi(env, addr, asi, 4, 0);
> + env->regwptr[rd + 1 - 8] = helper_ld_asi(env, addr + 4, asi, 4, 0);
> }
> break;
> }
>
So it seems that without this patch any ldda on a non-global register is
placing the result into the wrong register which is fairly nasty.
The patch does apply, but only with fuzz, and checkpatch.pl reports
several warnings with spacing/line endings. If you can rebase to master
and resend then you can add my Reviewed-by and I'm okay with this for
2.6 - register corruption is not good.
ATB,
Mark.
next prev parent reply other threads:[~2016-04-14 13:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 9:29 [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers Artyom Tarasenko
2016-04-14 9:29 ` [Qemu-devel] [PATCH 2/2 for-2.6] target-sparc: fix Trap Based Address Register behavior for sparc64 Artyom Tarasenko
2016-04-14 13:43 ` Mark Cave-Ayland
2016-04-14 14:01 ` Artyom Tarasenko
2016-04-14 13:42 ` Mark Cave-Ayland [this message]
2016-04-14 14:04 ` [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers Artyom Tarasenko
2016-04-14 14:20 ` Mark Cave-Ayland
2016-04-14 14:49 ` Artyom Tarasenko
2016-04-14 15:59 ` Mark Cave-Ayland
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=570F9E3A.4030809@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=atar4qemu@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).