Hi Maxime,

On 11/28/2017 6:06 PM, Maxime Coquelin wrote:

On 11/24/2017 07:08 PM, Maxime Coquelin wrote:
When performing live-migration with multiple queue pairs,
VHOST_USER_SET_LOG_BASE request is sent multiple times.

If packets are being processed by the PMD threads, it is
possible that they are setting bits in the dirty log map while
its region is being unmapped by the vhost-user protocol thread.
It results in the following crash:
Thread 3 "lcore-slave-2" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f71ca495700 (LWP 32451)]
0x00000000004bfc8a in vhost_set_bit (addr=0x7f71cbe18432 <error: Cannot access memory at address 0x7f71cbe18432>, nr=1) at /home/max/projects/src/mainline/dpdk/lib/librte_vhost/vhost.h:267
267        __sync_fetch_and_or_8(addr, (1U << nr));

We can see the vhost-user protocol thread just did the unmap of the
dirty log region when it happens.

This patch prevents this by introducing a RW lock to protect
the log base.

Fixes: 54f9e32305d4 ("vhost: handle dirty pages logging request")
Cc: sta...@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com>
  lib/librte_vhost/vhost.c      |  2 ++
  lib/librte_vhost/vhost.h      | 14 +++++++++++---
  lib/librte_vhost/vhost_user.c |  4 ++++
  3 files changed, 17 insertions(+), 3 deletions(-)

By clarifying the vhost-user spec, we may be able to avoid this lock and
just ignore the subsequent SET_LOG_BASE requests once
VHOST_F_LOG_ALL feature bit is set.

So let's just discard this series for now.

I would assume this issue has been addressed by the per-queue lock patch from Victor, correct?

Besides, we really don't need multiple unmap/map for each vq. Would you think this shall be fixed in QEMU?


Reply via email to