hw/intc/s390_flic: Fix interrupt controller migration on s390x with TCG
authorThomas Huth <thuth@redhat.com>
Wed, 19 Jun 2024 14:44:21 +0000 (16:44 +0200)
committerThomas Huth <thuth@redhat.com>
Tue, 2 Jul 2024 06:02:01 +0000 (08:02 +0200)
commitc1991c0984243850faa267735db6f624f2aea06a
tree5b707fcfaca347ebaca4817b6c56214c2eff8d29
parentc80a339587fe4148292c260716482dd2f86d4476
hw/intc/s390_flic: Fix interrupt controller migration on s390x with TCG

Migration of a s390x guest with TCG was long known to be very unstable,
so the tests in tests/qtest/migration-test.c are disabled if running
with TCG instead of KVM.

Nicholas Piggin did a great analysis of the problem:

"The flic pending state is not migrated, so if the machine is migrated
 while an interrupt is pending, it can be lost. This shows up in
 qtest migration test, an extint is pending (due to console writes?)
 and the CPU waits via s390_cpu_set_psw and expects the interrupt to
 wake it. However when the flic pending state is lost, s390_cpu_has_int
 returns false, so s390_cpu_exec_interrupt falls through to halting
 again."

Thus let's finally migrate the pending state, and to be on the safe
side, also the other state variables of the QEMUS390FLICState structure.

Message-ID: <20240619144421.261342-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/intc/s390_flic.c
hw/s390x/s390-virtio-ccw.c
include/hw/s390x/s390_flic.h