From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhou Jacky Subject: [bug report] Windows HVM Hang when reboot/power off using special config Date: Tue, 5 Jun 2012 11:46:45 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6390823447204514567==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============6390823447204514567== Content-Type: multipart/alternative; boundary=002354471dd8e5504404c1b17fdf --002354471dd8e5504404c1b17fdf Content-Type: text/plain; charset=ISO-8859-1 Hi, Seems there's a bug when booting HVM guest Windows 2003 using special config (pin 2 VCPUs to same phy CPU). The guest OS will hange when reboot or power off system in guest. The CPU will be 100 percent when watching xentop. The config file as following: **************************************************** kernel="/usr/lib/xen-4.1/boot/hvmloader" builder='hvm' name="windows_2003" uuid="bb29f502-315a-488d-a234-c5651bcd6fbe" memory=4096 vcpus=2 on_reboot='restart' on_crash='restart' sdl=0 vnc=1 vnclisten="0.0.0.0" vncdisplay=29 stdvga=0 serial='pty' usbdevice='tablet' localtime=1 cpus=['5','5'] *************************************** Then I debug qemu-dm, find the OS never execute the ACPI register write, so the QEMU can not catch the system reboot/power off event. The normal case for guest OS poweroff will be : at first all system process/driver quit, then OS write ACPI register to poweroff system power. 1. Qemu fetch the register memory map in shared page, judge if it's ACPI register write. 2. If it's a reset, reboot, poweroff ACPI register operation, then call qemu_system_shutdown_request() or qemu_system_reset_request() to set a flag 3. If the flag be set, call destroy_hvm_domain() 4. Qemu process quit, xend clear other resource In my case, the qemu_system_shutdown_request ( ACPI register write ) never be triggered. And the VCPU usage be 100 percent. So I think it must exist some spinlock-like code in guest OS which cause the ACPI write never be executed. If I pin one VCPU to another CPU like '6', then ACPI register write be called immediately, guest OS poweroff smoothly. So anyone know why it's not work when PIN 2 VCPUs to same physical CPU when booting HVM Windows 2003? Thanks. Normal call stack: qemu_system_reset_request () at /root/qemu/xen-4.1.2/qemu/vl.c:3673 #1 0x000000000047950a in cpu_ioreq_pio (req=0x7ff6d7dbd000, env=0x22a1c40) at /root/qemu/xen-4.1.2/qemu/i386-dm/helper2.c:351 #2 __handle_ioreq (env=0x22a1c40, req=0x7ff6d7dbd000) at /root/qemu/xen-4.1.2/qemu/i386-dm/helper2.c:446 #3 0x0000000000479d7b in cpu_handle_ioreq (opaque=0x22a1c40) at /root/qemu/xen-4.1.2/qemu/i386-dm/helper2.c:515 #4 0x000000000040d81f in main_loop_wait (timeout=) at /root/qemu/xen-4.1.2/qemu/vl.c:3794 --002354471dd8e5504404c1b17fdf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Hi,

Seems there's a bug when=A0booting HVM=A0guest=A0Windows 2003=A0usin= g special=A0config=A0(pin 2 VCPUs to same phy=A0CPU). The guest OS will han= ge when reboot or power off system
in guest. The CPU will be 100 percent= when watching xentop. The config file as following:

****************************************************
kernel=3D"/= usr/lib/xen-4.1/boot/hvmloader"
builder=3D'hvm'
name=3D&= quot;windows_2003"
uuid=3D"bb29f502-315a-488d-a234-c5651bcd6fb= e"
memory=3D4096
vcpus=3D2
on_reboot=3D'restart'
on_crash=3D&= #39;restart'
sdl=3D0
vnc=3D1
vnclisten=3D"0.0.0.0"vncdisplay=3D29
stdvga=3D0
serial=3D'pty'
usbdevice=3D&#= 39;tablet'
localtime=3D1
cpus=3D['5','5']
**********************= *****************

Then I debug qemu-dm, find the OS never execute the ACPI register write,= so the QEMU can not catch the system reboot/power off event.
The normal= case for guest OS poweroff will be : at first all system process/driver qu= it, then OS write ACPI register to poweroff system power.

1. Qemu fetch the register memory map in shared page, judge if it's = ACPI register write.
2. If it's a reset, reboot, poweroff ACPI regis= ter operation, then call=A0qemu_system_shutdown_request() or qemu_system_re= set_request()
=A0to set a flag
3. If the flag be set, call destroy_hvm_domain()
4. = Qemu process quit, xend clear other resource=A0

In my case, the qemu_system_shutdown_request ( ACPI register write ) nev= er be triggered. And the VCPU usage be 100 percent.
So I think it must = exist some spinlock-like code in guest OS which cause the ACPI write never = be executed.
If I pin one VCPU to another CPU like '6', then ACPI register write= be called immediately, guest OS poweroff smoothly.

So anyone know=A0why it's not work when PIN 2 VCPUs to same physical= CPU when booting HVM Windows 2003? Thanks.

Normal call stack:
qemu_system_reset_request () at /root/qemu/xen-4.1= .2/qemu/vl.c:3673
#1=A0 0x000000000047950a in cpu_ioreq_pio (req=3D0x7ff= 6d7dbd000, env=3D0x22a1c40) at /root/qemu/xen-4.1.2/qemu/i386-dm/helper2.c:= 351
#2=A0 __handle_ioreq (env=3D0x22a1c40, req=3D0x7ff6d7dbd000) at /root/qemu/= xen-4.1.2/qemu/i386-dm/helper2.c:446
#3=A0 0x0000000000479d7b in cpu_han= dle_ioreq (opaque=3D0x22a1c40) at /root/qemu/xen-4.1.2/qemu/i386-dm/helper2= .c:515
#4=A0 0x000000000040d81f in main_loop_wait (timeout=3D<optimized out>= ) at /root/qemu/xen-4.1.2/qemu/vl.c:3794

--002354471dd8e5504404c1b17fdf-- --===============6390823447204514567== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6390823447204514567==--