Bug 1040482

Summary: system_reset windows guest with cause qemu-kvm Segmentation fault after unhotplug gpu device
Product: Red Hat Enterprise Linux 7 Reporter: FuXiangChun <xfu>
Component: qemu-kvmAssignee: Alex Williamson <alex.williamson>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, hhuang, juzhang, michen, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-27 13:53:35 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:

Description FuXiangChun 2013-12-11 13:58:48 UTC
Description of problem:
Boot guest with a gpu device, unhotplug gpu device from monitor via device_del command. then system_reset guest.  qemu-kvm Segmentation fault.

Version-Release number of selected component (if applicable):
# uname -r
3.10.0-54.0.1.el7.x86_64
qemu-kvm-1.5.3-19.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1./usr/libexec/qemu-kvm -M pc -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -usb -device usb-tablet,id=input0 -name gpu -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -drive file=/root/win2012-64-new,if=none,id=drive-virtio-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop -device ide-drive,drive=drive-virtio-disk,id=virtio-disk,bootindex=1  -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on  -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -monitor stdio -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0,id=sr0  -device vfio-pci,host=06:00.0,id=GPU-k1,addr=06.0

2.(qemu) device_del GPU-k1

3.(qemu) system_reset

Actual results:
qemu-kvm Segmentation fault 

(qemu) 
Program received signal SIGSEGV, Segmentation fault.
0x000055555672d380 in ?? ()
(gdb) bt
#0  0x000055555672d380 in ?? ()
#1  0x000055555576685d in qemu_system_reset ()
#2  0x00005555555ff6c4 in main ()

Expected results:
reboot successfully

Additional info:
win2008r2 guest has the same issue

Comment 1 Alex Williamson 2013-12-23 20:05:40 UTC
Works for me.  Was this bz generated by the system with the misconfigured GRID card without aux power installed?  Please retest.  I'm using:

3.10.0-64.el7.x86_64
qemu-kvm-1.5.3-30.el7.x86_64

Comment 2 FuXiangChun 2013-12-24 15:25:53 UTC
Tested the latest driver version with NVIDIA-GRID-vGPU-331.30-332.07-win-64.zip
QE is using:
Guest win2012-64
3.10.0-64.el7.x86_64
qemu-kvm-1.5.3-30.el7.x86_64

result: still got the same result as comment0

additional:
when I try to use the Nvidia control panel I got back the message : NVIDIA Control Panel application, 7.5.800.0 has stopped

Comment 3 Alex Williamson 2014-02-25 04:56:50 UTC
(In reply to FuXiangChun from comment #2)
> Tested the latest driver version with
> NVIDIA-GRID-vGPU-331.30-332.07-win-64.zip

You're using the wrong driver.  We do not support the vGPU GRID driver, only the standard GRID driver.  The file should be named something like:

332.50-quadro-tesla-grid-winserv2008-2008r2-2012-64bit-international-whql.exe

Please re-test with the correct guest driver.

Comment 4 Alex Williamson 2014-02-25 05:27:31 UTC
Also, are you actually attempting to install the host rpm component of the vGPU driver?  Using the wrong guest driver, I see the Nvidia control panel error, but I still do not see a segfault with the device_del, system_reset combination.

Comment 5 FuXiangChun 2014-02-27 08:23:38 UTC
Sorry,reply this bug so late. I re-tested this bug with correct VGPU GRID driver inside guest.  This problem is gone. I tested 3 times as comment0. qemu-kvm and guest work well.  
driver version is 331.65-quadro-tesla-grid-winserv2008-2008r2-2012-64-international-whql.exe.