[Fastboot] [PATCH] kexec uses incorrect nmi handler on x86/x86_64 V2

Vivek Goyal vgoyal at in.ibm.com
Tue May 2 21:55:59 CEST 2006


On Tue, May 02, 2006 at 03:16:10PM -0400, Don Zickus wrote:
> -static int crash_nmi_callback(struct pt_regs *regs, int cpu)
> +int crash_nmi_exceptions_notify(struct notifier_block *self,
> +				unsigned long val, void *data)
>  {
> +	struct die_args *args = (struct die_args *)data;
>  	struct pt_regs fixed_regs;
> -
> -	/* Don't do anything if this handler is invoked on crashing cpu.
> -	 * Otherwise, system will completely hang. Crashing cpu can get
> -	 * an NMI if system was initially booted with nmi_watchdog parameter.
> -	 */
> -	if (cpu == crashing_cpu)
> -		return 1;
> -	local_irq_disable();
> -
> -	if (!user_mode_vm(regs)) {
> -		crash_fixup_ss_esp(&fixed_regs, regs);
> -		regs = &fixed_regs;
> +	int cpu = smp_processor_id();
> +	int ret = NOTIFY_DONE;
> +	
> +	switch(val) {
> +	case DIE_NMI_IPI:
> +		/*
> +		 * Don't do anything if this handler is invoked on crashing cpu.
> +		 * Otherwise, system will completely hang. Crashing cpu can get
> +		 * an NMI if system was initially booted with nmi_watchdog parameter.
> +		 */
> +		if (cpu == crashing_cpu)
> +			return NOTIFY_STOP;

I guess this check can be moved out of the switch(). Irrespective of,
kind of NMI at this juncture, we don't want to handle it now at crashing cpu.
Same is true for x86_64 case.

Thanks
Vivek



More information about the discuss mailing list