diff options
author | Scott Wood <scottwood@freescale.com> | 2014-03-10 18:29:38 -0400 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-03-19 20:57:14 -0400 |
commit | 9d378dfac885f72b8b369d08fc61bef36e2f2dd1 (patch) | |
tree | 8790aa68cd0944e031b35eb63f5be14ec678be2d /arch/powerpc/include/asm/kvm_booke_hv_asm.h | |
parent | 82d86de25b9c99db546e17c6f7ebf9a691da557e (diff) |
powerpc/booke64: Use SPRG7 for VDSO
Previously SPRG3 was marked for use by both VDSO and critical
interrupts (though critical interrupts were not fully implemented).
In commit 8b64a9dfb091f1eca8b7e58da82f1e7d1d5fe0ad ("powerpc/booke64:
Use SPRG0/3 scratch for bolted TLB miss & crit int"), Mihai Caraman
made an attempt to resolve this conflict by restoring the VDSO value
early in the critical interrupt, but this has some issues:
- It's incompatible with EXCEPTION_COMMON which restores r13 from the
by-then-overwritten scratch (this cost me some debugging time).
- It forces critical exceptions to be a special case handled
differently from even machine check and debug level exceptions.
- It didn't occur to me that it was possible to make this work at all
(by doing a final "ld r13, PACA_EXCRIT+EX_R13(r13)") until after
I made (most of) this patch. :-)
It might be worth investigating using a load rather than SPRG on return
from all exceptions (except TLB misses where the scratch never leaves
the SPRG) -- it could save a few cycles. Until then, let's stick with
SPRG for all exceptions.
Since we cannot use SPRG4-7 for scratch without corrupting the state of
a KVM guest, move VDSO to SPRG7 on book3e. Since neither SPRG4-7 nor
critical interrupts exist on book3s, SPRG3 is still used for VDSO
there.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: Mihai Caraman <mihai.caraman@freescale.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: kvm-ppc@vger.kernel.org
Diffstat (limited to 'arch/powerpc/include/asm/kvm_booke_hv_asm.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_booke_hv_asm.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/kvm_booke_hv_asm.h b/arch/powerpc/include/asm/kvm_booke_hv_asm.h index 3a79f5325712..c3e3fd53a3a9 100644 --- a/arch/powerpc/include/asm/kvm_booke_hv_asm.h +++ b/arch/powerpc/include/asm/kvm_booke_hv_asm.h | |||
@@ -36,20 +36,13 @@ | |||
36 | * *(r8 + GPR11) = saved r11 | 36 | * *(r8 + GPR11) = saved r11 |
37 | * | 37 | * |
38 | * 64-bit host | 38 | * 64-bit host |
39 | * Expected inputs (GEN/GDBELL/DBG/MC exception types): | 39 | * Expected inputs (GEN/GDBELL/DBG/CRIT/MC exception types): |
40 | * r10 = saved CR | 40 | * r10 = saved CR |
41 | * r13 = PACA_POINTER | 41 | * r13 = PACA_POINTER |
42 | * *(r13 + PACA_EX##type + EX_R10) = saved r10 | 42 | * *(r13 + PACA_EX##type + EX_R10) = saved r10 |
43 | * *(r13 + PACA_EX##type + EX_R11) = saved r11 | 43 | * *(r13 + PACA_EX##type + EX_R11) = saved r11 |
44 | * SPRN_SPRG_##type##_SCRATCH = saved r13 | 44 | * SPRN_SPRG_##type##_SCRATCH = saved r13 |
45 | * | 45 | * |
46 | * Expected inputs (CRIT exception type): | ||
47 | * r10 = saved CR | ||
48 | * r13 = PACA_POINTER | ||
49 | * *(r13 + PACA_EX##type + EX_R10) = saved r10 | ||
50 | * *(r13 + PACA_EX##type + EX_R11) = saved r11 | ||
51 | * *(r13 + PACA_EX##type + EX_R13) = saved r13 | ||
52 | * | ||
53 | * Expected inputs (TLB exception type): | 46 | * Expected inputs (TLB exception type): |
54 | * r10 = saved CR | 47 | * r10 = saved CR |
55 | * r13 = PACA_POINTER | 48 | * r13 = PACA_POINTER |