mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 19:15:25 +07:00
2874c5fd28
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
87 lines
2.1 KiB
C
87 lines
2.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/printk.h>
|
|
#include <linux/ptrace.h>
|
|
|
|
#include <asm/reg.h>
|
|
|
|
int machine_check_440A(struct pt_regs *regs)
|
|
{
|
|
unsigned long reason = regs->dsisr;
|
|
|
|
printk("Machine check in kernel mode.\n");
|
|
if (reason & ESR_IMCP){
|
|
printk("Instruction Synchronous Machine Check exception\n");
|
|
mtspr(SPRN_ESR, reason & ~ESR_IMCP);
|
|
}
|
|
else {
|
|
u32 mcsr = mfspr(SPRN_MCSR);
|
|
if (mcsr & MCSR_IB)
|
|
printk("Instruction Read PLB Error\n");
|
|
if (mcsr & MCSR_DRB)
|
|
printk("Data Read PLB Error\n");
|
|
if (mcsr & MCSR_DWB)
|
|
printk("Data Write PLB Error\n");
|
|
if (mcsr & MCSR_TLBP)
|
|
printk("TLB Parity Error\n");
|
|
if (mcsr & MCSR_ICP){
|
|
flush_instruction_cache();
|
|
printk("I-Cache Parity Error\n");
|
|
}
|
|
if (mcsr & MCSR_DCSP)
|
|
printk("D-Cache Search Parity Error\n");
|
|
if (mcsr & MCSR_DCFP)
|
|
printk("D-Cache Flush Parity Error\n");
|
|
if (mcsr & MCSR_IMPE)
|
|
printk("Machine Check exception is imprecise\n");
|
|
|
|
/* Clear MCSR */
|
|
mtspr(SPRN_MCSR, mcsr);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
#ifdef CONFIG_PPC_47x
|
|
int machine_check_47x(struct pt_regs *regs)
|
|
{
|
|
unsigned long reason = regs->dsisr;
|
|
u32 mcsr;
|
|
|
|
printk(KERN_ERR "Machine check in kernel mode.\n");
|
|
if (reason & ESR_IMCP) {
|
|
printk(KERN_ERR "Instruction Synchronous Machine Check exception\n");
|
|
mtspr(SPRN_ESR, reason & ~ESR_IMCP);
|
|
return 0;
|
|
}
|
|
mcsr = mfspr(SPRN_MCSR);
|
|
if (mcsr & MCSR_IB)
|
|
printk(KERN_ERR "Instruction Read PLB Error\n");
|
|
if (mcsr & MCSR_DRB)
|
|
printk(KERN_ERR "Data Read PLB Error\n");
|
|
if (mcsr & MCSR_DWB)
|
|
printk(KERN_ERR "Data Write PLB Error\n");
|
|
if (mcsr & MCSR_TLBP)
|
|
printk(KERN_ERR "TLB Parity Error\n");
|
|
if (mcsr & MCSR_ICP) {
|
|
flush_instruction_cache();
|
|
printk(KERN_ERR "I-Cache Parity Error\n");
|
|
}
|
|
if (mcsr & MCSR_DCSP)
|
|
printk(KERN_ERR "D-Cache Search Parity Error\n");
|
|
if (mcsr & PPC47x_MCSR_GPR)
|
|
printk(KERN_ERR "GPR Parity Error\n");
|
|
if (mcsr & PPC47x_MCSR_FPR)
|
|
printk(KERN_ERR "FPR Parity Error\n");
|
|
if (mcsr & PPC47x_MCSR_IPR)
|
|
printk(KERN_ERR "Machine Check exception is imprecise\n");
|
|
|
|
/* Clear MCSR */
|
|
mtspr(SPRN_MCSR, mcsr);
|
|
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_PPC_47x */
|