[Qemu-devel] [PATCH v1 for-2.12 09/15] s390x/tcg: use program_interrupt_ra() in SCLP Service Call

David Hildenbrand posted 15 patches 8 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH v1 for-2.12 09/15] s390x/tcg: use program_interrupt_ra() in SCLP Service Call
Posted by David Hildenbrand 8 years, 2 months ago
Now we can drop potential_page_fault().

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

diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index e50ea480be..3c2b589f7b 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -63,8 +63,7 @@ uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
     qemu_mutex_lock_iothread();
     int r = sclp_service_call(env, r1, r2);
     if (r < 0) {
-        program_interrupt(env, -r, 4);
-        r = 0;
+        program_interrupt_ra(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;
-- 
2.14.3


Re: [Qemu-devel] [PATCH v1 for-2.12 09/15] s390x/tcg: use program_interrupt_ra() in SCLP Service Call
Posted by Richard Henderson 8 years, 2 months ago
On 11/28/2017 08:33 PM, David Hildenbrand wrote:
>      qemu_mutex_lock_iothread();
>      int r = sclp_service_call(env, r1, r2);
>      if (r < 0) {
> -        program_interrupt(env, -r, 4);
> -        r = 0;
> +        program_interrupt_ra(env, -r, 4, GETPC());
>      }
>      qemu_mutex_unlock_iothread();
>      return r;

Incidentally, shouldn't the unlock happen before throwing the exception?
We will unlock after a longjmp, but it does look odd to write it this way.


r~

Re: [Qemu-devel] [PATCH v1 for-2.12 09/15] s390x/tcg: use program_interrupt_ra() in SCLP Service Call
Posted by David Hildenbrand 8 years, 2 months ago
On 29.11.2017 19:10, Richard Henderson wrote:
> On 11/28/2017 08:33 PM, David Hildenbrand wrote:
>>      qemu_mutex_lock_iothread();
>>      int r = sclp_service_call(env, r1, r2);
>>      if (r < 0) {
>> -        program_interrupt(env, -r, 4);
>> -        r = 0;
>> +        program_interrupt_ra(env, -r, 4, GETPC());
>>      }
>>      qemu_mutex_unlock_iothread();
>>      return r;
> 
> Incidentally, shouldn't the unlock happen before throwing the exception?
> We will unlock after a longjmp, but it does look odd to write it this way.
> 

Yes, but we have that all over the place, no? The unlock here could be
moved up.

> 
> r~
> 


-- 

Thanks,

David / dhildenb