[PATCH 0/2] libvhost-user: fix postcopy shared memory faults

Bin Guo posted 2 patches 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260813095501.20282-1-guobin@linux.alibaba.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>
subprojects/libvhost-user/libvhost-user.c | 34 ++++++++++++++---------
1 file changed, 21 insertions(+), 13 deletions(-)
[PATCH 0/2] libvhost-user: fix postcopy shared memory faults
Posted by Bin Guo 1 week, 6 days ago
These two independent bugs both sit on the libvhost-user postcopy path and
together make postcopy migration of a guest with a libvhost-user backend
fail.  They are only reachable when the backend negotiates
VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS, i.e. it adds memory regions one
by one with VHOST_USER_ADD_MEM_REG instead of VHOST_USER_SET_MEM_TABLE.

Patch 1 stops the backend from panicking on the "all postcopy client bases
received" ack, which QEMU sends as an fd-less VHOST_USER_ADD_MEM_REG.

Patch 2 makes the backend return its mapping address for a region added
that way, without which QEMU cannot translate the backend's fault
addresses back to a RAMBlock.

Reproduced and fixed with contrib/vhost-user-bridge as the net backend of
a postcopy migrated guest: before the series the destination backend
either panics or QEMU reports "Failed to find region for fault"; after it
the migration completes.

Bin Guo (2):
  libvhost-user: accept the postcopy client base ack in vu_add_mem_reg()
  libvhost-user: return the backend mapping address for added regions

 subprojects/libvhost-user/libvhost-user.c | 34 ++++++++++++++---------
 1 file changed, 21 insertions(+), 13 deletions(-)

-- 
2.50.1 (Apple Git-155)