lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <480F19F4.80506@ah.jp.nec.com>
Date:	Wed, 23 Apr 2008 20:13:56 +0900
From:	Takenori Nagano <t-nagano@...jp.nec.com>
To:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
CC:	kdb@....sgi.com, vgoyal@...hat.com,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	kexec@...ts.infradead.org, Keith Owens <kaos@....com.au>,
	Nick Piggin <nickpiggin@...oo.com.au>,
	Randy Dunlap <rdunlap@...otime.net>, greg@...ah.com,
	bwalle@...e.de, k-miyoshi@...jp.nec.com
Subject: Re: [PATCH 2/2] implement new notifier function to panic_notifier_list
 ,take4

Takenori Nagano wrote:
> This patch implements new notifier function to panic_notifier_list. We can
> change the list of order by debugfs.

Ahh, sorry.

debugfs -> /sys/kernel/notifiers/panic_notifier_list/* entry

> 
> Thanks,
> 
> ---
> 
> Signed-off-by: Takenori Nagano <t-nagano@...jp.nec.com>
> 
> ---
> diff -uprN linux-2.6.25.orig/arch/alpha/kernel/setup.c linux-2.6.25/arch/alpha/kernel/setup.c
> --- linux-2.6.25.orig/arch/alpha/kernel/setup.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/alpha/kernel/setup.c	2008-04-21 17:15:58.208654286 +0900
> @@ -44,14 +44,18 @@
>  #include <asm/io.h>
>  #include <linux/log2.h>
>  
> -extern struct atomic_notifier_head panic_notifier_list;
> +extern struct tunable_atomic_notifier_head panic_notifier_list;
>  static int alpha_panic_event(struct notifier_block *, unsigned long, void *);
> -static struct notifier_block alpha_panic_block = {
> +static struct notifier_block alpha_panic_block_base = {
>  	alpha_panic_event,
>          NULL,
>          INT_MAX /* try to do it first */
>  };
>  
> +static struct tunable_atomic_notifier_block alpha_panic_block = {
> +	.nb = &alpha_panic_block_base
> +};
> +
>  #include <asm/uaccess.h>
>  #include <asm/pgtable.h>
>  #include <asm/system.h>
> @@ -521,8 +525,8 @@ setup_arch(char **cmdline_p)
>  	}
>  
>  	/* Register a call for panic conditions. */
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -			&alpha_panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +				&alpha_panic_block, "alpha_panic", NULL);
>  
>  #ifdef CONFIG_ALPHA_GENERIC
>  	/* Assume that we've booted from SRM if we haven't booted from MILO.
> diff -uprN linux-2.6.25.orig/arch/arm/mach-omap1/board-voiceblue.c linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c
> --- linux-2.6.25.orig/arch/arm/mach-omap1/board-voiceblue.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/arm/mach-omap1/board-voiceblue.c	2008-04-21 17:15:58.252653690 +0900
> @@ -226,14 +226,19 @@ static int panic_event(struct notifier_b
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block panic_block = {
> +static struct notifier_block panic_block_base = {
>  	.notifier_call	= panic_event,
>  };
>  
> +static struct tunable_atomic_notifier_block panic_block = {
> +	.nb             = &panic_block_base
> +};
> +
>  static int __init voiceblue_setup(void)
>  {
>  	/* Setup panic notifier */
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&panic_block, "VoiceBlue", NULL);
>  
>  	return 0;
>  }
> diff -uprN linux-2.6.25.orig/arch/mips/lasat/setup.c linux-2.6.25/arch/mips/lasat/setup.c
> --- linux-2.6.25.orig/arch/mips/lasat/setup.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/mips/lasat/setup.c	2008-04-21 17:15:58.288653222 +0900
> @@ -106,7 +106,7 @@ static int lasat_panic_prom_monitor(stru
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block lasat_panic_block[] =
> +static struct notifier_block lasat_panic_block_base[] =
>  {
>  	{
>  		.notifier_call	= lasat_panic_display,
> @@ -117,6 +117,18 @@ static struct notifier_block lasat_panic
>  	}
>  };
>  
> +static struct tunable_atomic_notifier_block lasat_panic_block[] = {
> +	{
> +		.nb		= &lasat_panic_block_base[0]
> +	}, {
> +		.nb		= &lasat_panic_block_base[1]
> +	}
> +};
> +
> +static char* notifier_name[] = {
> +	"lasat_panic_display", "lasat_panic_prom_monitor"
> +};
> +
>  void __init plat_time_init(void)
>  {
>  	mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
> @@ -134,8 +146,8 @@ void __init plat_mem_setup(void)
>  
>  	/* Set up panic notifier */
>  	for (i = 0; i < ARRAY_SIZE(lasat_panic_block); i++)
> -		atomic_notifier_chain_register(&panic_notifier_list,
> -				&lasat_panic_block[i]);
> +		tunable_notifier_chain_register(&panic_notifier_list,
> +				&lasat_panic_block[i], notifier_name[i], NULL);
>  
>  	lasat_reboot_setup();
>  
> diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c
> --- linux-2.6.25.orig/arch/mips/sgi-ip22/ip22-reset.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/mips/sgi-ip22/ip22-reset.c	2008-04-21 17:15:58.324653254 +0900
> @@ -226,10 +226,14 @@ static int panic_event(struct notifier_b
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block panic_block = {
> +static struct notifier_block panic_block_base = {
>  	.notifier_call	= panic_event,
>  };
>  
> +static struct tunable_atomic_notifier_block panic_block = {
> +	.nb		= &panic_block_base
> +};
> +
>  static int __init reboot_setup(void)
>  {
>  	int res;
> @@ -246,7 +250,8 @@ static int __init reboot_setup(void)
>  
>  	init_timer(&blink_timer);
>  	blink_timer.function = blink_timeout;
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					       &panic_block, "sgi-ip22", NULL);
>  
>  	return 0;
>  }
> diff -uprN linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c
> --- linux-2.6.25.orig/arch/mips/sgi-ip32/ip32-reset.c	2008-04-22 20:34:43.035578599 +0900
> +++ linux-2.6.25/arch/mips/sgi-ip32/ip32-reset.c	2008-04-21 17:15:58.588651552 +0900
> @@ -175,10 +175,14 @@ static int panic_event(struct notifier_b
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block panic_block = {
> +static struct notifier_block panic_block_base = {
>  	.notifier_call = panic_event,
>  };
>  
> +static struct tunable_atomic_notifier_block panic_block = {
> +	.nb		= &panic_block_base
> +};
> +
>  static __init int ip32_reboot_setup(void)
>  {
>  	/* turn on the green led only */
> @@ -193,7 +197,8 @@ static __init int ip32_reboot_setup(void
>  
>  	init_timer(&blink_timer);
>  	blink_timer.function = blink_timeout;
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					       &panic_block, "sgi-ip32", NULL);
>  
>  	if (request_irq(MACEISA_RTC_IRQ, ip32_rtc_int, 0, "rtc", NULL))
>  		panic("Can't allocate MACEISA RTC IRQ");
> diff -uprN linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c linux-2.6.25/arch/parisc/kernel/pdc_chassis.c
> --- linux-2.6.25.orig/arch/parisc/kernel/pdc_chassis.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/parisc/kernel/pdc_chassis.c	2008-04-21 17:15:58.604651614 +0900
> @@ -101,11 +101,14 @@ static int pdc_chassis_panic_event(struc
>  }   
>  
>  
> -static struct notifier_block pdc_chassis_panic_block = {
> +static struct notifier_block pdc_chassis_panic_block_base = {
>  	.notifier_call = pdc_chassis_panic_event,
>  	.priority = INT_MAX,
>  };
>  
> +static struct tunable_atomic_notifier_block pdc_chassis_panic_block = {
> +	.nb		= &pdc_chassis_panic_block_base
> +};
>  
>  /**
>   * parisc_reboot_event() - Called by the reboot handler.
> @@ -144,8 +147,8 @@ void __init parisc_pdc_chassis_init(void
>  				PDC_CHASSIS_VER);
>  
>  		/* initialize panic notifier chain */
> -		atomic_notifier_chain_register(&panic_notifier_list,
> -				&pdc_chassis_panic_block);
> +		tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +				&pdc_chassis_panic_block, "pdc_chassis", NULL);
>  
>  		/* initialize reboot notifier chain */
>  		register_reboot_notifier(&pdc_chassis_reboot_block);
> diff -uprN linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c linux-2.6.25/arch/powerpc/kernel/setup-common.c
> --- linux-2.6.25.orig/arch/powerpc/kernel/setup-common.c	2008-04-22 20:34:43.439575752 +0900
> +++ linux-2.6.25/arch/powerpc/kernel/setup-common.c	2008-04-21 17:15:58.628651402 +0900
> @@ -609,14 +609,19 @@ static int ppc_panic_event(struct notifi
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block ppc_panic_block = {
> +static struct notifier_block ppc_panic_block_base = {
>  	.notifier_call = ppc_panic_event,
>  	.priority = INT_MIN /* may not return; must be done last */
>  };
>  
> +static struct tunable_atomic_notifier_block ppc_panic_block = {
> +	.nb		= &ppc_panic_block_base
> +};
> +
>  void __init setup_panic(void)
>  {
> -	atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&ppc_panic_block, "powerpc", NULL);
>  }
>  
>  #ifdef CONFIG_CHECK_CACHE_COHERENCY
> diff -uprN linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c linux-2.6.25/arch/ppc/platforms/prep_setup.c
> --- linux-2.6.25.orig/arch/ppc/platforms/prep_setup.c	2008-04-22 20:34:44.015572781 +0900
> +++ linux-2.6.25/arch/ppc/platforms/prep_setup.c	2008-04-21 17:15:58.772650588 +0900
> @@ -634,12 +634,16 @@ ibm_statusled_panic(struct notifier_bloc
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block ibm_statusled_block = {
> +static struct notifier_block ibm_statusled_block_base = {
>  	ibm_statusled_panic,
>  	NULL,
>  	INT_MAX /* try to do it first */
>  };
>  
> +static struct tunable_atomic_notifier_block ibm_statusled_block = {
> +	.nb = &ibm_statusled_block_base
> +};
> +
>  static void
>  ibm_statusled_progress(char *s, unsigned short hex)
>  {
> @@ -654,8 +658,9 @@ ibm_statusled_progress(char *s, unsigned
>  		hex = 0xfff;
>  		if (!notifier_installed) {
>  			++notifier_installed;
> -			atomic_notifier_chain_register(&panic_notifier_list,
> -						&ibm_statusled_block);
> +			tunable_atomic_notifier_chain_register(
> +				&panic_notifier_list, &ibm_statusled_block,
> +				"IBM_statusLED", NULL);
>  		}
>  	}
>  	else
> diff -uprN linux-2.6.25.orig/arch/s390/kernel/ipl.c linux-2.6.25/arch/s390/kernel/ipl.c
> --- linux-2.6.25.orig/arch/s390/kernel/ipl.c	2008-04-22 20:34:44.103572199 +0900
> +++ linux-2.6.25/arch/s390/kernel/ipl.c	2008-04-21 17:15:58.772650588 +0900
> @@ -1372,11 +1372,15 @@ static int on_panic_notify(struct notifi
>  	return NOTIFY_OK;
>  }
>  
> -static struct notifier_block on_panic_nb = {
> +static struct notifier_block on_panic_nb_base = {
>  	.notifier_call = on_panic_notify,
>  	.priority = 0,
>  };
>  
> +static struct tunable_atomic_notifier_block on_panic_nb = {
> +	.nb = &on_panic_nb_base
> +};
> +
>  void __init setup_ipl(void)
>  {
>  	ipl_info.type = get_ipl_type();
> @@ -1402,7 +1406,8 @@ void __init setup_ipl(void)
>  		/* We have no info to copy */
>  		break;
>  	}
> -	atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +						&on_panic_nb, "s390_ipl", NULL);
>  }
>  
>  void __init ipl_save_parameters(void)
> diff -uprN linux-2.6.25.orig/arch/sparc64/kernel/sstate.c linux-2.6.25/arch/sparc64/kernel/sstate.c
> --- linux-2.6.25.orig/arch/sparc64/kernel/sstate.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/sparc64/kernel/sstate.c	2008-04-21 17:15:58.772650588 +0900
> @@ -82,11 +82,15 @@ static int sstate_panic_event(struct not
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block sstate_panic_block = {
> +static struct notifier_block sstate_panic_block_base = {
>  	.notifier_call	=	sstate_panic_event,
>  	.priority	=	INT_MAX,
>  };
>  
> +static struct tunable_atomic_notifier_block sstate_panic_block = {
> +	.nb		=	&sstate_panic_block_base
> +};
> +
>  void __init sun4v_sstate_init(void)
>  {
>  	unsigned long major, minor;
> @@ -99,6 +103,6 @@ void __init sun4v_sstate_init(void)
>  	hv_supports_soft_state = 1;
>  
>  	prom_sun4v_guest_soft_state();
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -				       &sstate_panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&sstate_panic_block, "sstate" ,NULL);
>  }
> diff -uprN linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c linux-2.6.25/arch/um/drivers/mconsole_kern.c
> --- linux-2.6.25.orig/arch/um/drivers/mconsole_kern.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/um/drivers/mconsole_kern.c	2008-04-21 17:15:58.848643538 +0900
> @@ -920,16 +920,20 @@ static int notify_panic(struct notifier_
>  	return 0;
>  }
>  
> -static struct notifier_block panic_exit_notifier = {
> +static struct notifier_block panic_exit_notifier_base = {
>  	.notifier_call 		= notify_panic,
>  	.next 			= NULL,
>  	.priority 		= 1
>  };
>  
> +static struct tunable_atomic_notifier_block panic_exit_notifier = {
> +	.nb			= &panic_exit_notifier_base
> +};
> +
>  static int add_notifier(void)
>  {
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -			&panic_exit_notifier);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&panic_exit_notifier, "mconsole", NULL);
>  	return 0;
>  }
>  
> diff -uprN linux-2.6.25.orig/arch/um/kernel/um_arch.c linux-2.6.25/arch/um/kernel/um_arch.c
> --- linux-2.6.25.orig/arch/um/kernel/um_arch.c	2008-04-22 20:34:44.335563438 +0900
> +++ linux-2.6.25/arch/um/kernel/um_arch.c	2008-04-21 17:15:58.848643538 +0900
> @@ -234,12 +234,16 @@ static int panic_exit(struct notifier_bl
>  	return 0;
>  }
>  
> -static struct notifier_block panic_exit_notifier = {
> +static struct notifier_block panic_exit_notifier_base = {
>  	.notifier_call 		= panic_exit,
>  	.next 			= NULL,
>  	.priority 		= 0
>  };
>  
> +static struct tunable_atomic_notifier_block panic_exit_notifier = {
> +	.nb			= &panic_exit_notifier_base
> +};
> +
>  /* Set during early boot */
>  unsigned long task_size;
>  EXPORT_SYMBOL(task_size);
> @@ -357,8 +361,8 @@ int __init linux_main(int argc, char **a
>  		printf("Kernel virtual memory size shrunk to %lu bytes\n",
>  		       virtmem_size);
>  
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -				       &panic_exit_notifier);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +				       &panic_exit_notifier, "um", NULL);
>  
>  	uml_postsetup();
>  
> diff -uprN linux-2.6.25.orig/arch/x86/lguest/boot.c linux-2.6.25/arch/x86/lguest/boot.c
> --- linux-2.6.25.orig/arch/x86/lguest/boot.c	2008-04-22 20:34:44.807567744 +0900
> +++ linux-2.6.25/arch/x86/lguest/boot.c	2008-04-21 17:15:58.848643538 +0900
> @@ -820,17 +820,22 @@ static int lguest_panic(struct notifier_
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block paniced = {
> +static struct notifier_block paniced_base = {
>  	.notifier_call = lguest_panic
>  };
>  
> +static struct tunable_atomic_notifier_block paniced = {
> +	.nb = = &paniced_base
> +};
> +
>  /* Setting up memory is fairly easy. */
>  static __init char *lguest_memory_setup(void)
>  {
>  	/* We do this here and not earlier because lockcheck used to barf if we
>  	 * did it before start_kernel().  I think we fixed that, so it'd be
>  	 * nice to move it back to lguest_init.  Patch welcome... */
> -	atomic_notifier_chain_register(&panic_notifier_list, &paniced);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list, &paniced,
> +							"lguest", NULL);
>  
>  	/* The Linux bootloader header contains an "e820" memory map: the
>  	 * Launcher populated the first entry with our memory limit. */
> diff -uprN linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c linux-2.6.25/arch/xtensa/platforms/iss/setup.c
> --- linux-2.6.25.orig/arch/xtensa/platforms/iss/setup.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/arch/xtensa/platforms/iss/setup.c	2008-04-21 17:15:58.848643538 +0900
> @@ -98,13 +98,18 @@ iss_panic_event(struct notifier_block *t
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block iss_panic_block = {
> +static struct notifier_block iss_panic_block_base = {
>  	iss_panic_event,
>  	NULL,
>  	0
>  };
>  
> +static struct tunable_atomic_notifier_block iss_panic_block = {
> +	.nb = &iss_panic_block_base
> +};
> +
>  void __init platform_setup(char **p_cmdline)
>  {
> -	atomic_notifier_chain_register(&panic_notifier_list, &iss_panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&iss_panic_block, "iss_panic", NULL);
>  }
> diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c
> --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_msghandler.c	2008-04-22 20:34:46.675556380 +0900
> +++ linux-2.6.25/drivers/char/ipmi/ipmi_msghandler.c	2008-04-21 17:15:58.972642550 +0900
> @@ -4234,12 +4234,16 @@ static int panic_event(struct notifier_b
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block panic_block = {
> +static struct notifier_block panic_block_base = {
>  	.notifier_call	= panic_event,
>  	.next		= NULL,
>  	.priority	= 200	/* priority: INT_MAX >= x >= 0 */
>  };
>  
> +static struct tunable_atomic_notifier_block panic_block = {
> +	.nb		= &panic_block_base
> +};
> +
>  static int ipmi_init_msghandler(void)
>  {
>  	int rv;
> @@ -4269,7 +4273,8 @@ static int ipmi_init_msghandler(void)
>  	setup_timer(&ipmi_timer, ipmi_timeout, 0);
>  	mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
>  
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&panic_block, "ipmi_msghandler", NULL);
>  
>  	initialized = 1;
>  
> @@ -4289,7 +4294,8 @@ static __exit void cleanup_ipmi(void)
>  	if (!initialized)
>  		return;
>  
> -	atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_unregister(&panic_notifier_list,
> +						 &panic_block);
>  
>  	/*
>  	 * This can't be called if any interfaces exist, so no worry
> diff -uprN linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c
> --- linux-2.6.25.orig/drivers/char/ipmi/ipmi_watchdog.c	2008-04-22 20:34:46.691555965 +0900
> +++ linux-2.6.25/drivers/char/ipmi/ipmi_watchdog.c	2008-04-21 17:15:58.988649720 +0900
> @@ -1157,12 +1157,15 @@ static int wdog_panic_handler(struct not
>  	return NOTIFY_OK;
>  }
>  
> -static struct notifier_block wdog_panic_notifier = {
> +static struct notifier_block wdog_panic_notifier_base = {
>  	.notifier_call	= wdog_panic_handler,
>  	.next		= NULL,
>  	.priority	= 150	/* priority: INT_MAX >= x >= 0 */
>  };
>  
> +static struct tunable_atomic_notifier_block wdog_panic_notifier = {
> +	.nb		= &wdog_panic_notifier_base
> +};
>  
>  static void ipmi_new_smi(int if_num, struct device *device)
>  {
> @@ -1302,8 +1305,8 @@ static int __init ipmi_wdog_init(void)
>  	check_parms();
>  
>  	register_reboot_notifier(&wdog_reboot_notifier);
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -			&wdog_panic_notifier);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +				&wdog_panic_notifier, "ipmi_wdog", NULL);
>  
>  	rv = ipmi_smi_watcher_register(&smi_watcher);
>  	if (rv) {
> @@ -1311,8 +1314,8 @@ static int __init ipmi_wdog_init(void)
>  		if (nmi_handler_registered)
>  			unregister_die_notifier(&ipmi_nmi_handler);
>  #endif
> -		atomic_notifier_chain_unregister(&panic_notifier_list,
> -						 &wdog_panic_notifier);
> +		tunable_atomic_notifier_chain_unregister(&panic_notifier_list,
> +						 	 &wdog_panic_notifier);
>  		unregister_reboot_notifier(&wdog_reboot_notifier);
>  		printk(KERN_WARNING PFX "can't register smi watcher\n");
>  		return rv;
> @@ -1333,8 +1336,8 @@ static void __exit ipmi_wdog_exit(void)
>  		unregister_die_notifier(&ipmi_nmi_handler);
>  #endif
>  
> -	atomic_notifier_chain_unregister(&panic_notifier_list,
> -					 &wdog_panic_notifier);
> +	tunable_atomic_notifier_chain_unregister(&panic_notifier_list,
> +					 	 &wdog_panic_notifier);
>  	unregister_reboot_notifier(&wdog_reboot_notifier);
>  }
>  module_exit(ipmi_wdog_exit);
> diff -uprN linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c linux-2.6.25/drivers/misc/ibmasm/heartbeat.c
> --- linux-2.6.25.orig/drivers/misc/ibmasm/heartbeat.c	2008-04-22 20:34:50.719536142 +0900
> +++ linux-2.6.25/drivers/misc/ibmasm/heartbeat.c	2008-04-21 17:15:59.024649246 +0900
> @@ -48,17 +48,22 @@ static int panic_happened(struct notifie
>  	return 0;
>  }
>  
> -static struct notifier_block panic_notifier = { panic_happened, NULL, 1 };
> +static struct notifier_block panic_notifier_base = { panic_happened, NULL, 1 };
> +
> +static struct tunable_atomic_notifier_block panic_notifier = { 
> +	.nb = &panic_notifier_base
> +};
>  
>  void ibmasm_register_panic_notifier(void)
>  {
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_notifier);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					       &panic_notifier, "ibmasm", NULL);
>  }
>  
>  void ibmasm_unregister_panic_notifier(void)
>  {
> -	atomic_notifier_chain_unregister(&panic_notifier_list,
> -			&panic_notifier);
> +	tunable_atomic_notifier_chain_unregister(&panic_notifier_list,
> +						 &panic_notifier);
>  }
>  
>  
> diff -uprN linux-2.6.25.orig/drivers/parisc/power.c linux-2.6.25/drivers/parisc/power.c
> --- linux-2.6.25.orig/drivers/parisc/power.c	2008-04-17 11:49:44.000000000 +0900
> +++ linux-2.6.25/drivers/parisc/power.c	2008-04-21 17:15:59.036649566 +0900
> @@ -189,11 +189,14 @@ static int parisc_panic_event(struct not
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block parisc_panic_block = {
> +static struct notifier_block parisc_panic_block_base = {
>  	.notifier_call	= parisc_panic_event,
>  	.priority	= INT_MAX,
>  };
>  
> +static struct tunable_atomic_notifier_block parisc_panic_block = {
> +	.nb		= &parisc_panic_block_base
> +};
>  
>  static int __init power_init(void)
>  {
> @@ -231,8 +234,8 @@ static int __init power_init(void)
>  	}
>  
>  	/* Register a call for panic conditions. */
> -	atomic_notifier_chain_register(&panic_notifier_list,
> -			&parisc_panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +				&parisc_panic_block, "parisc_panic", NULL);
>  
>  	return 0;
>  }
> @@ -241,8 +244,8 @@ static void __exit power_exit(void)
>  {
>  	kthread_stop(power_task);
>  
> -	atomic_notifier_chain_unregister(&panic_notifier_list,
> -			&parisc_panic_block);
> +	tunable_atomic_notifier_chain_unregister(&panic_notifier_list,
> +						 &parisc_panic_block);
>  
>  	pdc_soft_power_button(0);
>  }
> diff -uprN linux-2.6.25.orig/kernel/softlockup.c linux-2.6.25/kernel/softlockup.c
> --- linux-2.6.25.orig/kernel/softlockup.c	2008-04-22 20:35:03.247453824 +0900
> +++ linux-2.6.25/kernel/softlockup.c	2008-04-21 17:15:59.240648254 +0900
> @@ -35,8 +35,12 @@ softlock_panic(struct notifier_block *th
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block panic_block = {
> -	.notifier_call = softlock_panic,
> +static struct notifier_block panic_block_base = {
> +	.notifier_call = softlock_panic
> +};
> +
> +static struct tunable_atomic_notifier_block panic_block = {
> +	.nb		= &panic_block_base
>  };
>  
>  /*
> @@ -310,5 +314,6 @@ __init void spawn_softlockup_task(void)
>  	cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
>  	register_cpu_notifier(&cpu_nfb);
>  
> -	atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
> +	tunable_atomic_notifier_chain_register(&panic_notifier_list,
> +					&panic_block, "softlockup", NULL);
>  }
> 
> 

-- 
+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+
NEC コンピュータソフトウェア事業本部
            OSSプラットフォーム開発本部

        永野 武則 (Takenori Nagano)

TEL:8-23-57969(MyLine) 042-333-5383(外線)
e-mail:t-nagano@...jp.nec.com
+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