Zhou Jacky
2012-Jun-05 03:46 UTC
[bug report] Windows HVM Hang when reboot/power off using special config
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=<optimized out>) at /root/qemu/xen-4.1.2/qemu/vl.c:3794 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
George Dunlap
2012-Jun-06 11:12 UTC
Re: [bug report] Windows HVM Hang when reboot/power off using special config
On Tue, Jun 5, 2012 at 4:46 AM, Zhou Jacky <jackyzt98@gmail.com> wrote:> 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.I think you''ve already given the most probable answer your own question -- there must be some kind of synchronization that the guest OS is doing, probably relating to gracefully bringing down secondary cpus, that breaks when you pin them to a single core. -George