Skip to contentSkip to conversation

ACPI/APEI: Clear GHES block_status before panic()

PATCH In review David Arcari 5 participants 6 messages Dec 19, 2018 – Dec 21, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI/APEI: Clear GHES block_status before panic()

From: Lenny Szubowicz <[email protected]>

In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error.

Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump.

Cc Rafael J. Wysocki <[email protected]>
Cc Len Brown <[email protected]>
Cc Tony Luck <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Alexandru Gagniuc <[email protected]>
---
 drivers/acpi/apei/ghes.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/apei/ghes.c +2 -0
index 02c6fd9..f008ba7 100644
@@ -691,6 +691,8 @@ static void __ghes_panic(struct ghes *ghes)
 {
 	__ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
 
+	ghes_clear_estatus(ghes);
+
 	/* reboot to log the error! */
 	if (!panic_timeout)
 		panic_timeout = ghes_panic_timeout;
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · David Arcari

From: Lenny Szubowicz <[email protected]>

In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error.

Quoted 6 lines

Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump.

Good catch!

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to David Arcari

+ James.

Quoted 30 lines · David Arcari

From: Lenny Szubowicz <[email protected]>

In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error.

Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump.

Cc Rafael J. Wysocki <[email protected]>
Cc Len Brown <[email protected]>
Cc Tony Luck <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Alexandru Gagniuc <[email protected]>
---
 drivers/acpi/apei/ghes.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/apei/ghes.c +0 -0
index 02c6fd9..f008ba7 100644

drivers/acpi/apei/ghes.c static void __ghes_panic(struct ghes *ghes) · line 698

Quoted 8 lines
drivers/acpi/apei/ghes.c +2 -0
@@ -691,6 +691,8 @@ static void __ghes_panic(struct ghes *ghes)
 {
 	__ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
 
+	ghes_clear_estatus(ghes);
+
 	/* reboot to log the error! */
 	if (!panic_timeout)
 		panic_timeout = ghes_panic_timeout;
Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#3 lore raw
Quoted 35 lines · CET Borislav Petkov

+ James.

Quoted 32 lines · David Arcari

From: Lenny Szubowicz <[email protected]>

In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error.

Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump.

Cc Rafael J. Wysocki <[email protected]>
Cc Len Brown <[email protected]>
Cc Tony Luck <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "Eric W. Biederman" <[email protected]>
Cc Alexandru Gagniuc <[email protected]>
---
 drivers/acpi/apei/ghes.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/apei/ghes.c +0 -0
index 02c6fd9..f008ba7 100644
@@ -691,6 +691,8 @@ static void __ghes_panic(struct ghes *ghes)
 {
 	__ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
 
Quoted 7 lines

drivers/acpi/apei/ghes.c static void __ghes_panic(struct ghes *ghes) · line 698

Quoted 5 lines
drivers/acpi/apei/ghes.c +2 -0
+	ghes_clear_estatus(ghes);
+
 	/* reboot to log the error! */
 	if (!panic_timeout)
 		panic_timeout = ghes_panic_timeout;

Patch applied, thanks!

#4 lore raw
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · CET Borislav Petkov

+ James.

Thanks,

Quoted 11 lines
Quoted 11 lines · David Arcari
Quoted 10 lines

From: Lenny Szubowicz <[email protected]>

In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error.

Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump.

I bet that was fun to watch!

Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
drivers/acpi/apei/ghes.c +0 -0
index 02c6fd9..f008ba7 100644
@@ -691,6 +691,8 @@ static void __ghes_panic(struct ghes *ghes)
 {
 	__ghes_print_estatus(KERN_EMERG, ghes->generic, ghes->estatus);
 
Quoted 7 lines

drivers/acpi/apei/ghes.c static void __ghes_panic(struct ghes *ghes) · line 698

Quoted 5 lines
drivers/acpi/apei/ghes.c +2 -0
+	ghes_clear_estatus(ghes);
+
 	/* reboot to log the error! */
 	if (!panic_timeout)
 		panic_timeout = ghes_panic_timeout;
Quoted 1 line

Patch applied, thanks!

Great!

Do we need to ghes_ack_error() too?

With the location cleared the new kernel will never find the records, and firmware can never re-use that location because it wasn't ack'd. The upshot is RAS records can't be generated for the kdump kernel. The acpi spec talks about use of the memory, so I don't think its fair for it to use this to disarm a watchdog.

I think we can live with this as the kdump kernel isn't going to handle RAS errors for the bulk of memory anyway.

Thanks,

James

#5 lore raw
Quoted 1 line · James Morse

Do we need to ghes_ack_error() too?

That's GHES v2 AFAICT.

Quoted 8 lines

With the location cleared the new kernel will never find the records, and firmware can never re-use that location because it wasn't ack'd. The upshot is RAS records can't be generated for the kdump kernel. The acpi spec talks about use of the memory, so I don't think its fair for it to use this to disarm a watchdog.

I think we can live with this as the kdump kernel isn't going to handle RAS errors for the bulk of memory anyway.

Usually, handling hw errors is always better than not but the second kernel can't do anything better in that respect than the first, right? If it panics, it panics - no matter the kernel. Generally.

Therefore I think the role of the second kernel should be to be as resilient as possible to hw errors - like, not even see them :-) - dump the memory of the first kernel as quickly as possible and reboot for analysis.

IMHO, of course.

Signature · 4 lines
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.