Bug 1818739

Summary: qemu core dump after hot-unplugging the XXV710/XL710 PF [rhel-8.1.1]
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Oneata Mircea Teodor <toneata>
Component: qemu-kvmAssignee: Peter Xu <peterx>
qemu-kvm sub component: General QA Contact: Yanghang Liu <yanghliu>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: chayang, ddepaula, ehabkost, jinzhao, jiyan, jraju, juzhang, knoel, lcapitulino, micai, mkalinin, mtessun, oblaut, peterx, pezhang, virt-maint, yanghliu
Version: 8.2Keywords: Regression, ZStream
Target Milestone: rc   
Target Release: 8.2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-4.1.0-23.module+el8.1.1+6238+f5d69f68.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1782678 Environment:
Last Closed: 2020-04-22 12:36:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1782678    
Bug Blocks: 1780417, 1811267    

Comment 7 Yanghang Liu 2020-04-07 07:05:28 UTC
Verification:
host:
qemu-kvm-4.1.0-23.module+el8.1.1+6238+f5d69f68.3.x86_64
4.18.0-147.el8.x86_64

guest:
4.18.0-147.10.1.el8_1.x86_64
4.18.0-147.el8.x86_64

Steps:
(1)start a guest with XL710 PF
/usr/libexec/qemu-kvm -name rhel81 -M q35 -enable-kvm \
-monitor stdio \
-nodefaults \
-m 4G \
-boot menu=on \
-cpu Haswell-noTSX-IBRS \
-device pcie-root-port,id=root.1,chassis=1,addr=0x2.0,multifunction=on \
-device pcie-root-port,id=root.2,chassis=2,addr=0x2.1 \
-device pcie-root-port,id=root.3,chassis=3,addr=0x2.2 \
-device pcie-root-port,id=root.4,chassis=4,addr=0x2.3 \
-device pcie-root-port,id=root.5,chassis=5,addr=0x2.4 \
-device pcie-root-port,id=root.6,chassis=6,addr=0x2.5 \
-device pcie-root-port,id=root.7,chassis=7,addr=0x2.6 \
-device pcie-root-port,id=root.8,chassis=8,addr=0x2.7 \
-smp 2,sockets=1,cores=2,threads=2,maxcpus=4 \
-qmp tcp:0:6666,server,nowait \
-blockdev node-name=back_image,driver=file,cache.direct=on,cache.no-flush=off,filename=/home/images/rhel81_q35.qcow2,aio=threads \
-blockdev node-name=drive-virtio-disk0,driver=qcow2,cache.direct=on,cache.no-flush=off,file=back_image \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=disk0,bus=root.1 \
-device VGA,id=video1,bus=root.2  \
-vnc :0 \
-device virtio-net-pci,netdev=nic1,id=vnet0,mac=54:43:00:1a:11:33,bus=root.3 \
-netdev tap,id=nic1,script=/etc/qemu-ifup,vhost=on \
-device vfio-pci,host=0000:87:00.0,bus=root.4,id=pf1 \

(2)hot unplug the XL710 PF from RHEL82 guest and check the qmp output 
QMP: {"execute":"device_del","arguments":{"id":"pf1"}}

output:
{"return": {}}
{"timestamp": {"seconds": 1586241071, "microseconds": 852837}, "event": "DEVICE_DELETED", "data": {"device": "pf1", "path": "/machine/peripheral/pf1"}}


(3)Check device status with "info pci" on host and check device status with "lspci" in guest 
The XL710 PF has been hot-unplug from guest successfully.


(4)check the dmesg in guest
# dmesg
[   97.476276] pciehp 0000:00:02.3:pcie004: Slot(0-3): Attention button pressed
[   97.484643] pciehp 0000:00:02.3:pcie004: Slot(0-3): Powering off due to button press
[  102.614017] i40e 0000:04:00.0: i40e_ptp_stop: removed PHC on eth1


(5)reboot the RHEL81 guest.
The guest works well.


This bug can be reproduced on qemu-kvm-4.1.0-23.module+el8.1.1+5938+f5e53076.2.x86_64(unfixed qemu-kvm version)


According to the test result,this bug has been fixed well.
Move the bug status to VERIFIED.

Comment 8 Lee Yarwood 2020-04-17 14:33:37 UTC
*** Bug 1811267 has been marked as a duplicate of this bug. ***

Comment 10 errata-xmlrpc 2020-04-22 12:36:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1537