浏览代码

powerpc/book3s: Introduce a early machine check hook in cpu_spec.

This patch adds the early machine check function pointer in cputable for
CPU specific early machine check handling. The early machine handle routine
will be called in real mode to handle SLB and TLB errors. We can not reuse
the existing machine_check hook because it is always invoked in kernel
virtual mode and we would already be in trouble if we get SLB or TLB errors.
This patch just sets up a mechanism to invoke CPU specific handler. The
subsequent patches will populate the function pointer.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Mahesh Salgaonkar 11 年之前
父节点
当前提交
4c703416ef
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 7 0
      arch/powerpc/include/asm/cputable.h
  2. 5 2
      arch/powerpc/kernel/traps.c

+ 7 - 0
arch/powerpc/include/asm/cputable.h

@@ -90,6 +90,13 @@ struct cpu_spec {
 	 * if the error is fatal, 1 if it was fully recovered and 0 to
 	 * if the error is fatal, 1 if it was fully recovered and 0 to
 	 * pass up (not CPU originated) */
 	 * pass up (not CPU originated) */
 	int		(*machine_check)(struct pt_regs *regs);
 	int		(*machine_check)(struct pt_regs *regs);
+
+	/*
+	 * Processor specific early machine check handler which is
+	 * called in real mode to handle SLB and TLB errors.
+	 */
+	long		(*machine_check_early)(struct pt_regs *regs);
+
 };
 };
 
 
 extern struct cpu_spec		*cur_cpu_spec;
 extern struct cpu_spec		*cur_cpu_spec;

+ 5 - 2
arch/powerpc/kernel/traps.c

@@ -293,8 +293,11 @@ void system_reset_exception(struct pt_regs *regs)
  */
  */
 long machine_check_early(struct pt_regs *regs)
 long machine_check_early(struct pt_regs *regs)
 {
 {
-	/* TODO: handle/decode machine check reason */
-	return 0;
+	long handled = 0;
+
+	if (cur_cpu_spec && cur_cpu_spec->machine_check_early)
+		handled = cur_cpu_spec->machine_check_early(regs);
+	return handled;
 }
 }
 
 
 #endif
 #endif