Skip to contentSkip to conversation

s390x/tcg: initialize machine check queue

PATCH Applied Cornelia Huck 3 participants 4 messages Oct 4, 2017 – Oct 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390x/tcg: initialize machine check queue

Just as for external interrupts and I/O interrupts, we need to initialize mchk_index during cpu reset.

---

Trying a device_add with a ccw device under tcg currently insta-crashes qemu. Probably nobody ever tried the crw machine check support that I hacked in...

Needs more work to avoid a guest kernel panic next; but let's pick the low-hanging fruit first.

---
 target/s390x/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target/s390x/cpu.c +2 -0
index 4e1823a3e0..3fdf9bae70 100644
@@ -111,6 +111,7 @@ static void s390_cpu_initial_reset(CPUState *s)
     for (i = 0; i < ARRAY_SIZE(env->io_index); i++) {
         env->io_index[i] = -1;
     }
+    env->mchk_index = -1;
 
     /* tininess for underflow is detected before rounding */
     set_float_detect_tininess(float_tininess_before_rounding,
@@ -148,6 +149,7 @@ static void s390_cpu_full_reset(CPUState *s)
     for (i = 0; i < ARRAY_SIZE(env->io_index); i++) {
         env->io_index[i] = -1;
     }
+    env->mchk_index = -1;
 
     /* tininess for underflow is detected before rounding */
     set_float_detect_tininess(float_tininess_before_rounding,
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Cornelia Huck

Just as for external interrupts and I/O interrupts, we need to initialize mchk_index during cpu reset.

---

Trying a device_add with a ccw device under tcg currently insta-crashes qemu. Probably nobody ever tried the crw machine check support that I hacked in...

Quoted 6 lines

Needs more work to avoid a guest kernel panic next; but let's pick the low-hanging fruit first.

---
 target/s390x/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Cornelia Huck
Quoted 31 lines · Cornelia Huck

Just as for external interrupts and I/O interrupts, we need to initialize mchk_index during cpu reset.

---

Trying a device_add with a ccw device under tcg currently insta-crashes qemu. Probably nobody ever tried the crw machine check support that I hacked in...

Needs more work to avoid a guest kernel panic next; but let's pick the low-hanging fruit first.

---
 target/s390x/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target/s390x/cpu.c +1 -0
index 4e1823a3e0..3fdf9bae70 100644
@@ -111,6 +111,7 @@ static void s390_cpu_initial_reset(CPUState *s)
     for (i = 0; i < ARRAY_SIZE(env->io_index); i++) {
         env->io_index[i] = -1;
     }
+    env->mchk_index = -1;
 
     /* tininess for underflow is detected before rounding */
     set_float_detect_tininess(float_tininess_before_rounding,

target/s390x/cpu.c static void s390_cpu_full_reset(CPUState *s) · line 155

Quoted 7 lines
target/s390x/cpu.c +1 -0
@@ -148,6 +149,7 @@ static void s390_cpu_full_reset(CPUState *s)
     for (i = 0; i < ARRAY_SIZE(env->io_index); i++) {
         env->io_index[i] = -1;
     }
+    env->mchk_index = -1;
 
     /* tininess for underflow is detected before rounding */
     set_float_detect_tininess(float_tininess_before_rounding,

Makes sense.

PS: I wonder whether the common code of s390_cpu_initial_reset() and s390_cpu_full_reset() should be put into a separate function? Or maybe s390_cpu_full_reset() should call s390_cpu_initial_reset() ? At least the code duplication here looks like we should do some clean up here...

Thomas

author Applied
#3 lore raw
In reply to Cornelia Huck
Quoted 10 lines · On Wed, 4 Oct 2017 18:25:43 +0200 Cornelia Huck <[email protected]> wrote:

Just as for external interrupts and I/O interrupts, we need to initialize mchk_index during cpu reset.

---

Trying a device_add with a ccw device under tcg currently insta-crashes qemu. Probably nobody ever tried the crw machine check support that I hacked in...

Quoted 6 lines

Needs more work to avoid a guest kernel panic next; but let's pick the low-hanging fruit first.

---
 target/s390x/cpu.c | 2 ++
 1 file changed, 2 insertions(+)

Queued to s390-next.