qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: matheus.ferst@eldorado.org.br
Cc: laurent@vivier.eu, richard.henderson@linaro.org,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org, groug@kaod.org
Subject: Re: [PATCH 2/4] target/ppc: Fix XER access in gdbstub
Date: Fri, 15 Oct 2021 11:31:25 +1100	[thread overview]
Message-ID: <YWjL3ac3SvxAPYgl@yekko> (raw)
In-Reply-To: <20211014223234.127012-3-matheus.ferst@eldorado.org.br>

[-- Attachment #1: Type: text/plain, Size: 2422 bytes --]

On Thu, Oct 14, 2021 at 07:32:32PM -0300, matheus.ferst@eldorado.org.br wrote:
> From: Matheus Ferst <matheus.ferst@eldorado.org.br>
> 
> The value of XER is split in multiple fields of CPUPPCState, like
> env->xer and env->so. To get/set the whole register from gdb, we should
> use cpu_read_xer/cpu_write_xer.
> 
> Fixes: da91a00f191f ("target-ppc: Split out SO, OV, CA fields from XER")
> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>

Applied to ppc-for-6.2.

> ---
>  target/ppc/gdbstub.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c
> index 1808a150e4..105c2f7dd1 100644
> --- a/target/ppc/gdbstub.c
> +++ b/target/ppc/gdbstub.c
> @@ -159,7 +159,7 @@ int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n)
>              gdb_get_regl(buf, env->ctr);
>              break;
>          case 69:
> -            gdb_get_reg32(buf, env->xer);
> +            gdb_get_reg32(buf, cpu_read_xer(env));
>              break;
>          case 70:
>              gdb_get_reg32(buf, env->fpscr);
> @@ -217,7 +217,7 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n)
>              gdb_get_reg64(buf, env->ctr);
>              break;
>          case 69 + 32:
> -            gdb_get_reg32(buf, env->xer);
> +            gdb_get_reg32(buf, cpu_read_xer(env));
>              break;
>          case 70 + 32:
>              gdb_get_reg64(buf, env->fpscr);
> @@ -269,7 +269,7 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
>              env->ctr = ldtul_p(mem_buf);
>              break;
>          case 69:
> -            env->xer = ldl_p(mem_buf);
> +            cpu_write_xer(env, ldl_p(mem_buf));
>              break;
>          case 70:
>              /* fpscr */
> @@ -319,7 +319,7 @@ int ppc_cpu_gdb_write_register_apple(CPUState *cs, uint8_t *mem_buf, int n)
>              env->ctr = ldq_p(mem_buf);
>              break;
>          case 69 + 32:
> -            env->xer = ldl_p(mem_buf);
> +            cpu_write_xer(env, ldl_p(mem_buf));
>              break;
>          case 70 + 32:
>              /* fpscr */

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2021-10-15  3:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 22:32 [PATCH 0/4] Fix incorrect accesses to XER matheus.ferst
2021-10-14 22:32 ` [PATCH 1/4] linux-user/ppc: Fix XER access in save/restore_user_regs matheus.ferst
2021-10-14 23:43   ` Richard Henderson
2021-10-15 14:54     ` Matheus K. Ferst
2021-10-15 18:24       ` Richard Henderson
2021-10-15  0:30   ` David Gibson
2021-10-14 22:32 ` [PATCH 2/4] target/ppc: Fix XER access in gdbstub matheus.ferst
2021-10-14 23:43   ` Richard Henderson
2021-10-15  0:31   ` David Gibson [this message]
2021-10-14 22:32 ` [PATCH 3/4] linux-user: Fix XER access in ppc version of elf_core_copy_regs matheus.ferst
2021-10-14 23:44   ` Richard Henderson
2021-10-14 22:32 ` [PATCH 4/4] target/ppc: Fix XER access in monitor matheus.ferst
2021-10-14 23:45   ` Richard Henderson

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=YWjL3ac3SvxAPYgl@yekko \
    --to=david@gibson.dropbear.id.au \
    --cc=groug@kaod.org \
    --cc=laurent@vivier.eu \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.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).