Skip to content

libvhost-user: fix postcopy shared memory faults

Bin Guo qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2libvhost-user: accept the postcopy client base ack in vu_add_mem_reg()subprojects/libvhost-user/libvhost-user.c+14 -120 replies
2/2libvhost-user: return the backend mapping address for added regionssubprojects/libvhost-user/libvhost-user.c+7 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)
Signature · 1 line
2.50.1 (Apple Git-155)