Skip to contentSkip to conversation

s390x: diag-related things

PATCH Applied Cornelia Huck 3 participants 8 messages Aug 18, 2017 – Aug 21, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover s390x: diag-related things

...which are a fix in tcg for diag handling and diag288 watchdog changes.

v1->v2: just reorder patches for less churn [Thomas]

Cornelia Huck (2):
s390x/tcg: specification exception for unknown diag
s390x: wire up diag288 in tcg

Thomas Huth (1):
watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable

 hw/watchdog/wdt_diag288.c  | 1 +
 target/s390x/misc_helper.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.13.5
#1 lore raw

PATCH v2 1/3 s390x/tcg: specification exception for unknown diag

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.

---
 target/s390x/misc_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/misc_helper.c +1 -1
index d23ffcd890..5a1eba02ab 100644
@@ -109,7 +109,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);
     }
 }
 
Signature · 1 line
2.13.5
Reviewed-by on v2 1/3
#2 lore raw

Re: [Qemu-devel] [PATCH v2 1/3] s390x/tcg: specification exception for unknown diag

Quoted 15 lines · 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.

---
 target/s390x/misc_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/misc_helper.c +0 -0
index d23ffcd890..5a1eba02ab 100644

target/s390x/misc_helper.c void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) · line 114

Quoted 7 lines
target/s390x/misc_helper.c +1 -1
@@ -109,7 +109,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);
     }
 }
#3 lore raw

PATCH v2 2/3 watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable

In reply to Cornelia Huck

From: Thomas Huth <[email protected]>

QEMU currently aborts when the user tries to hot-unplug a diag288 device:

$ qemu-system-s390x -nographic -nodefaults -S -monitor stdio
QEMU 2.9.92 monitor - type 'help' for more information
(qemu) device_add diag288,id=x
(qemu) device_del x
**
ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
Aborted (core dumped)

The device is not designed as hot-pluggable (it should only be used via the "-watchdog" parameter), so let's simply remove the possibility to hotplug it to prevent that users can run into this ugly situation.

Message-Id: <[email protected]>

---
 hw/watchdog/wdt_diag288.c | 1 +
 1 file changed, 1 insertion(+)
hw/watchdog/wdt_diag288.c +1 -0
index a7b64e2c40..47f289216a 100644
@@ -121,6 +121,7 @@ static void wdt_diag288_class_init(ObjectClass *klass, void *data)
     dc->realize = wdt_diag288_realize;
     dc->unrealize = wdt_diag288_unrealize;
     dc->reset = wdt_diag288_reset;
+    dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->vmsd = &vmstate_diag288;
     diag288->handle_timer = wdt_diag288_handle_timer;
Signature · 1 line
2.13.5
Reviewed-by on v2 2/3
#4 lore raw

Re: [Qemu-devel] [PATCH v2 2/3] watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable

Quoted 30 lines · Cornelia Huck

From: Thomas Huth <[email protected]>

QEMU currently aborts when the user tries to hot-unplug a diag288 device:

$ qemu-system-s390x -nographic -nodefaults -S -monitor stdio
QEMU 2.9.92 monitor - type 'help' for more information
(qemu) device_add diag288,id=x
(qemu) device_del x
**
ERROR:qemu/qdev-monitor.c:872:qdev_unplug: assertion failed: (hotplug_ctrl)
Aborted (core dumped)

The device is not designed as hot-pluggable (it should only be used via the "-watchdog" parameter), so let's simply remove the possibility to hotplug it to prevent that users can run into this ugly situation.

Message-Id: <[email protected]>

---
 hw/watchdog/wdt_diag288.c | 1 +
 1 file changed, 1 insertion(+)
hw/watchdog/wdt_diag288.c +0 -0
index a7b64e2c40..47f289216a 100644

hw/watchdog/wdt_diag288.c static void wdt_diag288_class_init(ObjectClass *klass, void *data) · line 127

Quoted 7 lines
hw/watchdog/wdt_diag288.c +1 -0
@@ -121,6 +121,7 @@ static void wdt_diag288_class_init(ObjectClass *klass, void *data)
     dc->realize = wdt_diag288_realize;
     dc->unrealize = wdt_diag288_unrealize;
     dc->reset = wdt_diag288_reset;
+    dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     dc->vmsd = &vmstate_diag288;
     diag288->handle_timer = wdt_diag288_handle_timer;
Signature · 3 lines
Thanks,

David
#5 lore raw

PATCH v2 3/3 s390x: wire up diag288 in tcg

In reply to Cornelia Huck

Make the diag288 watchdog useable via tcg as well.

---
 target/s390x/misc_helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/s390x/misc_helper.c +4 -0
index 5a1eba02ab..34d730ba73 100644
@@ -103,6 +103,10 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
         handle_diag_308(env, r1, r3);
         r = 0;
         break;
+    case 0x288:
+        /* time bomb (watchdog) */
+        r = handle_diag_288(env, r1, r3);
+        break;
     default:
         r = -1;
         break;
Signature · 1 line
2.13.5
Reviewed-by on v2 3/3
#6 lore raw

Re: [Qemu-devel] [PATCH v2 3/3] s390x: wire up diag288 in tcg

Quoted 12 lines · Cornelia Huck

Make the diag288 watchdog useable via tcg as well.

---
 target/s390x/misc_helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/s390x/misc_helper.c +0 -0
index 5a1eba02ab..34d730ba73 100644

target/s390x/misc_helper.c void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num) · line 112

Quoted 10 lines
target/s390x/misc_helper.c +4 -0
@@ -103,6 +103,10 @@ void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
         handle_diag_308(env, r1, r3);
         r = 0;
         break;
+    case 0x288:
+        /* time bomb (watchdog) */
+        r = handle_diag_288(env, r1, r3);
+        break;
     default:
         r = -1;
         break;
author Applied
#7 lore raw
In reply to Cornelia Huck
Quoted 8 lines · On Fri, 18 Aug 2017 13:48:41 +0200 Cornelia Huck <[email protected]> wrote:

...which are a fix in tcg for diag handling and diag288 watchdog changes.

v1->v2: just reorder patches for less churn [Thomas]

Cornelia Huck (2):
s390x/tcg: specification exception for unknown diag
s390x: wire up diag288 in tcg

Quoted 7 lines

Thomas Huth (1):
watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable

 hw/watchdog/wdt_diag288.c  | 1 +
 target/s390x/misc_helper.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Queued to s390-next.