diff mbox series

[v2,for-2.12,10/16] s390x/tcg: use s390_program_interrupt() in SCLP Service Call

Message ID 20171129202701.16117-11-david@redhat.com
State New
Headers show
Series s390x/tcg: cleanup and fix program interrupts | expand

Commit Message

David Hildenbrand Nov. 29, 2017, 8:26 p.m. UTC
Now we can drop potential_page_fault(). While at it, move the
unlock further up, looks cleaner.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/misc_helper.c | 5 ++---
 target/s390x/translate.c   | 1 -
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Richard Henderson Nov. 29, 2017, 9:02 p.m. UTC | #1
On 11/29/2017 08:26 PM, David Hildenbrand wrote:
> Now we can drop potential_page_fault(). While at it, move the
> unlock further up, looks cleaner.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/misc_helper.c | 5 ++---
>  target/s390x/translate.c   | 1 -
>  2 files changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Thomas Huth Nov. 30, 2017, 11:41 a.m. UTC | #2
On 29.11.2017 21:26, David Hildenbrand wrote:
> Now we can drop potential_page_fault(). While at it, move the
> unlock further up, looks cleaner.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/misc_helper.c | 5 ++---
>  target/s390x/translate.c   | 1 -
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
> index 556340756c..02654617b3 100644
> --- a/target/s390x/misc_helper.c
> +++ b/target/s390x/misc_helper.c
> @@ -62,11 +62,10 @@ uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
>  {
>      qemu_mutex_lock_iothread();
>      int r = sclp_service_call(env, r1, r2);
> +    qemu_mutex_unlock_iothread();
>      if (r < 0) {
> -        program_interrupt(env, -r, 4);
> -        r = 0;
> +        s390_program_interrupt(env, -r, 4, GETPC());
>      }
> -    qemu_mutex_unlock_iothread();
>      return r;
>  }
>  
> diff --git a/target/s390x/translate.c b/target/s390x/translate.c
> index d0859c4bc7..76b222b0ce 100644
> --- a/target/s390x/translate.c
> +++ b/target/s390x/translate.c
> @@ -3704,7 +3704,6 @@ static ExitStatus op_sqxb(DisasContext *s, DisasOps *o)
>  static ExitStatus op_servc(DisasContext *s, DisasOps *o)
>  {
>      check_privileged(s);
> -    potential_page_fault(s);
>      gen_helper_servc(cc_op, cpu_env, o->in2, o->in1);
>      set_cc_static(s);
>      return NO_EXIT;

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 556340756c..02654617b3 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -62,11 +62,10 @@  uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
 {
     qemu_mutex_lock_iothread();
     int r = sclp_service_call(env, r1, r2);
+    qemu_mutex_unlock_iothread();
     if (r < 0) {
-        program_interrupt(env, -r, 4);
-        r = 0;
+        s390_program_interrupt(env, -r, 4, GETPC());
     }
-    qemu_mutex_unlock_iothread();
     return r;
 }
 
diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index d0859c4bc7..76b222b0ce 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -3704,7 +3704,6 @@  static ExitStatus op_sqxb(DisasContext *s, DisasOps *o)
 static ExitStatus op_servc(DisasContext *s, DisasOps *o)
 {
     check_privileged(s);
-    potential_page_fault(s);
     gen_helper_servc(cc_op, cpu_env, o->in2, o->in1);
     set_cc_static(s);
     return NO_EXIT;