Bug 770689

Summary: kvm hugepage don't support spice connection for windows(raw format) guest
Product: Red Hat Enterprise Linux 5 Reporter: FuXiangChun <xfu>
Component: kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8CC: aarcange, alevy, bcao, dblechte, juzhang, kraxel, kwolf, michen, mkenneth, qzhang, rhod, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-05 22:27:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Intel platform trace file
none
qemu exiting message
none
spice debug option message
none
the newest spice debug option none

Description FuXiangChun 2011-12-28 10:58:57 UTC
Description of problem:
Guest show black screen when booting win2008r2(raw format) guest with hugepage and use spicec client to connect to guest. if I use vnc to connect guest, it can boot successfully, Win7 guest hang during booting.

1.below are testing scenarios of AMD platform:
guest       disk-image-format   connection   memory    result

win2008r2   raw                 spice       hugepage    black screen
win2008r2   qcow2               spice       hugepage    normal
win2008r2   raw                 vnc         hugepage    normal
win7        raw                 spice       hugepage    hang
win7        qcow2               spice       hugepage    normal
win7        raw                 vnc         hugepage    normal

2.below are testing scenarios of Intel platform:

  guest       disk-image-format   connection   memory       result
  win7        raw                 spice       hugepageqemu  exited

Version-Release number of selected component (if applicable):
# uname -r
2.6.18-302.el5
# rpm -qa|grep kvm
kvm-83-246.el5

How reproducible:
always

Steps to Reproduce:
1.mount -t hugetlbfs none /mnt/kvm_hugepage

2.echo 2048 > /proc/sys/vm/nr_hugepages 

3./usr/libexec/qemu-kvm  -M rhel5.6.0 -m 2048 -mem-path /home/kvm_hugepage -smp 4,cores=2,threads=1,sockets=2 -cpu qemu64,+sse2,-flag=nx -soundhw all -name rhel6 -usbdevice tablet -rtc-td-hack -uuid 123465d2-2032-848d-bda0-de7adb149048 -boot c -drive file=/home/win2008r2-64.raw,if=ide,boot=on,bus=0,unit=0,format=raw,cache=none,boot=on,werror=stop -net nic,macaddr=54:52:00:27:12:23,vlan=0,model=rtl8139 -net tap,vlan=0,script=/etc/qemu-ifup -serial pty -parallel none -usb -balloon none -monitor stdio -spice host=0,ic=on,port=5912,disable-ticketing -qxl 1

4.# cat /proc/meminfo | grep -i huge
HugePages_Total:  2048
HugePages_Free:   1016
HugePages_Rsvd:     35
Hugepagesize:     2048 kB

5.spicec -h hostip -p 5912

  
Actual results:
AMD platform:guest show black screen
Intel platform: qemu exited 

Expected results:
guest boot successful

Additional info:

Comment 1 FuXiangChun 2011-12-28 11:01:15 UTC
Created attachment 549810 [details]
Intel platform trace file

Comment 2 Ronen Hod 2011-12-29 17:01:53 UTC
2048 looks like a large number of huge-pages.
Can you please try smaller numbers. Specifically, 1050 is interesting since it should leave some free huge pages.

Comment 3 FuXiangChun 2011-12-30 02:43:38 UTC
(In reply to comment #2)
> 2048 looks like a large number of huge-pages.
> Can you please try smaller numbers. Specifically, 1050 is interesting since it
> should leave some free huge pages.

I tested 1050 huge-pages, still can reproduce this bug. 

1)# cat /proc/meminfo|grep -i hugepage
HugePages_Total:  1050
HugePages_Free:   1050
HugePages_Rsvd:      0
Hugepagesize:     2048 kB

2)/usr/libexec/qemu-kvm  -M rhel5.6.0 -m 1024 -mem-path /home/kvm_hugepage -smp 4,cores=2,threads=1,sockets=2 -cpu qemu64,vendor="AuthenticAMD",+sse2 -soundhw all -name windows -usbdevice tablet -rtc-td-hack -uuid 123465d2-2032-848d-bda0-de7adb149048 -boot c -drive file=/home/win2008r2-sp1-4.raw,if=ide,boot=on,bus=0,unit=0,format=raw,cache=none,boot=on,werror=stop -drive file=/home/iometer.qcow2,if=ide,bus=1,unit=1,format=qcow2,cache=none,werror=stop -net nic,macaddr=54:52:00:27:12:33,vlan=0,model=rtl8139 -net tap,vlan=0,script=/etc/qemu-ifup -serial pty -parallel none -usb -balloon none -monitor stdio -spice host=0,ic=on,port=5912,disable-ticketing -qxl 1

3)cat /proc/meminfo|grep -i hugepage
HugePages_Total:  1050
HugePages_Free:    997
HugePages_Rsvd:    502
Hugepagesize:     2048 kB

