[PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe goes down. when the link goes down, Non-posted transactions issued via the ATMU requiring completion result in an instruction stall. At the same time a machine-check exception is generated to the core to allow further processing by the handler. We implements the handler which skips the instruction caused the stall. This patch depends on patch: powerpc/85xx: Add platform_device declaration to fsl_pci.h Signed-off-by: Zhao Chenhui Signed-off-by: Li Yang Signed-off-by: Liu Shuo Signed-off-by: Jia Hongtao --- V8: * Add A variant load instruction emulation. V7: * Correct PCIe checking method (Using indirect_type member of pci_controller stucture). V6: * Move OP and XOP defines to a new header file: asm/ppc-disassemble.h * Add X UX BRX variant of load instruction emulation * Remove A variant of load instruction emulation V5: * Fill rd with all-Fs if the skipped instruction is load and emulate the instruction. * Let KVM/QEMU deal with the exception if the machine check comes from KVM. arch/powerpc/kernel/cpu_setup_fsl_booke.S | 2 +- arch/powerpc/kernel/traps.c | 3 + arch/powerpc/sysdev/fsl_pci.c | 158 ++ arch/powerpc/sysdev/fsl_pci.h | 6 ++ 4 files changed, 168 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index 0b9af01..bfb18c7 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S @@ -75,7 +75,7 @@ _GLOBAL(__setup_cpu_e500v2) bl __e500_icache_setup bl __e500_dcache_setup bl __setup_e500_ivors -#ifdef CONFIG_FSL_RIO +#if defined(CONFIG_FSL_RIO) || defined(CONFIG_FSL_PCI) /* Ensure that RFXE is set */ mfspr r3,SPRN_HID1 orisr3,r3,HID1_RFXE@h diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 37cc40e..d15cfb5 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -60,6 +60,7 @@ #include #include #include +#include #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) int (*__debugger)(struct pt_regs *regs) __read_mostly; @@ -565,6 +566,8 @@ int machine_check_e500(struct pt_regs *regs) if (reason & MCSR_BUS_RBERR) { if (fsl_rio_mcheck_exception(regs)) return 1; + if (fsl_pci_mcheck_exception(regs)) + return 1; } printk("Machine check in kernel mode.\n"); diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 40ffe29..5fa851a 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -26,11 +26,15 @@ #include #include #include +#include #include #include #include +#include #include +#include +#include #include #include @@ -876,6 +880,160 @@ u64 fsl_pci_immrbar_base(struct pci_controller *hose) return 0; } +#ifdef CONFIG_E500 +static int mcheck_handle_load(struct pt_regs *regs, u32 inst) +{ + unsigned int rd, ra, rb, d; + + rd = get_rt(inst); + ra = get_ra(inst); + rb = get_rb(inst); + d = get_d(inst); + + switch (get_op(inst)) { + case 31: + switch (get_xop(inst)) { + case OP_31_XOP_LWZX: + case OP_31_XOP_LWBRX: + regs->gpr[rd] = 0x; + break; + + case OP_31_XOP_LWZUX: + regs->gpr[rd] = 0x; + regs->gpr[ra] += regs->gpr[rb]; + break; + + case OP_31_XOP_LBZX: + regs->gpr[rd] = 0xff; + break; + + case OP_31_XOP_LBZUX: + regs->gpr[rd] = 0xff; + regs->gpr[ra] += regs->gpr[rb]; + break; + + case OP_31_XOP_LHZX: + case OP_31_XOP_LHBRX: + regs->gpr[rd] = 0x; + break; + + case OP_31_XOP_LHZUX: + regs->gpr[rd] = 0x; + regs->gpr[ra] += regs->gpr[rb]; + break; + + case OP_31_XOP_LHAX: + regs->gpr[rd] = ~0UL; + break; + + case OP_31_XOP_LHAUX: + regs->gpr[rd] = ~0UL; + regs->gpr[ra] += regs->gpr[rb]; + break; + + default: + return 0; + } + break; + + case OP_LWZ: + regs->gpr[rd] = 0x; + break; + + case OP_LWZU: + regs->gpr[rd] = 0x; + regs->gpr[ra] += (s16)d; + break; + + case OP_LBZ: + regs->gpr[rd] = 0xff
Re: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
On 04/28/2013 12:20:08 AM, Jia Hongtao wrote: A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe goes down. when the link goes down, Non-posted transactions issued via the ATMU requiring completion result in an instruction stall. At the same time a machine-check exception is generated to the core to allow further processing by the handler. We implements the handler which skips the instruction caused the stall. This patch depends on patch: powerpc/85xx: Add platform_device declaration to fsl_pci.h Signed-off-by: Zhao Chenhui Signed-off-by: Li Yang Signed-off-by: Liu Shuo Signed-off-by: Jia Hongtao --- V8: * Add A variant load instruction emulation. ACK -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
> -Original Message- > From: Wood Scott-B07421 > Sent: Friday, May 03, 2013 1:04 AM > To: Jia Hongtao-B38951 > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; Wood Scott- > B07421; seg...@kernel.crashing.org; Li Yang-R58472; Jia Hongtao-B38951 > Subject: Re: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to > fix PCIe erratum on mpc85xx > > On 04/28/2013 12:20:08 AM, Jia Hongtao wrote: > > A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe > > goes down. when the link goes down, Non-posted transactions issued via > > the ATMU requiring completion result in an instruction stall. > > At the same time a machine-check exception is generated to the core to > > allow further processing by the handler. We implements the handler > > which skips the instruction caused the stall. > > > > This patch depends on patch: > > powerpc/85xx: Add platform_device declaration to fsl_pci.h > > > > Signed-off-by: Zhao Chenhui > > Signed-off-by: Li Yang > > Signed-off-by: Liu Shuo > > Signed-off-by: Jia Hongtao > > --- > > V8: > > * Add A variant load instruction emulation. > > ACK > > -Scott Thanks for the review. Hi Kumar, Could you please review these MSI and PCI hang errata patches? http://patchwork.ozlabs.org/patch/233211/ http://patchwork.ozlabs.org/patch/235276/ http://patchwork.ozlabs.org/patch/240238/ http://patchwork.ozlabs.org/patch/240239/ (This patch) Thanks. -Hongtao ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
> > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, May 03, 2013 1:04 AM > > To: Jia Hongtao-B38951 > > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; Wood > > Scott- B07421; seg...@kernel.crashing.org; Li Yang-R58472; Jia > > Hongtao-B38951 > > Subject: Re: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to > > fix PCIe erratum on mpc85xx > > > > On 04/28/2013 12:20:08 AM, Jia Hongtao wrote: > > > A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe > > > goes down. when the link goes down, Non-posted transactions issued > > > via the ATMU requiring completion result in an instruction stall. > > > At the same time a machine-check exception is generated to the core > > > to allow further processing by the handler. We implements the > > > handler which skips the instruction caused the stall. > > > > > > This patch depends on patch: > > > powerpc/85xx: Add platform_device declaration to fsl_pci.h > > > > > > Signed-off-by: Zhao Chenhui > > > Signed-off-by: Li Yang > > > Signed-off-by: Liu Shuo > > > Signed-off-by: Jia Hongtao > > > --- > > > V8: > > > * Add A variant load instruction emulation. > > > > ACK > > > > -Scott > > Thanks for the review. > > Hi Kumar, > > Could you please review these MSI and PCI hang errata patches? > http://patchwork.ozlabs.org/patch/233211/ > http://patchwork.ozlabs.org/patch/235276/ > http://patchwork.ozlabs.org/patch/240238/ > http://patchwork.ozlabs.org/patch/240239/ (This patch) > > Thanks. > -Hongtao Hi Kumar, I'm really appreciated if you have time to review these patches? Thanks. -Hongtao ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
Hi Ben, These four patches have been reviewed for a long time and look good to Scott Wood. It seems Kumar have no enough time for further review. Could you please help me to review them? http://patchwork.ozlabs.org/patch/233211/ http://patchwork.ozlabs.org/patch/235276/ http://patchwork.ozlabs.org/patch/240238/ http://patchwork.ozlabs.org/patch/240239/ Thanks. -Hongtao > -Original Message- > From: Jia Hongtao-B38951 > Sent: Friday, May 10, 2013 12:01 PM > To: ga...@kernel.crashing.org > Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Jia Hongtao-B38951 > Subject: RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to > fix PCIe erratum on mpc85xx > > > > -Original Message- > > > From: Wood Scott-B07421 > > > Sent: Friday, May 03, 2013 1:04 AM > > > To: Jia Hongtao-B38951 > > > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; Wood > > > Scott- B07421; seg...@kernel.crashing.org; Li Yang-R58472; Jia > > > Hongtao-B38951 > > > Subject: Re: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler > > > to fix PCIe erratum on mpc85xx > > > > > > On 04/28/2013 12:20:08 AM, Jia Hongtao wrote: > > > > A PCIe erratum of mpc85xx may causes a core hang when a link of > > > > PCIe goes down. when the link goes down, Non-posted transactions > > > > issued via the ATMU requiring completion result in an instruction > stall. > > > > At the same time a machine-check exception is generated to the > > > > core to allow further processing by the handler. We implements the > > > > handler which skips the instruction caused the stall. > > > > > > > > This patch depends on patch: > > > > powerpc/85xx: Add platform_device declaration to fsl_pci.h > > > > > > > > Signed-off-by: Zhao Chenhui > > > > Signed-off-by: Li Yang > > > > Signed-off-by: Liu Shuo > > > > Signed-off-by: Jia Hongtao > > > > --- > > > > V8: > > > > * Add A variant load instruction emulation. > > > > > > ACK > > > > > > -Scott > > > > Thanks for the review. > > > > Hi Kumar, > > > > Could you please review these MSI and PCI hang errata patches? > > http://patchwork.ozlabs.org/patch/233211/ > > http://patchwork.ozlabs.org/patch/235276/ > > http://patchwork.ozlabs.org/patch/240238/ > > http://patchwork.ozlabs.org/patch/240239/ (This patch) > > > > Thanks. > > -Hongtao > > Hi Kumar, > > I'm really appreciated if you have time to review these patches? > > Thanks. > -Hongtao ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx
Hi Ben and Kumar, I'm really appreciate if you could help me to review this patches for these patches were pending nearly a month. Thanks. -Hongtao > -Original Message- > From: Jia Hongtao-B38951 > Sent: Monday, May 13, 2013 2:20 PM > To: 'Benjamin Herrenschmidt' > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; Wood Scott- > B07421; Li Yang-R58472; Jia Hongtao-B38951 > Subject: RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to > fix PCIe erratum on mpc85xx > > Hi Ben, > > These four patches have been reviewed for a long time > and look good to Scott Wood. > It seems Kumar have no enough time for further review. > Could you please help me to review them? > > http://patchwork.ozlabs.org/patch/233211/ > http://patchwork.ozlabs.org/patch/235276/ > http://patchwork.ozlabs.org/patch/240238/ > http://patchwork.ozlabs.org/patch/240239/ > > Thanks. > -Hongtao > > > -Original Message- > > From: Jia Hongtao-B38951 > > Sent: Friday, May 10, 2013 12:01 PM > > To: ga...@kernel.crashing.org > > Cc: linuxppc-dev@lists.ozlabs.org; Li Yang-R58472; Jia Hongtao-B38951 > > Subject: RE: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler to > > fix PCIe erratum on mpc85xx > > > > > > -Original Message- > > > > From: Wood Scott-B07421 > > > > Sent: Friday, May 03, 2013 1:04 AM > > > > To: Jia Hongtao-B38951 > > > > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; Wood > > > > Scott- B07421; seg...@kernel.crashing.org; Li Yang-R58472; Jia > > > > Hongtao-B38951 > > > > Subject: Re: [PATCH 2/2 V8] powerpc/85xx: Add machine check handler > > > > to fix PCIe erratum on mpc85xx > > > > > > > > On 04/28/2013 12:20:08 AM, Jia Hongtao wrote: > > > > > A PCIe erratum of mpc85xx may causes a core hang when a link of > > > > > PCIe goes down. when the link goes down, Non-posted transactions > > > > > issued via the ATMU requiring completion result in an instruction > > stall. > > > > > At the same time a machine-check exception is generated to the > > > > > core to allow further processing by the handler. We implements > the > > > > > handler which skips the instruction caused the stall. > > > > > > > > > > This patch depends on patch: > > > > > powerpc/85xx: Add platform_device declaration to fsl_pci.h > > > > > > > > > > Signed-off-by: Zhao Chenhui > > > > > Signed-off-by: Li Yang > > > > > Signed-off-by: Liu Shuo > > > > > Signed-off-by: Jia Hongtao > > > > > --- > > > > > V8: > > > > > * Add A variant load instruction emulation. > > > > > > > > ACK > > > > > > > > -Scott > > > > > > Thanks for the review. > > > > > > Hi Kumar, > > > > > > Could you please review these MSI and PCI hang errata patches? > > > http://patchwork.ozlabs.org/patch/233211/ > > > http://patchwork.ozlabs.org/patch/235276/ > > > http://patchwork.ozlabs.org/patch/240238/ > > > http://patchwork.ozlabs.org/patch/240239/ (This patch) > > > > > > Thanks. > > > -Hongtao > > > > Hi Kumar, > > > > I'm really appreciated if you have time to review these patches? > > > > Thanks. > > -Hongtao ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev