Skip to contentSkip to conversation

fix an IA64 MCA kdump bug in kdump_init_notifier

PATCH In review Jay Lan 3 participants 4 messages Mar 20, 2007

lore
Share & tools
lore

Jay Lan

author
#0 lore raw

PATCH 1/1 fix an IA64 MCA kdump bug in kdump_init_notifier

In my original patch to support MCA in kdump, changes were made to kdump_init_notifier() of arch/ia64/kernel/crash.c. But one change was somehow incorrectly modified in 2.6.20 to as below:

Quoted 3 lines
       if ((val == DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
                nd->sos->rv_rc == 1)
               return NOTIFY_DONE;

Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc ==1" is always evaluated. The kdump kernel aborted because nd->sos is NULL in (at least some) MCA cases.

This patch corrects the problem. It was created against 2.6.21-rc4.

arch/ia64/kernel/crash.c +1 -1
Index: linux/arch/ia64/kernel/crash.c
===================================================================
@@ -164,7 +164,7 @@ kdump_init_notifier(struct notifier_bloc
 
 	nd = (struct ia64_mca_notify_die *)args->err;
 	/* Reason code 1 means machine check rendezous*/
-	if ((val == DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
+	if ((val == DIE_INIT_MONARCH_ENTER || val == DIE_INIT_SLAVE_ENTER) &&
 		 nd->sos->rv_rc == 1)
 		return NOTIFY_DONE;
 
#1 lore raw
Quoted 8 lines · Jay Lan

In my original patch to support MCA in kdump, changes were made to kdump_init_notifier() of arch/ia64/kernel/crash.c. But one change was somehow incorrectly modified in 2.6.20 to as below:

Quoted 3 lines
       if ((val = DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
                nd->sos->rv_rc = 1)
               return NOTIFY_DONE;
Quoted 5 lines

Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc =1" is always evaluated. The kdump kernel aborted because nd->sos is NULL in (at least some) MCA cases.

This patch corrects the problem. It was created against 2.6.21-rc4.

Hi Jay,

I think that your fix below does correct a problem,
in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus. But if you are worried about nd->sos being NULL, is it worth checking for that explicitly. Or will it always be non-NULL with the code below?

Quoted 16 lines

Index: linux/arch/ia64/kernel/crash.c
=================================> --- linux.orig/arch/ia64/kernel/crash.c 2007-03-15 17:20:01.000000000 -0700
+++ linux/arch/ia64/kernel/crash.c 2007-03-19 17:27:42.102401208 -0700

arch/ia64/kernel/crash.c +1 -1
@@ -164,7 +164,7 @@ kdump_init_notifier(struct notifier_bloc
 
 	nd = (struct ia64_mca_notify_die *)args->err;
 	/* Reason code 1 means machine check rendezous*/
-	if ((val = DIE_INIT_MONARCH_ENTER || DIE_INIT_SLAVE_ENTER) &&
+	if ((val = DIE_INIT_MONARCH_ENTER || val = DIE_INIT_SLAVE_ENTER) &&
 		 nd->sos->rv_rc = 1)
 		return NOTIFY_DONE;
 
Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/
#2 lore raw
In reply to Jay Lan
Quoted 9 lines · Horms (on Tue, 20 Mar 2007 11:34:28 +0900) wrote:
Quoted 3 lines · Jay Lan

Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc =1" is always evaluated. The kdump kernel aborted because nd->sos is NULL in (at least some) MCA cases.

I think that your fix below does correct a problem,
in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus. But if you are worried about nd->sos being NULL, is it worth checking for that explicitly. Or will it always be non-NULL with the code below?

nd->sos is only (and always) defined for the MCA/INIT SAL to OS handlers. nd->sos is NULL for events such as MCA rendezvous interrupt, since that event runs on the normal kernel stack.

Acked-by on v1 1/1
#3 lore raw
In reply to Jay Lan
Quoted 6 lines · Keith Owens
Quoted 5 lines · Horms (on Tue, 20 Mar 2007 11:34:28 +0900) wrote:
Quoted 3 lines · Jay Lan

Since DIE_INIT_SLAVE_ENTER is a non-zero value, thus "nd->sos->rv_rc =1" is always evaluated. The kdump kernel aborted because nd->sos is NULL in (at least some) MCA cases.

Quoted 8 lines
Quoted 4 lines

I think that your fix below does correct a problem,
in that "|| DIE_INIT_SLAVE_ENTER" appears to be quite bogus. But if you are worried about nd->sos being NULL, is it worth checking for that explicitly. Or will it always be non-NULL with the code below?

nd->sos is only (and always) defined for the MCA/INIT SAL to OS handlers. nd->sos is NULL for events such as MCA rendezvous interrupt, since that event runs on the normal kernel stack.

Thanks for the clarification.

In that case.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/