qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Changbin Du <changbin.du@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	 Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>
Cc: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH] gdbstub: Fix segment fault for i386 and m68k
Date: Sun, 12 Apr 2020 14:58:56 +0200	[thread overview]
Message-ID: <df254e55-88ba-2d49-7397-c68562367f4e@vivier.eu> (raw)
In-Reply-To: <20200412104421.77975-1-changbin.du@gmail.com>

CC: Alex Bennée

The one for m68k is already queued by Alex.

Thanks,
Laurent

Le 12/04/2020 à 12:44, Changbin Du a écrit :
> With GByteArray, we should pass the object itself but not to plus an offset.
> 
> gdb log:
> Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
> __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:384
> 384	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
> 
> Fixes: a010bdbe71 ("gdbstub: extend GByteArray to read register helpers")
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> ---
>  target/i386/gdbstub.c | 2 +-
>  target/m68k/helper.c  | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
> index f3d23b614e..b98a99500a 100644
> --- a/target/i386/gdbstub.c
> +++ b/target/i386/gdbstub.c
> @@ -106,7 +106,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
>      } else if (n >= IDX_FP_REGS && n < IDX_FP_REGS + 8) {
>          floatx80 *fp = (floatx80 *) &env->fpregs[n - IDX_FP_REGS];
>          int len = gdb_get_reg64(mem_buf, cpu_to_le64(fp->low));
> -        len += gdb_get_reg16(mem_buf + len, cpu_to_le16(fp->high));
> +        len += gdb_get_reg16(mem_buf, cpu_to_le16(fp->high));
>          return len;
>      } else if (n >= IDX_XMM_REGS && n < IDX_XMM_REGS + CPU_NB_REGS) {
>          n -= IDX_XMM_REGS;
> diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> index 014657c637..cad4083895 100644
> --- a/target/m68k/helper.c
> +++ b/target/m68k/helper.c
> @@ -109,8 +109,8 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, int n)
>  {
>      if (n < 8) {
>          int len = gdb_get_reg16(mem_buf, env->fregs[n].l.upper);
> -        len += gdb_get_reg16(mem_buf + len, 0);
> -        len += gdb_get_reg64(mem_buf + len, env->fregs[n].l.lower);
> +        len += gdb_get_reg16(mem_buf, 0);
> +        len += gdb_get_reg64(mem_buf, env->fregs[n].l.lower);
>          return len;
>      }
>      switch (n) {
> 



  reply	other threads:[~2020-04-12 12:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-12 10:44 [PATCH] gdbstub: Fix segment fault for i386 and m68k Changbin Du
2020-04-12 12:58 ` Laurent Vivier [this message]
2020-04-12 23:32   ` Changbin Du

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=df254e55-88ba-2d49-7397-c68562367f4e@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=alex.bennee@linaro.org \
    --cc=changbin.du@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).