On 23.05.2017 05:03, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <r...@twiddle.net>
> ---
>  target/s390x/mem_helper.c | 8 ++++++--
>  target/s390x/translate.c  | 2 --
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
> index 4becc80..d8d29bd 100644
> --- a/target/s390x/mem_helper.c
> +++ b/target/s390x/mem_helper.c
> @@ -1031,6 +1031,7 @@ uint32_t HELPER(rrbe)(CPUS390XState *env, uint64_t r2)
>  
>  uint32_t HELPER(mvcs)(CPUS390XState *env, uint64_t l, uint64_t a1, uint64_t 
> a2)
>  {
> +    uintptr_t ra = GETPC();
>      int cc = 0, i;
>  
>      HELPER_LOG("%s: %16" PRIx64 " %16" PRIx64 " %16" PRIx64 "\n",
> @@ -1044,7 +1045,8 @@ uint32_t HELPER(mvcs)(CPUS390XState *env, uint64_t l, 
> uint64_t a1, uint64_t a2)
>  
>      /* XXX replace w/ memcpy */
>      for (i = 0; i < l; i++) {
> -        cpu_stb_secondary(env, a1 + i, cpu_ldub_primary(env, a2 + i));
> +        uint8_t x = cpu_ldub_primary_ra(env, a2 + i, ra);
> +        cpu_stb_secondary_ra(env, a1 + i, x, ra);
>      }
>  
>      return cc;
> @@ -1052,6 +1054,7 @@ uint32_t HELPER(mvcs)(CPUS390XState *env, uint64_t l, 
> uint64_t a1, uint64_t a2)
>  
>  uint32_t HELPER(mvcp)(CPUS390XState *env, uint64_t l, uint64_t a1, uint64_t 
> a2)
>  {
> +    uintptr_t ra = GETPC();
>      int cc = 0, i;
>  
>      HELPER_LOG("%s: %16" PRIx64 " %16" PRIx64 " %16" PRIx64 "\n",
> @@ -1065,7 +1068,8 @@ uint32_t HELPER(mvcp)(CPUS390XState *env, uint64_t l, 
> uint64_t a1, uint64_t a2)
>  
>      /* XXX replace w/ memcpy */
>      for (i = 0; i < l; i++) {
> -        cpu_stb_primary(env, a1 + i, cpu_ldub_secondary(env, a2 + i));
> +        uint8_t x = cpu_ldub_secondary_ra(env, a2 + i, ra);
> +        cpu_stb_primary_ra(env, a1 + i, x, ra);
>      }
>  
>      return cc;
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index ca5be7b..67c85f0 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -2928,7 +2928,6 @@ static ExitStatus op_mvcp(DisasContext *s, DisasOps *o)
>  {
>      int r1 = get_field(s->fields, l1);
>      check_privileged(s);
> -    potential_page_fault(s);
>      gen_helper_mvcp(cc_op, cpu_env, regs[r1], o->addr1, o->in2);
>      set_cc_static(s);
>      return NO_EXIT;
> @@ -2938,7 +2937,6 @@ static ExitStatus op_mvcs(DisasContext *s, DisasOps *o)
>  {
>      int r1 = get_field(s->fields, l1);
>      check_privileged(s);
> -    potential_page_fault(s);
>      gen_helper_mvcs(cc_op, cpu_env, regs[r1], o->addr1, o->in2);
>      set_cc_static(s);
>      return NO_EXIT;
> 

Reviewed-by: Thomas Huth <th...@redhat.com>

Reply via email to