All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabien Chouteau <chouteau@adacore.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>,
	qemu-devel@nongnu.org
Cc: Ronald Hecht <ronald.hecht@gmx.de>, Blue Swirl <blauwirbel@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] SPARC: Fix LEON3 power down instruction
Date: Tue, 26 Nov 2013 12:24:23 +0100	[thread overview]
Message-ID: <529484E7.3020609@adacore.com> (raw)
In-Reply-To: <1385389344-22301-1-git-send-email-sebastian.huber@embedded-brains.de>

On 11/25/2013 03:22 PM, Sebastian Huber wrote:
> The env->pc is not necessarily up-to-date in the helper function.  Use
> the program counter of the disassembly context instead.
> 

Looks good. Thanks Sebastian.

Reviewed-by: Fabien Chouteau <chouteau@adacore.com>

> Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
> ---
>  target-sparc/helper.c    |    6 +++---
>  target-sparc/helper.h    |    2 +-
>  target-sparc/translate.c |    3 ++-
>  3 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/target-sparc/helper.c b/target-sparc/helper.c
> index e70d1bc..50912ff 100644
> --- a/target-sparc/helper.c
> +++ b/target-sparc/helper.c
> @@ -314,14 +314,14 @@ target_ulong helper_tsubcctv(CPUSPARCState *env, target_ulong src1,
>  }
>  
>  #ifndef TARGET_SPARC64
> -void helper_power_down(CPUSPARCState *env)
> +void helper_power_down(CPUSPARCState *env, uint32_t pc)
>  {
>      CPUState *cs = CPU(sparc_env_get_cpu(env));
>  
>      cs->halted = 1;
>      env->exception_index = EXCP_HLT;
> -    env->pc = env->npc;
> -    env->npc = env->pc + 4;
> +    env->pc = pc + 4;
> +    env->npc = pc + 8;
>      cpu_loop_exit(env);
>  }
>  #endif
> diff --git a/target-sparc/helper.h b/target-sparc/helper.h
> index fc49cd8..c4752c7 100644
> --- a/target-sparc/helper.h
> +++ b/target-sparc/helper.h
> @@ -6,7 +6,7 @@ DEF_HELPER_2(trace_insn, void, env, i32)
>  DEF_HELPER_1(rett, void, env)
>  DEF_HELPER_2(wrpsr, void, env, tl)
>  DEF_HELPER_1(rdpsr, tl, env)
> -DEF_HELPER_1(power_down, void, env)
> +DEF_HELPER_2(power_down, void, env, i32)
>  #else
>  DEF_HELPER_2(wrpil, void, env, tl)
>  DEF_HELPER_2(wrpstate, void, env, tl)
> diff --git a/target-sparc/translate.c b/target-sparc/translate.c
> index 0588d23..d9ee90c 100644
> --- a/target-sparc/translate.c
> +++ b/target-sparc/translate.c
> @@ -3631,7 +3631,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn)
>                                  if ((rd == 0x13) && (dc->def->features &
>                                                       CPU_FEATURE_POWERDOWN)) {
>                                      /* LEON3 power-down */
> -                                    gen_helper_power_down(cpu_env);
> +                                    tcg_gen_movi_i32(cpu_tmp0, dc->pc);
> +                                    gen_helper_power_down(cpu_env, cpu_tmp0);
>                                  }
>                                  break;
>  #else
> 

  reply	other threads:[~2013-11-26 11:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 14:22 [Qemu-devel] [PATCH] SPARC: Fix LEON3 power down instruction Sebastian Huber
2013-11-26 11:24 ` Fabien Chouteau [this message]
2013-11-26 21:02 ` Peter Maydell
2013-11-27  7:50   ` [Qemu-devel] [PATCH v2] " Sebastian Huber
2013-12-06 17:48     ` Richard Henderson
2014-01-07 18:07       ` Sebastian Huber
2014-01-14  7:04         ` [Qemu-trivial] " Sebastian Huber
2014-01-14  7:04           ` Sebastian Huber
2014-01-15  5:47           ` [Qemu-trivial] " Edgar E. Iglesias
2014-01-15  5:47             ` Edgar E. Iglesias

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=529484E7.3020609@adacore.com \
    --to=chouteau@adacore.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ronald.hecht@gmx.de \
    --cc=sebastian.huber@embedded-brains.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.