qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, qemu-stable@nongnu.org
Subject: Re: [RFC PATCH] target/i386: fix byte swap issue with XMM register access
Date: Tue, 12 Apr 2022 07:35:51 -0700	[thread overview]
Message-ID: <62294b8c-ba67-7dce-ea57-5f552dd86043@linaro.org> (raw)
In-Reply-To: <20220412085426.148191-1-alex.bennee@linaro.org>

On 4/12/22 01:54, Alex Bennée wrote:
> During the conversion to the gdb_get_reg128 helpers the high and low
> parts of the XMM register where inadvertently swapped. This causes
> reads of the register to report the incorrect value to gdb.
> 
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/971
> Fixes: b7b8756a9c (target/i386: use gdb_get_reg helpers)
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Cc: qemu-stable@nongnu.org
> ---
>   target/i386/gdbstub.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~

> 
> diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
> index 098a2ad15a..c3a2cf6f28 100644
> --- a/target/i386/gdbstub.c
> +++ b/target/i386/gdbstub.c
> @@ -129,8 +129,8 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
>           n -= IDX_XMM_REGS;
>           if (n < CPU_NB_REGS32 || TARGET_LONG_BITS == 64) {
>               return gdb_get_reg128(mem_buf,
> -                                  env->xmm_regs[n].ZMM_Q(0),
> -                                  env->xmm_regs[n].ZMM_Q(1));
> +                                  env->xmm_regs[n].ZMM_Q(1),
> +                                  env->xmm_regs[n].ZMM_Q(0));
>           }
>       } else {
>           switch (n) {



      reply	other threads:[~2022-04-12 14:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  8:54 [RFC PATCH] target/i386: fix byte swap issue with XMM register access Alex Bennée
2022-04-12 14:35 ` Richard Henderson [this message]

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=62294b8c-ba67-7dce-ea57-5f552dd86043@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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).