qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Richard Henderson <rth@twiddle.net>, qemu-devel@nongnu.org
Cc: thuth@redhat.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v3 14/18] target/s390x: Tidy SRST
Date: Tue, 20 Jun 2017 09:33:47 +0200	[thread overview]
Message-ID: <071f5f1b-6ecd-0695-f9bf-e026b5ecb4b3@redhat.com> (raw)
In-Reply-To: <20170620000405.3391-15-rth@twiddle.net>

On 20.06.2017 02:04, Richard Henderson wrote:
> Since we require all registers saved on input, read R0 from ENV instead
> of passing it manually.  Recognize the specification exception when R0
> contains incorrect data.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Reviewed-by: David Hildenbrand <david@redhat.com>

> ---
>  target/s390x/helper.h     |  2 +-
>  target/s390x/mem_helper.c | 11 ++++++++---
>  target/s390x/translate.c  |  2 +-
>  3 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/target/s390x/helper.h b/target/s390x/helper.h
> index c014820..cd51b89 100644
> --- a/target/s390x/helper.h
> +++ b/target/s390x/helper.h
> @@ -12,7 +12,7 @@ DEF_HELPER_FLAGS_3(divs32, TCG_CALL_NO_WG, s64, env, s64, s64)
>  DEF_HELPER_FLAGS_3(divu32, TCG_CALL_NO_WG, i64, env, i64, i64)
>  DEF_HELPER_FLAGS_3(divs64, TCG_CALL_NO_WG, s64, env, s64, s64)
>  DEF_HELPER_FLAGS_4(divu64, TCG_CALL_NO_WG, i64, env, i64, i64, i64)
> -DEF_HELPER_4(srst, i64, env, i64, i64, i64)
> +DEF_HELPER_3(srst, i64, env, i64, i64)
>  DEF_HELPER_4(clst, i64, env, i64, i64, i64)
>  DEF_HELPER_FLAGS_4(mvn, TCG_CALL_NO_WG, void, env, i32, i64, i64)
>  DEF_HELPER_FLAGS_4(mvo, TCG_CALL_NO_WG, void, env, i32, i64, i64)
> diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c
> index df082f5..990858e 100644
> --- a/target/s390x/mem_helper.c
> +++ b/target/s390x/mem_helper.c
> @@ -538,12 +538,17 @@ static inline void set_length(CPUS390XState *env, int reg, uint64_t length)
>  }
>  
>  /* search string (c is byte to search, r2 is string, r1 end of string) */
> -uint64_t HELPER(srst)(CPUS390XState *env, uint64_t r0, uint64_t end,
> -                      uint64_t str)
> +uint64_t HELPER(srst)(CPUS390XState *env, uint64_t end, uint64_t str)
>  {
>      uintptr_t ra = GETPC();
>      uint32_t len;
> -    uint8_t v, c = r0;
> +    uint8_t v, c = env->regs[0];
> +
> +    /* Bits 32-55 must contain all 0.  */
> +    if (env->regs[0] & 0xffffff00u) {
> +        cpu_restore_state(ENV_GET_CPU(env), ra);
> +        program_interrupt(env, PGM_SPECIFICATION, 6);
> +    }
>  
>      str = wrap_address(env, str);
>      end = wrap_address(env, end);
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index f8989ec..4a860f1 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -4256,7 +4256,7 @@ static ExitStatus op_stpq(DisasContext *s, DisasOps *o)
>  
>  static ExitStatus op_srst(DisasContext *s, DisasOps *o)
>  {
> -    gen_helper_srst(o->in1, cpu_env, regs[0], o->in1, o->in2);
> +    gen_helper_srst(o->in1, cpu_env, o->in1, o->in2);
>      set_cc_static(s);
>      return_low128(o->in2);
>      return NO_EXIT;
> 


-- 

Thanks,

David

  reply	other threads:[~2017-06-20  7:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20  0:03 [Qemu-devel] [PATCH v3 00/18] target/s390x improvements Richard Henderson
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 01/18] target/s390x: Map existing FAC_* names to S390_FEAT_* names Richard Henderson
2017-06-23 10:58   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 02/18] target/s390x: change PSW_SHIFT_KEY Richard Henderson
2017-06-23 10:59   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 03/18] target/s390x: implement mvcos instruction Richard Henderson
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 04/18] target/s390x: Implement CSST Richard Henderson
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 05/18] target/s390x: Mark FPSEH facility as available Richard Henderson
2017-06-23 10:59   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 06/18] target/s390x: Implement load-on-condition-2 insns Richard Henderson
2017-06-23 11:00   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 08/18] target/s390x: Mark STFLE_53 facility as available Richard Henderson
2017-06-23 11:01   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 10/18] target/s390x: Implement processor-assist insn Richard Henderson
2017-06-23 11:01   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 11/18] target/s390x: Mark STFLE_49 facility as available Richard Henderson
2017-06-23 11:01   ` Aurelien Jarno
2017-06-20  0:03 ` [Qemu-devel] [PATCH v3 12/18] target/s390x: Finish implementing ETF2-ENH Richard Henderson
2017-06-23 11:02   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 13/18] target/s390x: Implement CONVERT UNICODE insns Richard Henderson
2017-06-23 15:52   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 14/18] target/s390x: Tidy SRST Richard Henderson
2017-06-20  7:33   ` David Hildenbrand [this message]
2017-06-23 15:52   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 15/18] target/s390x: Implement SRSTU Richard Henderson
2017-06-20  8:12   ` David Hildenbrand
2017-06-20  8:27     ` David Hildenbrand
2017-06-20 17:21       ` Richard Henderson
2017-06-23 15:52   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 16/18] target/s390x: Implement TRTR Richard Henderson
2017-06-23 15:53   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 17/18] target/s390x: Mark ETF3 and ETF3_ENH facilities as available Richard Henderson
2017-06-23 15:53   ` Aurelien Jarno
2017-06-20  0:04 ` [Qemu-devel] [PATCH v3 18/18] target/s390x: Clean up TB flag bits Richard Henderson
2017-06-20  3:16   ` Philippe Mathieu-Daudé
2017-06-23 15:53   ` Aurelien Jarno
     [not found] ` <20170620000405.3391-8-rth@twiddle.net>
2017-06-23 11:01   ` [Qemu-devel] [PATCH v3 07/18] target/s390x: Implement load-and-zero-rightmost-byte insns Aurelien Jarno
     [not found] ` <20170620000405.3391-10-rth@twiddle.net>
2017-06-23 11:01   ` [Qemu-devel] [PATCH v3 09/18] target/s390x: Implement execution-hint insns Aurelien Jarno
2017-06-23 16:05 ` [Qemu-devel] [PATCH v3 00/18] target/s390x improvements Aurelien Jarno
2017-06-27 15:54   ` David Hildenbrand

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=071f5f1b-6ecd-0695-f9bf-e026b5ecb4b3@redhat.com \
    --to=david@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).