From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jfreiman@redhat.com>
Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73])
 by dpdk.org (Postfix) with ESMTP id 653FA1B539;
 Fri,  3 Aug 2018 13:27:36 +0200 (CEST)
Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com
 [10.11.54.6])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.redhat.com (Postfix) with ESMTPS id 5A4A240216F7;
 Fri,  3 Aug 2018 11:27:35 +0000 (UTC)
Received: from localhost (dhcp-192-225.str.redhat.com [10.33.192.225])
 by smtp.corp.redhat.com (Postfix) with ESMTPS id C9C9F215670D;
 Fri,  3 Aug 2018 11:27:34 +0000 (UTC)
Date: Fri, 3 Aug 2018 13:27:33 +0200
From: Jens Freimann <jfreiman@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: tiwei.bie@intel.com, zhihong.wang@intel.com, dev@dpdk.org, stable@dpdk.org
Message-ID: <20180803112733.ukgxzxaxj7ght6j6@jenstp.localdomain>
References: <20180802172122.25923-1-maxime.coquelin@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline
In-Reply-To: <20180802172122.25923-1-maxime.coquelin@redhat.com>
User-Agent: NeoMutt/20180716
X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
 (mx1.redhat.com [10.11.55.5]); Fri, 03 Aug 2018 11:27:35 +0000 (UTC)
X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]);
 Fri, 03 Aug 2018 11:27:35 +0000 (UTC) for IP:'10.11.54.6'
 DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com'
 HELO:'smtp.corp.redhat.com' FROM:'jfreiman@redhat.com' RCPT:''
Subject: Re: [dpdk-dev] [PATCH v2] vhost: flush IOTLB cache on new mem table
	handling
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 03 Aug 2018 11:27:36 -0000

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: stable@dpdk.org
>
>Signed-off-by: Maxime Coquelin <maxime.coquelin@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 <jfreimann@redhat.com>