ANDROID: fix add vendor hooks for unusual abort cases

Add hooks to check the do_serror can be recover or not.
When PCIe encounters completion timeout, PCIe hardware will
reply slave error to bus, which will causes the system to panic.

Bug: 247846368

Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
Change-Id: Iaef6c9a6ac07e552939c0f8e386213cb930cfb6e
This commit is contained in:
qizhong cheng
2022-08-15 17:56:11 +08:00
committed by Todd Kjos
parent 0fd0345839
commit a89fbc0de0
3 changed files with 12 additions and 0 deletions

View File

@@ -947,6 +947,13 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr)
void do_serror(struct pt_regs *regs, unsigned int esr)
{
int ret = 0;
/* Add vendor hooks for unusual abort cases */
trace_android_rvh_do_serror(regs, esr, &ret);
if (ret != 0)
return;
/* non-RAS errors are not containable */
if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr))
arm64_serror_panic(regs, esr);

View File

@@ -285,6 +285,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_undefinstr);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_ptrauth_fault);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_panic_unhandled);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_arm64_serror_panic);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_serror);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmpressure);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sha256);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_aes_expandkey);

View File

@@ -31,6 +31,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_arm64_serror_panic,
TP_PROTO(struct pt_regs *regs, unsigned int esr),
TP_ARGS(regs, esr), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_do_serror,
TP_PROTO(struct pt_regs *regs, unsigned int esr, int *ret),
TP_ARGS(regs, esr, ret), 1);
#endif /* _TRACE_HOOK_TRAPS_H */
/* This part must be outside protection */
#include <trace/define_trace.h>