Bug 803639

Summary: Guest resumes automatically from S3 with VF or PF attached instead of waiting for a wakeup action
Product: Red Hat Enterprise Linux 7 Reporter: Qunfang Zhang <qzhang>
Component: qemu-kvmAssignee: Hai Huang <hhuang>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, alex.williamson, amit.shah, areis, bsarathy, chayang, hhuang, juzhang, michen, mkenneth, qiguo, shuang, tburke, virt-maint, xuhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 13:22:13 UTC Type: ---
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:    
Bug Blocks: 761491, 923626    

Description Qunfang Zhang 2012-03-15 10:33:42 UTC
Description of problem:
Attach a host NIC device to guest (VF or PF), and then suspend guest to mem. Guest will resume automatically instead of waiting for a wakeup action.
(I did not use kvmclock and virtio devices as there's existing S3 bug related kvmclock and virtio Bug 803132 and Bug 803187.)

Version-Release number of selected component (if applicable):
Host:
kernel-2.6.32-251.el6.x86_64
qemu-kvm-0.12.1.2-2.246.el6.x86_64
seabios-0.6.1.2-12.enableS3S4.v1.el6.x86_64 (Amit provides in https://bugzilla.redhat.com/show_bug.cgi?id=761586#c7)

Guest:
kernel-2.6.32-251.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Unbind a physical nic device from host (VF or PF)
# echo "8086 10c9" > /sys/bus/pci/drivers/pci-stub/new_id
# echo 0000:03:00.1 > /sys/bus/pci/devices/0000\:03\:00.1/driver/unbind 
# echo 0000:03:00.1 > /sys/bus/pci/drivers/pci-stub/bind

2.Boot guest with the physical NIC device attached or hot plug it after boot
/usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Nehalem,-kvmclock -enable-kvm -m 4G -smp 2,sockets=1,cores=2,threads=1 -name rhel6.3 -uuid 4c84db67-faf8-4498-9829-19a3d6431d9d -rtc base=localtime,driftfix=slew -drive file=/home/rhel6.3-64-virtio-backup.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device ide-drive,bus=ide.0,unit=1,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=net0,mac=00:1a:2a:42:10:66,bus=pci.0,addr=0x3 -usb -boot c -monitor stdio  -drive if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0  -qmp tcp:0:4445,server,nowait -vnc :10 -chardev socket,id=charserial0,path=/tmp/qzhang-isa,server,nowait -device isa-serial,chardev=charserial0,id=serial0 -qmp tcp:0:4444,server,nowait -device pci-assign,host=03:00.1,id=hostne1

3. Suspend guest to mem
#pm-suspend

4. Hotplug the physical device and suspend to mem again.

  
Actual results:
Step3: Guest will resume automatically instead of waiting for a wakeup action.
Step4: Guest waits for the wakeup after suspend.

Expected results:
Guest should always wait for the wakeup instead of wakeup automatically itself.

Additional info:

Comment 2 Dor Laor 2012-03-18 10:36:35 UTC
This is the desired + planned behavior in 6.3 because we didn't have the time to go through the full d3 state of the device. We're planning to enable it in the future. Moving to 6.4

Comment 10 Hai Huang 2013-06-28 11:18:56 UTC
QE folks, please proceed with re-testing this BZ using RHEL7 with 
VFIO device assignment.

Comment 12 Xu Han 2013-10-31 10:17:25 UTC
Test on RHEL7 host with RHEL7 guest.

kernel-3.10.0-40.el7.x86_64
qemu-kvm-rhev-1.5.3-10.el7.x86_64

After S3, guest not resume automatically, but hit bug 1025213 with PF, hit bug 1025243 with VF.

Comment 15 Ludek Smid 2014-06-13 13:22:13 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.