Comment 4 Dor Laor 2012-01-01 09:10:48 UTC
Something is wrong from the matrix tested by QE:
win2008r2   raw                 spice       hugepage    black screen
win2008r2   qcow2               spice       hugepage    normal
win2008r2   raw                 vnc         hugepage    normal
win7        raw                 spice       hugepage    hang
win7        qcow2               spice       hugepage    normal

How consistent are the above results? 
Is there any message when qemu is exiting on Intel?
Is there some spice debug option to check what's going on?

Comment 5 FuXiangChun 2012-01-04 07:27:13 UTC
(In reply to comment #4)
> Something is wrong from the matrix tested by QE:

> win2008r2   raw                 spice       hugepage    black screen
> win2008r2   qcow2               spice       hugepage    normal
> win2008r2   raw                 vnc         hugepage    normal
> win7        raw                 spice       hugepage    hang
> win7        qcow2               spice       hugepage    normal
> 
> How consistent are the above results? 
   need two conditions to reproduce this bug
  1. use spice to connect guest(windows2008r2 or win7)
  2. boot the guest with mem-path option

> Is there any message when qemu is exiting on Intel?
   add a attachment 
> Is there some spice debug option to check what's going on?
   
   My understanding that "spice debug option" is monitor output message when booting guest. right?   
   if so, i add a attachment of monitor output. 

notes:
   If I reinstalled guest win2008r2 and win7, this bug cann't be reproduced for new guests.

Comment 6 FuXiangChun 2012-01-04 07:29:07 UTC
Created attachment 550612 [details]
qemu exiting message

Comment 7 FuXiangChun 2012-01-04 07:29:59 UTC
Created attachment 550614 [details]
spice debug option message

Comment 8 FuXiangChun 2012-01-04 10:21:00 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Something is wrong from the matrix tested by QE:
> 
> > win2008r2   raw                 spice       hugepage    black screen
> > win2008r2   qcow2               spice       hugepage    normal
> > win2008r2   raw                 vnc         hugepage    normal
> > win7        raw                 spice       hugepage    hang
> > win7        qcow2               spice       hugepage    normal
> > 
> > How consistent are the above results? 
>    need two conditions to reproduce this bug
>   1. use spice to connect guest(windows2008r2 or win7)
>   2. boot the guest with mem-path option
> 
> > Is there any message when qemu is exiting on Intel?
>    add a attachment 
> > Is there some spice debug option to check what's going on?
> 
>    My understanding that "spice debug option" is monitor output message when
> booting guest. right?   
>    if so, i add a attachment of monitor output. 
> 
> notes:
>    If I reinstalled guest win2008r2 and win7, this bug cann't be reproduced for
> new guests.


Just repeatedly test win2008 and win7 guest2 in Amd and Intel platform.  win2008r2 guest can 100% reproduce this bug after installing qxl driver on AMD.

win7 guest sometimes can reproduce, so may qxl driver lead to this issue. 

qxl version:
     
     Driver Date: 7/1/2010
     Driver version: 4.5.46561.0

Comment 9 FuXiangChun 2012-01-04 10:25:58 UTC
Created attachment 550649 [details]
the newest spice debug option

Comment 10 Dor Laor 2012-01-05 22:27:14 UTC
(In reply to comment #6)
> Created attachment 550612 [details]
> qemu exiting message

There was an abort in the sound emulation code: #2  0x000000000052cd42 in snd_pcm_hw_params_set_channels_near ()

anyway, if the issue exists only w/ huge pages and windows and spice it may be too rare and I rather close the bug as won't fix.

Comment 11 Qunfang Zhang 2012-08-22 06:13:02 UTC
Seems it only only happens on windows guest. I hit it today with rhel6.3-64 guest. And it may be related to the hardware.

AMD 6168 (Dell R715)host:
1) Boot guest with huge page, connect guest with spice
==> Reproduce
2) Boot guest with huge page, connect guest with vnc
==> Not reproduce

Intel Q9550 (Dell 760) host:
Can not reproduce with the same image and command line with both spice and vnc.

Comment 12 Qunfang Zhang 2012-08-22 06:41:38 UTC
(In reply to comment #11)
> Seems it only only happens on windows guest. I hit it today with rhel6.3-64

Sorry, should be "Not only happens on windows guest".

> guest. And it may be related to the hardware.
> 
> AMD 6168 (Dell R715)host:
> 1) Boot guest with huge page, connect guest with spice
> ==> Reproduce
> 2) Boot guest with huge page, connect guest with vnc
> ==> Not reproduce
> 
> Intel Q9550 (Dell 760) host:
> Can not reproduce with the same image and command line with both spice and
> vnc.