net/virtio-user: fix deadlock in memory events callback
authorTiwei Bie <tiwei.bie@intel.com>
Wed, 5 Sep 2018 04:28:50 +0000 (12:28 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 27 Sep 2018 23:41:01 +0000 (01:41 +0200)
commit7ff269575bd144482d56a20fec61187f1af15dda
treea79598cd4985d315338559a84cde5c3f99845bab
parentad4d092be76da90c44883f8ff8d45560c2a5dee3
net/virtio-user: fix deadlock in memory events callback

Deadlock can occur when allocating memory if a vhost-kernel
based virtio-user device is in use. To fix the deadlock,
we will take memory hotplug lock explicitly in virtio-user
when necessary, and always call the _thread_unsafe memory
functions.

Bugzilla ID: 81
Fixes: 12ecb2f63b12 ("net/virtio-user: support memory hotplug")
Cc: stable@dpdk.org
Reported-by: Seán Harte <seanbh@gmail.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Tested-by: Seán Harte <seanbh@gmail.com>
Reviewed-by: Seán Harte <seanbh@gmail.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_user/vhost_kernel.c
drivers/net/virtio/virtio_user/virtio_user_dev.c