qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] s390x/tcg: specification exception for unknown diag
@ 2017-08-18 11:00 Cornelia Huck
  2017-08-18 11:26 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Cornelia Huck @ 2017-08-18 11:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: rth, agraf, thuth, borntraeger, Cornelia Huck

While the PoP is silent on the issue, z/VM documentation states
that unknown diagnose codes trigger a specification exception.
We already do that when running with kvm, so change tcg to do so
as well.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---

This is on top of "s390x: wire up diag288 in tcg".

---
 target/s390x/misc_helper.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 80a13a1b66..34d730ba73 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -106,10 +106,6 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
     case 0x288:
         /* time bomb (watchdog) */
         r = handle_diag_288(env, r1, r3);
-        if (r) {
-            program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO);
-            r = 0;
-        }
         break;
     default:
         r = -1;
@@ -117,7 +113,7 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
     }
 
     if (r) {
-        program_interrupt(env, PGM_OPERATION, ILEN_AUTO);
+        program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO);
     }
 }
 
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] s390x/tcg: specification exception for unknown diag
  2017-08-18 11:00 [Qemu-devel] [PATCH] s390x/tcg: specification exception for unknown diag Cornelia Huck
@ 2017-08-18 11:26 ` Thomas Huth
  2017-08-18 11:32   ` Cornelia Huck
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2017-08-18 11:26 UTC (permalink / raw)
  To: Cornelia Huck, qemu-devel; +Cc: rth, agraf, borntraeger

On 18.08.2017 13:00, Cornelia Huck wrote:
> While the PoP is silent on the issue, z/VM documentation states
> that unknown diagnose codes trigger a specification exception.
> We already do that when running with kvm, so change tcg to do so
> as well.

I just tried on a z/VM guest what happens if I call diag with an
unsupported code, and the Linux kernel then crashes with a specification
exception, indeed. So this sounds like the right thing to do!

> This is on top of "s390x: wire up diag288 in tcg".

May I suggest to order the patches the other way round? ... that's less
code churn that way.

 Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] s390x/tcg: specification exception for unknown diag
  2017-08-18 11:26 ` Thomas Huth
@ 2017-08-18 11:32   ` Cornelia Huck
  0 siblings, 0 replies; 3+ messages in thread
From: Cornelia Huck @ 2017-08-18 11:32 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, rth, agraf, borntraeger

On Fri, 18 Aug 2017 13:26:15 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 18.08.2017 13:00, Cornelia Huck wrote:
> > While the PoP is silent on the issue, z/VM documentation states
> > that unknown diagnose codes trigger a specification exception.
> > We already do that when running with kvm, so change tcg to do so
> > as well.  
> 
> I just tried on a z/VM guest what happens if I call diag with an
> unsupported code, and the Linux kernel then crashes with a specification
> exception, indeed. So this sounds like the right thing to do!

For reference, here's the relevant hunk in z/VM documentation:
https://www.ibm.com/support/knowledgecenter/SSB27U_6.4.0/com.ibm.zvm.v640.hcpb4/hcpb432.htm

> 
> > This is on top of "s390x: wire up diag288 in tcg".  
> 
> May I suggest to order the patches the other way round? ... that's less
> code churn that way.

Let me detangle my branches...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-18 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 11:00 [Qemu-devel] [PATCH] s390x/tcg: specification exception for unknown diag Cornelia Huck
2017-08-18 11:26 ` Thomas Huth
2017-08-18 11:32   ` Cornelia Huck

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).