Bug 2148399

Summary: [QSD] get vhost_set_mem_table error when install windows os on vhost-user-blk-pci device
Product: Red Hat Enterprise Linux 9 Reporter: qing.wang <qinwang>
Component: qemu-kvmAssignee: Kevin Wolf <kwolf>
qemu-kvm sub component: Storage QA Contact: qing.wang <qinwang>
Status: NEW --- Docs Contact:
Severity: high    
Priority: medium CC: coli, jinzhao, juzhang, kwolf, lijin, menli, qizhu, qzhang, vgoyal, virt-maint, xuwei, zhenyzha
Version: 9.2Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description qing.wang 2022-11-25 11:04:19 UTC
Description of problem:
It get following error when install windows guest on vhost-user-blk-pci device

(qemu) qemu-storage-daemon: vu_panic: remapping queue 0 for new memory region
qemu-kvm: Unexpected end-of-file before all data were read
qemu-kvm: Failed to read msg header. Read 0 instead of 12. Original request 0.
qemu-kvm: vhost_set_mem_table failed: Interrupted system call (4)
qemu-kvm: Failed to set msg fds.
qemu-kvm: vhost VQ 0 ring restore failed: -1: Transport endpoint is not connected (107)


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux release 9.2 Beta (Plow)
5.14.0-191.el9.x86_64
qemu-kvm-7.1.0-5.el9.x86_64
seabios-bin-1.16.0-4.el9.noarch

(Many qemu find same issue , it look likes irrelevant with qemu)

How reproducible:
100%

Steps to Reproduce:
1. Boot QSD
qemu-storage-daemon \
  --chardev socket,path=/tmp/qmp3.sock,server=on,wait=off,id=char1 \
  --monitor chardev=char1 \
  --blockdev driver=file,node-name=file1,filename=$f1 \
  --blockdev driver=raw,node-name=fmt1,file=file1 \
  --export type=vhost-user-blk,id=export1,addr.type=unix,addr.path=/tmp/vhost-user-blk4-2.sock,node-name=fmt1,writable=on,logical-block-size=512,num-queues=1 &

2. Boot VM with vhost-user-blk-pci device and windows iso file
/usr/libexec/qemu-kvm -enable-kvm \
  -m 4G -M q35,memory-backend=mem \
  -smp 4,maxcpus=4,cores=2,threads=1,dies=1,sockets=2  \
  -cpu 'host',hv_stimer,hv_synic,hv_vpindex,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time,hv_frequencies,hv_runtime,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,+kvm_pv_unhalt \
  -object memory-backend-memfd,id=mem,size=4G,share=on \
  -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x3,chassis=1 \
  -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x3.0x1,bus=pcie.0,chassis=2 \
  -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x3.0x2,bus=pcie.0,chassis=3 \
  -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x3.0x3,bus=pcie.0,chassis=4 \
  -device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x3.0x4,bus=pcie.0,chassis=5 \
  -device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x3.0x5,bus=pcie.0,chassis=6 \
  -device pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x3.0x6,bus=pcie.0,chassis=7 \
  -device pcie-root-port,id=pcie-root-port-7,port=0x7,addr=0x3.0x7,bus=pcie.0,chassis=8 \
  -device qemu-xhci,id=usb1,bus=pcie-root-port-1,addr=0x0 \
  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
  \
  -chardev socket,path=/tmp/vhost-user-blk4-2.sock,id=vhost0 \
  -device vhost-user-blk-pci,chardev=vhost0,id=blk0,num-queues=1,bootindex=0 \
  \
  -vnc :4 \
  -monitor stdio \
  -qmp tcp:0:5954,server,nowait \
  -blockdev node-name=file_cd1,driver=file,read-only=on,aio=threads,filename=/home/kvm_autotest_root/iso/ISO/Win2019/en_windows_server_2019_updated_may_2020_x64_dvd_5651846f.iso,cache.direct=on,cache.no-flush=off \
  -blockdev node-name=drive_cd1,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd1 \
  -device ide-cd,id=cd1,drive=drive_cd1,bus=ide.0,unit=0 \
  -blockdev node-name=file_cd2,driver=file,read-only=on,aio=threads,filename=/home/kvm_autotest_root/iso/windows/virtio-win-prewhql-0.1-215.iso,cache.direct=on,cache.no-flush=off \
  -blockdev node-name=drive_cd2,driver=raw,read-only=on,cache.direct=on,cache.no-flush=off,file=file_cd2 \
  -device ide-cd,id=cd2,drive=drive_cd2,bus=ide.1,unit=0 \
  -boot menu=off,order=cdn,once=d,strict=off \

3.wait 30s to load CD iso file


Actual results:
Find error to make installation failed

Expected results:
The install procedure should succeed

Additional info:
1.no issue install Linux 
example: /home/kvm_autotest_root/iso/linux/RHEL7.7-Server-x86_64.iso

2.error msg may disappear after change CPU cmd line to:
-cpu 'host',hv_stimer,hv_synic,hv_vpindex,hv_time,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_frequencies,hv_tlbflush,hv_reenlightenment,hv_stimer_direct,hv_ipi,+kvm_pv_unhalt \
(remove hv_runtime flag)
or
-cpu host
(no additional flag)

Comment 1 qing.wang 2022-11-29 01:14:55 UTC
*** Bug 2148398 has been marked as a duplicate of this bug. ***