From: Kei Tokunaga <ktokunag@redhat.com> Subject: [RHEL5.1 PATCH 10/21] Cannot backtrace with crash by using vmcore of para domain on IA64 Date: Thu, 07 Jun 2007 03:39:46 -0400 Bugzilla: 224047 Message-Id: <4667B642.9030908@redhat.com> Changelog: [xen] ia64: para domain vmcore does not work under crash bz224047 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224047 Backport of cset#13471 and 13872. When para domain crash, xend dump core atomatically. But IA64 don't make switch stack, we cannot backtrace its vmcore. Crash command support backtrace of para domain's vmcore. This issue is fixed with unw_init_running(). Thanks, Kei rh bug 224047 # HG changeset patch # User awilliam@xenbuild2.aw # Date 1168629245 25200 # Node ID 5d328ef9da712ef1640e2086c17cc7c6f255f47f # Parent 8835443fa3b37b5dde5e71a0e7ca49b9237b9cda [IA64] Make crash command happy As Dave requested, call unw_init_running() and save ksp before SHUTDOWN_crash. Signed-off-by: Dave Anderson <anderson@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- linux-2.6.18-21.el5-gerd-order-kei/arch/ia64/kernel/setup.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff -puN arch/ia64/kernel/setup.c~13471-IA64_Make_crash_command_happy arch/ia64/kernel/setup.c --- linux-2.6.18-21.el5-gerd-order/arch/ia64/kernel/setup.c~13471-IA64_Make_crash_command_happy 2007-06-07 02:44:29.000000000 -0400 +++ linux-2.6.18-21.el5-gerd-order-kei/arch/ia64/kernel/setup.c 2007-06-07 02:44:29.000000000 -0400 @@ -79,10 +79,18 @@ EXPORT_SYMBOL(__per_cpu_offset); #endif #ifdef CONFIG_XEN +static void +xen_panic_hypercall(struct unw_frame_info *info, void *arg) +{ + current->thread.ksp = (__u64)info->sw - 16; + HYPERVISOR_shutdown(SHUTDOWN_crash); + /* we're never actually going to get here... */ +} + static int xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { - HYPERVISOR_shutdown(SHUTDOWN_crash); + unw_init_running(xen_panic_hypercall, NULL); /* we're never actually going to get here... */ return NOTIFY_DONE; } _ rh bug 224047 # HG changeset patch # User awilliam@xenbuild2.aw # Date 1170614172 25200 # Node ID 1502ba048b731d782be2d47de14f3fca97565258 # Parent a1017acc857858dc2226bc7420ae9337943ca41e [IA64] Fix PAL_HALT for paravirtualized domains 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.18-21.el5-gerd-order-kei/arch/ia64/kernel/setup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN arch/ia64/kernel/setup.c~13872-IA64_Fix_PAL_HALT_for_paravirtualized_domains arch/ia64/kernel/setup.c --- linux-2.6.18-21.el5-gerd-order/arch/ia64/kernel/setup.c~13872-IA64_Fix_PAL_HALT_for_paravirtualized_domains 2007-06-07 02:44:30.000000000 -0400 +++ linux-2.6.18-21.el5-gerd-order-kei/arch/ia64/kernel/setup.c 2007-06-07 02:44:30.000000000 -0400 @@ -100,6 +100,13 @@ static struct notifier_block xen_panic_b .next = NULL, .priority = 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); @@ -547,6 +554,7 @@ setup_arch (char **cmdline_p) setup_xen_features(); /* Register a call for panic conditions. */ atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block); + pm_power_off = xen_pm_power_off; } #endif _