Bug 1185253

Summary: Windows 2008 R2 or Win7 SP1 smp guest booting hang with hv_time enabled on OVMF env
Product: Red Hat Enterprise Linux 7 Reporter: Xiaoqing Wei <xwei>
Component: virt-managerAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: cfergeau, crobinso, gscrivan, juzhang, juzhou, knoel, lersek, mzhan, pbonzini, phrdina, tzheng, vbenes, virt-maint, xiaodwan, xwei
Target Milestone: rcKeywords: Upstream
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: virt-manager-1.2.0-4-el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 05:23:53 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:    
Bug Blocks: 1205796    
Attachments:
Description Flags
trace none

Description Xiaoqing Wei 2015-01-23 10:20:29 UTC
Description of problem:
Windows 2008 R2 or Win7 SP1 smp guest booting hang with hv_time enabled on OVMF env

Version-Release number of selected component (if applicable):
kernel-3.10.0-224.el7.x86_64
qemu-kvm-rhev-2.1.2-20.el7.x86_64
OVMF-20140822-7.git9ece15a.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. 
install a Win7 or Win2008r2 SP1 in OVMF env (NT6.1 OSes) with
1) smp (2 or more vcpu)
2) hv_time option enabled in -cpu




/usr/libexec/qemu-kvm -name win2k8r2 -S -machine pc-i440fx-rhel7.1.0,accel=kvm,usb=off \
\
\
-cpu Opteron_G5,+bmi1,+perfctr_nb,+perfctr_core,+topoext,+nodeid_msr,+tce,+lwp,+wdt,+skinit,+ibs,+osvw,+cr8legacy,+extapic,+cmp_legacy,+fxsr_opt,+mmxext,+osxsave,+monitor,+ht,+vme,hv_time \
\
\
-drive file=/usr/share/OVMF/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on -drive file=/var/lib/libvirt/qemu/nvram/win2k8r2_VARS.fd,if=pflash,format=raw,unit=1 -m 4096 -realtime mlock=off \
\
\
-smp 4,sockets=4,cores=1,threads=1 \
\
\
-uuid 4117cec1-9b5f-4de8-ad48-162c666707ea -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/win2k8r2.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x5 -device ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x5.0x1 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x5.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/var/lib/libvirt/images/win2k8r2.qcow2,if=none,id=drive-ide0-0-0,format=qcow2 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -drive file=/home/kvm_autotest_root/iso/ISO/Win2008R2/en_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_x64_dvd_617601.iso,if=none,id=drive-ide0-0-1,readonly=on,format=raw -device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:18:0a:75,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,addr=0.0.0.0,disable-ticketing,seamless-migration=on -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x2 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x7 -msg timestamp=on

2.
3.

Actual results:
guest hangs when entering the installer

Expected results:
guest booting fine, installation should success

Additional info:

I am not raise the severity/priority to high/high as:

1) OVMF is Tech Preview
2) Windows NT 6.1 OSes(Windows 7 SP1, or Windows 2008 R2) are not even supportted as guest on Microsoft's own UEFI implementation for VM, namely "Hyper-V Gen 2" guest.
https://technet.microsoft.com/en-us/library/dn282285.aspx
3) this works w/o hv_time on multi smp
4) this works w   hv_time on uni core VM
5) this is not a Regression(Tried downgrade to 7.0 GA)

Comment 1 Xiaoqing Wei 2015-01-23 10:25:26 UTC
Okay, I managed to install a Win2012 R2 Server and define a Gen 2(without secure boot) with Windows 2008 R2 iso,
after press a key to let vm boot from cdrom, it also hangs(showing 'Starting Windows' forever).
the hang point is even earlier on kvm, single process also doesn't help.
no knowing where to turn hv_time off on hyper-v, cant do the test.

Comment 3 Xiaoqing Wei 2015-01-23 10:34:21 UTC
search the bz, and found a similar bz on kvm, but it's using seabios. and fixed.

https://bugzilla.redhat.com/show_bug.cgi?id=1078089

it's on kernel component, so if this 1185253 might need to change component.

