qemu-patch-raspberry4/hw/char
Paolo Bonzini 4e02b0fcf5 serial: reset thri_pending on IER writes with THRI=0
This is responsible for failure of migration from 2.2 to 2.1, because
thr_ipending is always one in practice.

serial.c is setting thr_ipending unconditionally.  However, thr_ipending
is not used at all if THRI=0, and it will be overwritten again the next
time THRE or THRI changes.  For that reason, we can set thr_ipending to
zero every time THRI is reset.

There is disagreement on whether LSR.THRE should be resampled when IER.THRI
goes from 1 to 1.  This patch does not touch the code, leaving that for
QEMU 2.3+.

This has no semantic change and is enough to fix migration in the common
case where the interrupt is not pending or is reported in IIR.  It does not
change the migration format, so 2.2.0 -> 2.1 will remain broken but we
can fix 2.2.1 -> 2.1 without breaking 2.2.1 <-> 2.2.0.

The case that remains broken (the one in which the subsection is strictly
necessary) is when THRE=1, the THRI interrupt has *not* been acknowledged
yet, and a higher-priority interrupt comes.  In this case, you need the
subsection to tell the source that the lower-priority THRI interrupt is
pending.  The subsection's breakage of migration, in this case, prevents
continuing the VM on the destination with an invalid state.

Cc: qemu-stable@nongnu.org
Reported-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-12-15 14:35:53 +01:00
..
cadence_uart.c cadence_uart: check for serial backend before using it. 2014-07-17 16:36:17 +01:00
debugcon.c qdev: Remove hex8/32/64 property types 2014-02-14 21:12:04 +01:00
digic-uart.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
escc.c savevm: Remove all the unneeded version_minimum_id_old (ppc) 2014-06-16 04:55:26 +02:00
etraxfs_ser.c etraxfs_ser: QOM cast cleanups 2013-07-29 20:45:33 +02:00
exynos4210_uart.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
grlib_apbuart.c grlib_apbuart: QOM cast cleanup 2013-07-29 21:06:27 +02:00
imx_serial.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
ipoctal232.c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
lm32_juart.c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
lm32_uart.c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
Makefile.objs ipack: Move IndustryPack out of hw/char/ 2014-02-14 21:11:53 +01:00
mcf_uart.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
milkymist-uart.c savevm: Remove all the unneeded version_minimum_id_old (rest) 2014-05-14 15:24:51 +02:00
omap_uart.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
parallel.c parallel: adding vmstate for save/restore 2014-09-11 12:20:32 +02:00
pl011.c savevm: Remove all the unneeded version_minimum_id_old (arm) 2014-05-13 16:09:35 +01:00
sclpconsole-lm.c s390x/sclpconsole-lm: Fix hanging SCLP line mode console 2014-11-05 16:35:56 +01:00
sclpconsole.c s390x/sclpconsole: Avoid hanging SCLP ASCII console 2014-11-05 16:35:56 +01:00
serial-isa.c qdev: Remove hex8/32/64 property types 2014-02-14 21:12:04 +01:00
serial-pci.c memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
serial.c serial: reset thri_pending on IER writes with THRI=0 2014-12-15 14:35:53 +01:00
sh_serial.c sh4: Fix serial line access for Linux kernels later than 3.2 2013-10-02 22:55:28 +04:00
spapr_vty.c savevm: Remove all the unneeded version_minimum_id_old (ppc) 2014-06-16 04:55:26 +02:00
virtio-console.c serial: poll the serial console with G_IO_HUP 2014-06-30 15:04:34 +02:00
virtio-serial-bus.c virtio-serial: avoid crash when port has no name 2014-11-07 10:27:11 +05:30
xen_console.c sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
xilinx_uartlite.c char: xilinx_uartlite: Convert to realize() 2014-06-09 00:33:03 +02:00