ACPI/APEI: Clear GHES block_status before panic()
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.
--- drivers/acpi/apei/ghes.c | 2 ++ 1 file changed, 2 insertions(+)
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 · 1 line
1.8.3.1
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 callingpanic()to prevent a secondpanic()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.Signed-off-by Lenny Szubowicz <[email protected]>Signed-off-by David Arcari <[email protected]>
Good catch!
+ 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 callingpanic()to prevent a secondpanic()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.Signed-off-by Lenny Szubowicz <[email protected]>Signed-off-by David Arcari <[email protected]>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
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.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 callingpanic()to prevent a secondpanic()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.Signed-off-by Lenny Szubowicz <[email protected]>Signed-off-by David Arcari <[email protected]>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@@ -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;Acked-by Borislav Petkov <[email protected]>
Patch applied, thanks!
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 callingpanic()to prevent a secondpanic()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@@ -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;Acked-by Borislav Petkov <[email protected]>
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
Borislav Petkov
reviewerQuoted 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.