On Thu, Aug 02, 2018 at 07:21:22PM +0200, Maxime Coquelin wrote:
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: sta...@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com>
---
Changes since v1:
- Fix indentation (Stephen)
- Fix double iotlb-lock lock
lib/librte_vhost/iotlb.c | 10 ++++++++--
lib/librte_vhost/iotlb.h | 2 +-
lib/librte_vhost/vhost_user.c | 5 +++++
3 files changed, 14 insertions(+), 3 deletions(-)
Reviewed-by: Jens Freimann <jfreim...@redhat.com>