Comment 4 Laszlo Ersek 2015-01-23 10:42:09 UTC
Given what you wrote under (2) in "Additional info" in comment 0 -- why do you try to set hv_time at all for such a guest? Apparently UEFI Windows 7 & 2008 R2 were never meant to run as Hyper-V guests, so why expose them to a (partially) Hyper-V-enabled environment? IOW I'm questioning if this is something we should even try to support technically.

Comment 5 Laszlo Ersek 2015-01-23 10:46:01 UTC
Does libvirt set hv_time perhaps, automatically? (Based on libosinfo?)

Comment 6 Xiaoqing Wei 2015-01-23 11:28:53 UTC
(In reply to Laszlo Ersek from comment #5)
> Does libvirt set hv_time perhaps, automatically? (Based on libosinfo?)

Yes, this xml is from virt-manager, it auto detects guest os type, and try to optimize something.

Comment 7 Xiaoqing Wei 2015-01-23 11:58:32 UTC
change to libosinfo per C#5

Comment 8 Zeeshan Ali 2015-01-26 14:54:58 UTC
(In reply to Xiaoqing Wei from comment #7)
> change to libosinfo per C#5

Based on libosinfo but info itself is not coming from libosinfo so its still virt-manager bug.

For the record, there has been talk of libosinfo providing this info directly but we don't have that API yet.

Comment 9 Giuseppe Scrivano 2015-01-26 16:02:59 UTC
patch upstream:

https://www.redhat.com/archives/virt-tools-list/2015-January/msg00083.html

please review and comment.  I have only tested that the generated XML has no HYPER-V features enabled.

Comment 10 Giuseppe Scrivano 2015-01-27 12:54:38 UTC
moving to 7.2.  UEFI is tech-preview and people can always edit the XML manually.

The upstream fix is:

commit 5acfccf6032abb9e8be89130d05b661e8b3f42c7
Author: Giuseppe Scrivano <gscrivan>
Date:   Mon Jan 26 16:52:03 2015 +0100

    virt-manager: disable HYPER-V on Windows 2008 R2 and Win7 SP1 with UEFI
    
    Windows 2008 R2 or Win7 SP1 guests do not work when UEFI and HYPER-V,
    so just disable HYPER-V.
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1185253
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>

Comment 12 Paolo Bonzini 2015-04-01 21:12:50 UTC
Can anyone attach a trace of a hung VM?

Comment 13 Xiaoqing Wei 2015-04-03 06:53:35 UTC
Created attachment 1010504 [details]
trace

Comment 14 Xiaoqing Wei 2015-04-03 06:54:07 UTC
(In reply to Paolo Bonzini from comment #12)
> Can anyone attach a trace of a hung VM?

Hi Paolo,

Pls check C#13

Comment 16 Laszlo Ersek 2015-05-20 13:00:07 UTC
See also: http://thread.gmane.org/gmane.comp.bios.tianocore.devel/14793

Comment 17 Giuseppe Scrivano 2015-05-20 15:59:27 UTC
bug still present in 1.2.0, the commit 938060ae5340f6e28dc9669ba1ab79a1aa3d615e introduces the regression.

Comment 20 Xiaodai Wang 2015-06-24 03:07:21 UTC
I can reproduce this bug with package:
virt-install-1.1.0-13.el7.noarch.rpm  
virt-manager-1.1.0-13.el7.noarch.rpm  
virt-manager-common-1.1.0-13.el7.noarch.rpm


Steps:
1. Make sure OVMF package is installed.
2. Install a win7sp1(or win2k8r2) guest by ISO image, Select Customize configuration before install in step5 of 5 and then click Finish.
3. In Overview tab, Select UEFI in Hypervisor Details and then click Apply->Begin Installation.

Result:
The installation hangs.


Then try to verify with latest build:
virt-install-1.2.1-2.el7.noarch.rpm  
virt-manager-1.2.1-2.el7.noarch.rpm  
virt-manager-common-1.2.1-2.el7.noarch.rpm

Steps:
1. Rerun about steps with latest build, The installation is success.
2. Also tried with RHEL, win8.1, all the installation are success.

According to the result above in the latest version of virt-manager, move this bug from ON_QA to VERIFIED.

Comment 22 errata-xmlrpc 2015-11-19 05:23:53 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://rhn.redhat.com/errata/RHBA-2015-2206.html