[IA64] Fix PAL_HALT for paravirtualized domains
authorawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Sun, 4 Feb 2007 18:36:12 +0000 (11:36 -0700)
committerawilliam@xenbuild2.aw <awilliam@xenbuild2.aw>
Sun, 4 Feb 2007 18:36:12 +0000 (11:36 -0700)
machine_halt() stops the vcpus, but no longer destroys the domain.
This should be more in-line with the behavior on native hardware.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
xen/arch/ia64/xen/fw_emul.c

index a56bbbdc53808dfb7ea10b1ce44e49e7124f653e..74f21997c7bfbfee16a806092881240296dea089 100644 (file)
@@ -95,6 +95,13 @@ xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
 static struct notifier_block xen_panic_block = {
        xen_panic_event, NULL, 0 /* try to go last */
 };
+
+void xen_pm_power_off(void)
+{
+       printk("%s called\n", __FUNCTION__);
+       local_irq_disable();
+       HYPERVISOR_shutdown(SHUTDOWN_poweroff);
+}
 #endif
 
 extern void ia64_setup_printk_clock(void);
@@ -456,6 +463,7 @@ setup_arch (char **cmdline_p)
                /* Register a call for panic conditions. */
                atomic_notifier_chain_register(&panic_notifier_list,
                                               &xen_panic_block);
+               pm_power_off = xen_pm_power_off;
        }
 #endif
 
index 2a9f8fcb53ea60e64ed7e3664a37b81a41d57479..905d29c6fd31234c76b43b44b5ab801651af51e3 100644 (file)
@@ -605,9 +605,11 @@ xen_pal_emulator(unsigned long index, u64 in1, u64 in2, u64 in3)
                        printk ("Domain0 halts the machine\n");
                        console_start_sync();
                        (*efi.reset_system)(EFI_RESET_SHUTDOWN,0,0,NULL);
+               } else {
+                       set_bit(_VCPUF_down, &current->vcpu_flags);
+                       vcpu_sleep_nosync(current);
+                       status = PAL_STATUS_SUCCESS;
                }
-               else
-                       domain_shutdown(current->domain, SHUTDOWN_poweroff);
                break;
            case PAL_HALT_LIGHT:
                if (VMX_DOMAIN(current)) {