On Tue, Aug 6, 2013 at 9:13 PM, Marc Zyngier <[email protected]> wrote:
> When fa7226f (kvm tools: init network devices only when the virtio
> driver is ready to go) was introduced, a tiny detail was overlooked:
>
> - Initialization of the uip layer is now coming in very late (only
>   when the guest driver says it is ready).
> - In parallel, the rx thread is created quite early (as soon as the
>   queues are allocated).
>
> This cause the rx thread to call uip_rx, which calls uip_buf_get_used,
> which starts to use buf_lock mutex/the buf_used_cond, which haven't
> been initialized yet. Tears and devastation follow, not to mention a
> certain lack of network connectivity for the unsuspecting guest.
>
> The (not so pretty) fix is to split uip_init:
> - uip_static_init: initialize the lists, mutexes and conditions,
>   called from virtio_net__init_one.
> - uip_init: perform the dynamic memory allocations, called from
>   notify_status.
>
> This allows the network to be safely initialized.
>
> Cc: Sasha Levin <[email protected]>
> Cc: Pekka Enberg <[email protected]>
> Cc: Will Deacon <[email protected]>
> Signed-off-by: Marc Zyngier <[email protected]>

Applied, thanks a lot!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to