direct-io.hg

changeset 9372:5032ee221f75

On x86/64 a domU kernel just sits around forever on a panic because
the HV doesn't know it crashed. This patch sends the signal, which
allows the kernel to be cleaned up (according to whatever guest.conf
rules). It is basically copied and pasted from the i386 branch.

From: Don Zickus
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 22 10:38:44 2006 +0100 (2006-03-22)
parents 573bb82d0402
children a07e25890329
files linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Mar 22 10:36:22 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Mar 22 10:38:44 2006 +0100
     1.3 @@ -93,6 +93,11 @@ EXPORT_SYMBOL(hypercall_page);
     1.4  /* Allows setting of maximum possible memory size  */
     1.5  unsigned long xen_override_max_pfn;
     1.6  
     1.7 +static int xen_panic_event(struct notifier_block *, unsigned long, void *);
     1.8 +static struct notifier_block xen_panic_block = {
     1.9 +	xen_panic_event, NULL, 0 /* try to go last */
    1.10 +};
    1.11 +
    1.12  unsigned long *phys_to_machine_mapping;
    1.13  unsigned long *pfn_to_mfn_frame_list_list, *pfn_to_mfn_frame_list[512];
    1.14  
    1.15 @@ -634,6 +639,9 @@ void __init setup_arch(char **cmdline_p)
    1.16  	unsigned long kernel_end;
    1.17  
    1.18  #ifdef CONFIG_XEN
    1.19 +	/* Register a call for panic conditions. */
    1.20 +	notifier_chain_register(&panic_notifier_list, &xen_panic_block);
    1.21 +
    1.22   	ROOT_DEV = MKDEV(RAMDISK_MAJOR,0); 
    1.23  	kernel_end = 0;		/* dummy */
    1.24   	screen_info = SCREEN_INFO;
    1.25 @@ -989,6 +997,17 @@ void __init setup_arch(char **cmdline_p)
    1.26  #endif /* !CONFIG_XEN */
    1.27  }
    1.28  
    1.29 +#ifdef CONFIG_XEN
    1.30 +static int
    1.31 +xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr)
    1.32 +{
    1.33 +	HYPERVISOR_sched_op(SCHEDOP_shutdown, SHUTDOWN_crash);
    1.34 +	/* we're never actually going to get here... */
    1.35 +	return NOTIFY_DONE;
    1.36 +}
    1.37 +#endif /* !CONFIG_XEN */
    1.38 +
    1.39 +
    1.40  static int __cpuinit get_model_name(struct cpuinfo_x86 *c)
    1.41  {
    1.42  	unsigned int *v;