Skip to contentSkip to conversation

powerpc/mce: save ignore_event flag unconditionally for UE

PATCH Applied Ganesh Goudar 3 participants 8 messages Apr 7, 2021 – Apr 22, 2021 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mce: save ignore_event flag unconditionally for UE

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
---
 arch/powerpc/kernel/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/mce.c +2 -1
index 11f0cae086ed..db9363e131ce 100644
@@ -131,6 +131,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
 	 * Populate the mce error_type and type-specific error_type.
 	 */
 	mce_set_error_info(mce, mce_err);
+	if (mce->error_type == MCE_ERROR_TYPE_UE)
+		mce->u.ue_error.ignore_event = mce_err->ignore_event;
 
 	if (!addr)
 		return;
@@ -159,7 +161,6 @@ void save_mce_event(struct pt_regs *regs, long handled,
 		if (phys_addr != ULONG_MAX) {
 			mce->u.ue_error.physical_address_provided = true;
 			mce->u.ue_error.physical_address = phys_addr;
-			mce->u.ue_error.ignore_event = mce_err->ignore_event;
 			machine_check_ue_event(mce);
 		}
 	}
Signature · 1 line
2.26.2
#1 lore raw

Hi Ganesh,

Quoted 41 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
---
 arch/powerpc/kernel/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/mce.c +2 -0
index 11f0cae086ed..db9363e131ce 100644
@@ -131,6 +131,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
 	 * Populate the mce error_type and type-specific error_type.
 	 */
 	mce_set_error_info(mce, mce_err);
+	if (mce->error_type == MCE_ERROR_TYPE_UE)
+		mce->u.ue_error.ignore_event = mce_err->ignore_event;
 
 	if (!addr)
 		return;

