On 25/6/26 23:19, Marc-André Lureau wrote:
Reviewed-by: Eric Farman <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
  hw/s390x/s390-virtio-ccw.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 25a9fa49554..d0fd894eb67 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -729,6 +729,11 @@ static void s390_nmi(NMIState *n, int cpu_index, Error 
**errp)
  {
      CPUState *cs = qemu_get_cpu(cpu_index);
+ if (!cs) {
+        error_setg(errp, "CPU %d does not exist", cpu_index);
+        return;
+    }
+
      s390_cpu_restart(S390_CPU(cs));

Looking at commit 6af94767daf ("ipmi: Fix watchdog NMI handling"),
I suppose we can trigger this crash with IPMI on s390x target, is
that right?

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

  }


Reply via email to