aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/troubleshoot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/kernel/troubleshoot.c')
-rw-r--r--arch/arc/kernel/troubleshoot.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c
index 11c301b81c92..73a7450ee622 100644
--- a/arch/arc/kernel/troubleshoot.c
+++ b/arch/arc/kernel/troubleshoot.c
@@ -101,7 +101,7 @@ static void show_faulting_vma(unsigned long address, char *buf)
101 if (file) { 101 if (file) {
102 struct path *path = &file->f_path; 102 struct path *path = &file->f_path;
103 nm = d_path(path, buf, PAGE_SIZE - 1); 103 nm = d_path(path, buf, PAGE_SIZE - 1);
104 inode = vma->vm_file->f_path.dentry->d_inode; 104 inode = file_inode(vma->vm_file);
105 dev = inode->i_sb->s_dev; 105 dev = inode->i_sb->s_dev;
106 ino = inode->i_ino; 106 ino = inode->i_ino;
107 } 107 }
@@ -117,23 +117,22 @@ static void show_faulting_vma(unsigned long address, char *buf)
117 117
118static void show_ecr_verbose(struct pt_regs *regs) 118static void show_ecr_verbose(struct pt_regs *regs)
119{ 119{
120 unsigned int vec, cause_code, cause_reg; 120 unsigned int vec, cause_code;
121 unsigned long address; 121 unsigned long address;
122 122
123 cause_reg = current->thread.cause_code; 123 pr_info("\n[ECR ]: 0x%08lx => ", regs->event);
124 pr_info("\n[ECR ]: 0x%08x => ", cause_reg);
125 124
126 /* For Data fault, this is data address not instruction addr */ 125 /* For Data fault, this is data address not instruction addr */
127 address = current->thread.fault_address; 126 address = current->thread.fault_address;
128 127
129 vec = cause_reg >> 16; 128 vec = regs->ecr_vec;
130 cause_code = (cause_reg >> 8) & 0xFF; 129 cause_code = regs->ecr_cause;
131 130
132 /* For DTLB Miss or ProtV, display the memory involved too */ 131 /* For DTLB Miss or ProtV, display the memory involved too */
133 if (vec == ECR_V_DTLB_MISS) { 132 if (vec == ECR_V_DTLB_MISS) {
134 pr_cont("Invalid %s 0x%08lx by insn @ 0x%08lx\n", 133 pr_cont("Invalid %s @ 0x%08lx by insn @ 0x%08lx\n",
135 (cause_code == 0x01) ? "Read From" : 134 (cause_code == 0x01) ? "Read" :
136 ((cause_code == 0x02) ? "Write to" : "EX"), 135 ((cause_code == 0x02) ? "Write" : "EX"),
137 address, regs->ret); 136 address, regs->ret);
138 } else if (vec == ECR_V_ITLB_MISS) { 137 } else if (vec == ECR_V_ITLB_MISS) {
139 pr_cont("Insn could not be fetched\n"); 138 pr_cont("Insn could not be fetched\n");
@@ -144,14 +143,12 @@ static void show_ecr_verbose(struct pt_regs *regs)
144 } else if (vec == ECR_V_PROTV) { 143 } else if (vec == ECR_V_PROTV) {
145 if (cause_code == ECR_C_PROTV_INST_FETCH) 144 if (cause_code == ECR_C_PROTV_INST_FETCH)
146 pr_cont("Execute from Non-exec Page\n"); 145 pr_cont("Execute from Non-exec Page\n");
147 else if (cause_code == ECR_C_PROTV_LOAD)
148 pr_cont("Read from Non-readable Page\n");
149 else if (cause_code == ECR_C_PROTV_STORE)
150 pr_cont("Write to Non-writable Page\n");
151 else if (cause_code == ECR_C_PROTV_XCHG)
152 pr_cont("Data exchange protection violation\n");
153 else if (cause_code == ECR_C_PROTV_MISALIG_DATA) 146 else if (cause_code == ECR_C_PROTV_MISALIG_DATA)
154 pr_cont("Misaligned r/w from 0x%08lx\n", address); 147 pr_cont("Misaligned r/w from 0x%08lx\n", address);
148 else
149 pr_cont("%s access not allowed on page\n",
150 (cause_code == 0x01) ? "Read" :
151 ((cause_code == 0x02) ? "Write" : "EX"));
155 } else if (vec == ECR_V_INSN_ERR) { 152 } else if (vec == ECR_V_INSN_ERR) {
156 pr_cont("Illegal Insn\n"); 153 pr_cont("Illegal Insn\n");
157 } else { 154 } else {
@@ -176,8 +173,7 @@ void show_regs(struct pt_regs *regs)
176 print_task_path_n_nm(tsk, buf); 173 print_task_path_n_nm(tsk, buf);
177 show_regs_print_info(KERN_INFO); 174 show_regs_print_info(KERN_INFO);
178 175
179 if (current->thread.cause_code) 176 show_ecr_verbose(regs);
180 show_ecr_verbose(regs);
181 177
182 pr_info("[EFA ]: 0x%08lx\n[BLINK ]: %pS\n[ERET ]: %pS\n", 178 pr_info("[EFA ]: 0x%08lx\n[BLINK ]: %pS\n[ERET ]: %pS\n",
183 current->thread.fault_address, 179 current->thread.fault_address,
@@ -213,10 +209,9 @@ void show_regs(struct pt_regs *regs)
213} 209}
214 210
215void show_kernel_fault_diag(const char *str, struct pt_regs *regs, 211void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
216 unsigned long address, unsigned long cause_reg) 212 unsigned long address)
217{ 213{
218 current->thread.fault_address = address; 214 current->thread.fault_address = address;
219 current->thread.cause_code = cause_reg;
220 215
221 /* Caller and Callee regs */ 216 /* Caller and Callee regs */
222 show_regs(regs); 217 show_regs(regs);