From 534e799439b0af8f436c69767b5699b317d45606 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Thu, 13 Feb 2020 17:21:51 +0100 Subject: Err-inject: Handle generic sync exception reports This change extends the existing minimal placeholder sample handler for injected synchronous exceptions. It now consumes a generic sync exception report and, showcases how the information can be used to decode the exceptions further using two minimal examples (Data Abort and Instr Abort). This needs to be used only as a reference for any customized elaborate error handling that may be needed. JIRA ESV-312 Bug 2580803 Change-Id: I32cf2322a6002ac00071d3246a32a17eb37165c3 Signed-off-by: Andre Richter (cherry picked from commit 9ce3c05e425607a1acf0a28ea75258fb66f06820) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2300616 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dmitry Pervushin Reviewed-by: Rohit Upadhyay Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- include/linux/errinfo.h | 23 +++++++++++++---------- include/linux/vm_err.h | 4 +--- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'include/linux') diff --git a/include/linux/errinfo.h b/include/linux/errinfo.h index 074208918..5053919b3 100644 --- a/include/linux/errinfo.h +++ b/include/linux/errinfo.h @@ -20,9 +20,7 @@ enum err_reason { REASON_ASYNC_MC, REASON_ASYNC_MC_T19X, REASON_ASYNC_CBB, - REASON_SYNC_INSTR_ABORT, - REASON_SYNC_DATA_ABORT, - REASON_SYNC_OTHER, + REASON_SYNC, REASON_ENUM_SIZE }; @@ -123,15 +121,20 @@ struct __attribute__((__packed__)) async_mc_err_t19x_t { unsigned int write; }; -struct __attribute__((__packed__)) sync_data_abort_t { - bool is_filled; /* metadata field per vcpu */ - bool is_write; - uint8_t access_size; +struct __attribute__((__packed__)) sync_t { + bool is_filled; /* metadata field per vcpu */ unsigned int offending_vcpu_id; - unsigned int esr_el2; - uint64_t fault_addr; + uint32_t esr_el2; + uint64_t elr_el2; + uint64_t far_el2; + uint64_t hpfar_el2; + uint64_t par_hpfar_el2; uint64_t spsr_el2; uint64_t elr_el1; + uint64_t far_el1; + uint64_t spsr_el1; + uint32_t esr_el1; + uint32_t fault_instr; uint64_t gpr_array[31]; }; @@ -147,7 +150,7 @@ struct __attribute__((__packed__)) err_data_t { struct async_cbb_err_t async_cbb_err; struct async_mc_err_t19x_t async_mc_err_t19x; /* Synchronous */ - struct sync_data_abort_t sync_data_abort; + struct sync_t sync; }; }; diff --git a/include/linux/vm_err.h b/include/linux/vm_err.h index bcb3f255e..09e819b92 100644 --- a/include/linux/vm_err.h +++ b/include/linux/vm_err.h @@ -40,9 +40,7 @@ static const char * const tegra_hv_err_reason_desc[] = { "Memory Controller", "Memory Controller T19X", "Central Back Bone", - "Instruction Abort", - "Data Abort", - "Other synchronous exception", + "Synchronous exception", }; int tegra_hv_register_vm_err_hooks(struct tegra_hv_vm_err_handlers *handlers); -- cgit v1.2.2