Skip to content
Snippets Groups Projects
Commit 990118c8 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt
Browse files

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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 7ac21cd4
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,8 @@ BEGIN_FW_FTR_SECTION; \ ...@@ -60,6 +60,8 @@ BEGIN_FW_FTR_SECTION; \
cmpd cr1,r11,r10; \ cmpd cr1,r11,r10; \
beq+ cr1,33f; \ beq+ cr1,33f; \
bl .accumulate_stolen_time; \ bl .accumulate_stolen_time; \
ld r12,_MSR(r1); \
andi. r10,r12,MSR_PR; /* Restore cr0 (coming from user) */ \
33: \ 33: \
END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment