Isaku Yamahata wrote:
> The ia64 would need to "jump through the hoop" of a
call to
> unw_init_running() before it calls HYPERVISOR_shutdown()
Is the attached patch what you want?
Not quite -- it leaves out the most important part. Your
patch will cause a switch_stack register dump to be laid down,
but the address of the switch_stack needs to be stored in the
task_struct->thread.ksp of the panicking task:
diff -r 114c8cc94466 -r 262eb4ba1212
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Thu Dec 21 17:47:31 2006 +0900
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c Fri Dec 22 12:03:18 2006 +0900
@@ -78,10 +78,17 @@ EXPORT_SYMBOL(__per_cpu_offset);
#endif
#ifdef CONFIG_XEN
+static void
+xen_panic_hypercall(struct unw_frame_info *info, void *arg)
+{
+ 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;
}
So the xen_panic_hypercall() should look like this:
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... */
}
Doing the store to the current->thread.ksp as above mimics
the behavior of all of the other tasks on the system.
Thanks,
Dave