[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix for crash after migration in virtio-rng on
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [PATCH] Fix for crash after migration in virtio-rng on bi-endian targets |
Date: |
Fri, 28 Nov 2014 22:30:40 +1100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, Nov 28, 2014 at 09:14:46AM +0000, Peter Maydell wrote:
> On 27 November 2014 at 09:26, Markus Armbruster <address@hidden> wrote:
> > David Gibson <address@hidden> writes:
> >
> >> 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.
> >
> > "[PATCH for-2.2]" would have been a good idea then. Next time :)
>
> So do you want this patch in 2.2? I was planning to put in the
> virtio-vs-xen fixes today and tag rc4, so it's not too late if you're
> confident this patch is good. Let me know if you think it should go in,
> and I can apply it to master directly.
Yes, I think it should be applied.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
pgpaR6DIAAcFy.pgp
Description: PGP signature