numam-dpdk/lib/librte_vhost
Jianfeng Tan cab278dee9 vhost: fix crash
In a running VM, operations (like device attach/detach) will
trigger the QEMU to resend set_mem_table to vhost-user backend.

DPDK vhost-user handles this message rudely by unmap all existing
regions and map new ones. This might lead to segfault if there
is pmd thread just trying to touch those unmapped memory regions.

But for most cases, except VM memory hotplug, QEMU still sends the
set_mem_table message even the memory regions are not changed as
QEMU vhost-user filters out those not backed by file (fd > 0).

To fix this case, we add a check in the handler to see if the
memory regions are really changed; if not, we just keep old memory
regions.

Fixes: 8f972312b8 ("vhost: support vhost-user")
CC: stable@dpdk.org

Reported-by: Yang Zhang <zy107165@alibaba-inc.com>
Reported-by: Xin Long <longxin.xl@alibaba-inc.com>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
2018-01-16 18:47:49 +01:00
..
fd_man.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
fd_man.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
iotlb.c vhost: fix IOTLB on NUMA realloc 2017-10-13 22:08:21 +02:00
iotlb.h vhost: add pending IOTLB miss request list and helpers 2017-10-10 15:52:27 +02:00
Makefile lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
rte_vhost_version.map vhost: support Rx queue count request 2017-06-16 14:04:25 +02:00
rte_vhost.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
socket.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
vhost_user.c vhost: fix crash 2018-01-16 18:47:49 +01:00
vhost_user.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
vhost.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
vhost.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
virtio_net.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00