From d410ae2126481a74bc5be4a6242c4a232c19a984 Mon Sep 17 00:00:00 2001 From: Mahesh Salgaonkar Date: Tue, 11 Mar 2014 10:56:18 +0530 Subject: powerpc/book3s: Fix CFAR clobbering issue in machine check handler. While checking powersaving mode in machine check handler at 0x200, we clobber CFAR register. Fix it by saving and restoring it during beq/bgt. Signed-off-by: Mahesh Salgaonkar Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/exception-64s.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'arch/powerpc/include/asm/exception-64s.h') diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index 66830618cc19..aeaa56cd9b54 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h @@ -146,6 +146,14 @@ BEGIN_FTR_SECTION_NESTED(943) \ mfspr ra,spr; \ END_FTR_SECTION_NESTED(ftr,ftr,943) +/* + * Set an SPR from a register if the CPU has the given feature + */ +#define OPT_SET_SPR(ra, spr, ftr) \ +BEGIN_FTR_SECTION_NESTED(943) \ + mtspr spr,ra; \ +END_FTR_SECTION_NESTED(ftr,ftr,943) + /* * Save a register to the PACA if the CPU has the given feature */ -- cgit