vhost: flush IOTLB cache on new mem table handling
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Thu, 2 Aug 2018 17:21:22 +0000 (19:21 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 4 Aug 2018 23:47:47 +0000 (01:47 +0200)
commitaf53db486792f3d864c9a30dc13ee12402994640
tree936c68efdc7770ff3aa2d5f1c9211e39bb8c0ac5
parent5a401fb85efba013cdd3c451e8293c1aa39c9d09
vhost: flush IOTLB cache on new mem table handling

IOTLB entries contain the host virtual address of the guest
pages. When receiving a new VHOST_USER_SET_MEM_TABLE request,
the previous regions get unmapped, so the IOTLB entries, if any,
will be invalid. It does cause the vhost-user process to
segfault.

This patch introduces a new function to flush the IOTLB cache,
and call it as soon as the backend handles a VHOST_USER_SET_MEM
request.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
lib/librte_vhost/iotlb.c
lib/librte_vhost/iotlb.h
lib/librte_vhost/vhost_user.c