summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/ppc_asm.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-02 00:01:31 (GMT)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-08 23:55:16 (GMT)
commit990118c84b3e90b2b5354b6e2acd961044d7fa12 (patch)
treec34310e6d49cffa38d242270e58f661dd90a575d /arch/powerpc/include/asm/ppc_asm.h
parent7ac21cd465391802d931bd5e692302639383b8f5 (diff)
downloadlinux-fsl-qoriq-990118c84b3e90b2b5354b6e2acd961044d7fa12.tar.xz
powerpc: Fix register clobbering when accumulating stolen time
When running under a hypervisor that supports stolen time accounting, we may call C code from the macro EXCEPTION_PROLOG_COMMON in the exception entry path, which clobbers CR0. However, the FPU and vector traps rely on CR0 indicating whether we are coming from userspace or kernel to decide what to do. So we need to restore that value after the C call Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/ppc_asm.h')
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 368f72f..50f73aa 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -60,6 +60,8 @@ BEGIN_FW_FTR_SECTION; \
cmpd cr1,r11,r10; \
beq+ cr1,33f; \
bl .accumulate_stolen_time; \
+ ld r12,_MSR(r1); \
+ andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \
33: \
END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)