arch/powerpc/kernel/mce.c void save_mce_event(struct pt_regs *regs, long handled, · line 166

Quoted 7 lines
arch/powerpc/kernel/mce.c +0 -1
@@ -159,7 +161,6 @@ void save_mce_event(struct pt_regs *regs, long handled,
 		if (phys_addr != ULONG_MAX) {
 			mce->u.ue_error.physical_address_provided = true;
 			mce->u.ue_error.physical_address = phys_addr;
-			mce->u.ue_error.ignore_event = mce_err->ignore_event;
 			machine_check_ue_event(mce);
 		}
 	}

Small nit:
Setting ignore event can happen before the phys_addr check, under the existing check for MCE_ERROR_TYPE_UE, instead of repeating the same condition again.

Except for the above nit

Thanks,
Santosh

Quoted 2 lines
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ganesh Goudar

Hi Ganesh,

Quoted 41 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
---
 arch/powerpc/kernel/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/mce.c +2 -0
index 11f0cae086ed..db9363e131ce 100644
@@ -131,6 +131,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
 	 * Populate the mce error_type and type-specific error_type.
 	 */
 	mce_set_error_info(mce, mce_err);
+	if (mce->error_type == MCE_ERROR_TYPE_UE)
+		mce->u.ue_error.ignore_event = mce_err->ignore_event;
 
 	if (!addr)
 		return;

arch/powerpc/kernel/mce.c void save_mce_event(struct pt_regs *regs, long handled, · line 166

Quoted 7 lines
arch/powerpc/kernel/mce.c +0 -1
@@ -159,7 +161,6 @@ void save_mce_event(struct pt_regs *regs, long handled,
 		if (phys_addr != ULONG_MAX) {
 			mce->u.ue_error.physical_address_provided = true;
 			mce->u.ue_error.physical_address = phys_addr;
-			mce->u.ue_error.ignore_event = mce_err->ignore_event;
 			machine_check_ue_event(mce);
 		}
 	}

Small nit:
Setting ignore event can happen before the phys_addr check, under the existing check for MCE_ERROR_TYPE_UE, instead of repeating the same condition again.

Except for the above nit

Thanks,
Santosh

Quoted 2 lines
Signature · 1 line
2.26.2
author
#3 lore raw
Quoted 42 lines · Santosh Sivaraj

Hi Ganesh,

Quoted 38 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
---
  arch/powerpc/kernel/mce.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/mce.c +2 -0
index 11f0cae086ed..db9363e131ce 100644
@@ -131,6 +131,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
  	 * Populate the mce error_type and type-specific error_type.
  	 */
  	mce_set_error_info(mce, mce_err);
+	if (mce->error_type == MCE_ERROR_TYPE_UE)
+		mce->u.ue_error.ignore_event = mce_err->ignore_event;
 
Quoted 13 lines

arch/powerpc/kernel/mce.c void save_mce_event(struct pt_regs *regs, long handled, · line 166

Quoted 10 lines
arch/powerpc/kernel/mce.c +0 -1
  	if (!addr)
  		return;
@@ -159,7 +161,6 @@ void save_mce_event(struct pt_regs *regs, long handled,
  		if (phys_addr != ULONG_MAX) {
  			mce->u.ue_error.physical_address_provided = true;
  			mce->u.ue_error.physical_address = phys_addr;
-			mce->u.ue_error.ignore_event = mce_err->ignore_event;
  			machine_check_ue_event(mce);
  		}
  	}

Small nit:
Setting ignore event can happen before the phys_addr check, under the existing check for MCE_ERROR_TYPE_UE, instead of repeating the same condition again.

In some cases we may not get effective address also, so it is placed before effective address check.

Quoted 9 lines

Except for the above nit

Thanks,
Santosh

Quoted 2 lines
Signature · 1 line
2.26.2
#4 lore raw
Quoted 58 lines · Ganesh
Quoted 42 lines · Santosh Sivaraj

Hi Ganesh,

Quoted 38 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
---
  arch/powerpc/kernel/mce.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/kernel/mce.c +2 -0
index 11f0cae086ed..db9363e131ce 100644
@@ -131,6 +131,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
  	 * Populate the mce error_type and type-specific error_type.
  	 */
  	mce_set_error_info(mce, mce_err);
+	if (mce->error_type == MCE_ERROR_TYPE_UE)
+		mce->u.ue_error.ignore_event = mce_err->ignore_event;
 
Quoted 13 lines

arch/powerpc/kernel/mce.c void save_mce_event(struct pt_regs *regs, long handled, · line 166

Quoted 10 lines
arch/powerpc/kernel/mce.c +0 -1
  	if (!addr)
  		return;
@@ -159,7 +161,6 @@ void save_mce_event(struct pt_regs *regs, long handled,
  		if (phys_addr != ULONG_MAX) {
  			mce->u.ue_error.physical_address_provided = true;
  			mce->u.ue_error.physical_address = phys_addr;
-			mce->u.ue_error.ignore_event = mce_err->ignore_event;
  			machine_check_ue_event(mce);
  		}
  	}

Small nit:
Setting ignore event can happen before the phys_addr check, under the existing check for MCE_ERROR_TYPE_UE, instead of repeating the same condition again.

Quoted 2 lines

In some cases we may not get effective address also, so it is placed before effective address check.

Yes, I forgot the last two lines in the changelog after I applied the patch :-)

Thanks,
Santosh

Quoted 10 lines
Quoted 10 lines

Except for the above nit

Thanks,
Santosh

Quoted 2 lines
Signature · 1 line
2.26.2
#5 lore raw
In reply to Ganesh Goudar
Quoted 8 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

[...]

Applied to powerpc/next.

[1/1] powerpc/mce: save ignore_event flag unconditionally for UE

      https://git.kernel.org/powerpc/c/92d9d61be519f32f16c07602db5bcbe30a0836fe

cheers

author
#6 lore raw
In reply to Ganesh Goudar
Quoted 22 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90
[  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered]
[  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90
[  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown
Quoted 5 lines
---
  arch/powerpc/kernel/mce.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

Hi mpe, Any comments on this patch?

author
#7 lore raw
Quoted 24 lines · Ganesh
Quoted 22 lines · Ganesh Goudar

When we hit an UE while using machine check safe copy routines, ignore_event flag is set and the event is ignored by mce handler, And the flag is also saved for defered handling and printing of mce event information, But as of now saving of this flag is done on checking if the effective address is provided or physical address is calculated, which is not right.

Save ignore_event flag regardless of whether the effective address is provided or physical address is calculated.

Without this change following log is seen, when the event is to be ignored.

[  512.971365] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered] [  512.971509] MCE: CPU1: NIP: [c0000000000b67c0] memcpy+0x40/0x90 [  512.971655] MCE: CPU1: Initiator CPU
[  512.971739] MCE: CPU1: Unknown
[  512.972209] MCE: CPU1: machine check (Severe)  UE Load/Store [Recovered] [  512.972334] MCE: CPU1: NIP: [c0000000000b6808] memcpy+0x88/0x90 [  512.972456] MCE: CPU1: Initiator CPU
[  512.972534] MCE: CPU1: Unknown

Quoted 6 lines
Quoted 5 lines

---
  arch/powerpc/kernel/mce.c | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)

Hi mpe, Any comments on this patch?

Please ignore, I see its applied.