qemu-patch-raspberry4/hw
David Gibson db12451dec Fix for crash after migration in virtio-rng on bi-endian targets
VirtIO devices now remember which endianness they're operating in in order
to support targets which may have guests of either endianness, such as
powerpc.  This endianness state is transferred in a subsection of the
virtio device's information.

With virtio-rng this can lead to an abort after a loadvm hitting the
assert() in virtio_is_big_endian().  This can be reproduced by doing a
migrate and load from file on a bi-endian target with a virtio-rng device.
The actual guest state isn't particularly important to triggering this.

The cause is that virtio_rng_load_device() calls virtio_rng_process() which
accesses the ring and thus needs the endianness.  However,
virtio_rng_process() is called via virtio_load() before it loads the
subsections.  Essentially the ->load callback in VirtioDeviceClass should
only be used for actually reading the device state from the stream, not for
post-load re-initialization.

This patch fixes the bug by moving the virtio_rng_process() after the call
to virtio_load().  Better yet would be to convert virtio to use vmsd and
have the virtio_rng_process() as a post_load callback, but that's a bigger
project for another day.

This is bugfix, and should be considered for the 2.2 branch.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Message-id: 1417067290-20715-1-git-send-email-david@gibson.dropbear.id.au
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-28 13:06:00 +00:00
..
9pfs virtio-9p-proxy: improve error messages in connect_namedsocket() 2014-11-02 10:04:34 +03:00
acpi pc: piix4_pm: init legacy PCI hotplug when running on Xen 2014-11-14 11:11:44 +00:00
alpha ide: Update ide_drive_get to be HBA agnostic 2014-10-03 10:30:33 +01:00
arm hw/arm/virt: set stdout-path instead of linux,stdout-path 2014-11-20 14:58:37 +00:00
audio ac97: register reset via qom 2014-09-29 10:20:05 +02:00
block A smattering of fixes for problems that Coverity reported. 2014-11-17 17:22:03 +00:00
bt l2cap: fix access to freed memory 2014-08-15 19:12:48 +04:00
char Several bugfixes for s390x: 2014-11-10 14:58:59 +00:00
core hmp: fix regression of HMP device_del auto-completion 2014-11-27 14:36:20 +00:00
cpu icc_bus: fix typo ICC_BRIGDE -> ICC_BRIDGE 2014-11-03 19:51:56 +03:00
cris hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
display vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect 2014-10-29 12:01:30 +01:00
dma hw/dma/i8257: Silence phony error message 2014-09-16 12:35:02 +02:00
gpio PPC: Add MPC8XXX gpio controller 2014-11-04 23:26:12 +01:00
i2c Fix debug print warning 2014-09-02 22:38:16 +04:00
i386 -machine vmport=auto: Fix handling of VMWare ioport emulation for xen 2014-11-26 12:11:27 +01:00
ide hw/ide/core.c: Prevent SIGSEGV during migration 2014-11-18 17:36:14 +00:00
input hw/input/tsc210x.c: Delete unused array tsc2101_rates 2014-09-29 18:48:48 +01:00
intc apic: fix incorrect handling of ExtINT interrupts wrt processor priority 2014-11-24 14:37:45 +01:00
ipack memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
isa hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
lm32 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
m68k hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
mem pc: pc-dimm: use backend alignment during address auto allocation 2014-11-23 12:12:46 +02:00
microblaze hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
mips mips_mipssim: fix use-after-free for filename 2014-11-17 11:41:03 +01:00
misc ivshmem: use error_report 2014-10-31 17:02:22 +01:00
moxie memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
net virtio-net: fix unmap leak 2014-11-28 10:29:20 +00:00
nvram fw_cfg: fix boot order bug when dynamically modified via QOM 2014-11-26 12:11:27 +01:00
openrisc hw/core/loader: implement address translation in uimage loader 2014-11-03 00:59:10 +03:00
pci pcie: fix improper use of negative value 2014-11-24 20:57:11 +02:00
pci-bridge qdev: HotplugHandler: Rename unplug callback to unplug_request 2014-10-15 05:03:13 +02:00
pci-host - Memory: improve error reporting and avoid crashes on hotplug 2014-09-12 16:55:49 +01:00
pcmcia hmp: Remove "info pcmcia" 2014-10-24 12:19:11 +01:00
ppc spapr: Allow dynamic creation of PHB 2014-11-04 23:26:15 +01:00
s390x virtio: link the rng backend through an alias property 2014-10-30 12:59:27 +00:00
scsi virtio-scsi: dataplane: suppress guest notification 2014-11-12 11:19:19 +01:00
sd hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sh4 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sparc hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sparc64 hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
ssi ssi: xilinx_spi: Initialise CS GPIOs as NULL 2014-08-15 18:54:40 +04:00
timer mc146818rtc: add missed field to vmstate 2014-09-11 12:20:32 +02:00
tpm hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
tricore target-tricore: check return value before using it 2014-11-02 10:04:34 +03:00
unicore32 memory: add parameter errp to memory_region_init_ram 2014-09-09 13:41:43 +02:00
usb hcd-musb: fix dereference null return value 2014-11-17 18:02:31 +01:00
virtio Fix for crash after migration in virtio-rng on bi-endian targets 2014-11-28 13:06:00 +00:00
watchdog memory: remove memory_region_destroy 2014-08-18 12:06:21 +02:00
xen hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
xenpv hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
xtensa hw/xtensa/xtfpga: treat uImage load address as virtual 2014-11-03 01:00:37 +03:00
Makefile.objs pc: implement pc-dimm device abstraction 2014-06-19 16:41:47 +03:00