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 | |
| 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
| -rw-r--r-- | arch/powerpc/include/asm/exception-64e.h | 5 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/kvm_booke_hv_asm.h | 9 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/paca.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/reg.h | 13 | ||||
| -rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/kernel/exceptions-64e.S | 19 | ||||
| -rw-r--r-- | arch/powerpc/kernel/vdso.c | 8 | ||||
| -rw-r--r-- | arch/powerpc/kernel/vdso32/getcpu.S | 2 | ||||
| -rw-r--r-- | arch/powerpc/kernel/vdso64/getcpu.S | 2 | ||||
| -rw-r--r-- | arch/powerpc/kvm/book3s_hv_rmhandlers.S | 4 | ||||
| -rw-r--r-- | arch/powerpc/kvm/book3s_interrupts.S | 4 | ||||
| -rw-r--r-- | arch/powerpc/kvm/bookehv_interrupts.S | 10 |
12 files changed, 33 insertions, 47 deletions
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h index 51fa43e536b9..e73452f09019 100644 --- a/arch/powerpc/include/asm/exception-64e.h +++ b/arch/powerpc/include/asm/exception-64e.h | |||
| @@ -46,9 +46,8 @@ | |||
| 46 | #define EX_CR (1 * 8) | 46 | #define EX_CR (1 * 8) |
| 47 | #define EX_R10 (2 * 8) | 47 | #define EX_R10 (2 * 8) |
| 48 | #define EX_R11 (3 * 8) | 48 | #define EX_R11 (3 * 8) |
| 49 | #define EX_R13 (4 * 8) | 49 | #define EX_R14 (4 * 8) |
| 50 | #define EX_R14 (5 * 8) | 50 | #define EX_R15 (5 * 8) |
| 51 | #define EX_R15 (6 * 8) | ||
| 52 | 51 | ||
| 53 | /* | 52 | /* |
| 54 | * The TLB miss exception uses different slots. | 53 | * The TLB miss exception uses different slots. |
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 |
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index 9c5dbc3833fb..948f01a04cc3 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
| @@ -146,7 +146,7 @@ struct paca_struct { | |||
| 146 | u8 io_sync; /* writel() needs spin_unlock sync */ | 146 | u8 io_sync; /* writel() needs spin_unlock sync */ |
| 147 | u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ | 147 | u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ |
| 148 | u8 nap_state_lost; /* NV GPR values lost in power7_idle */ | 148 | u8 nap_state_lost; /* NV GPR values lost in power7_idle */ |
| 149 | u64 sprg3; /* Saved user-visible sprg */ | 149 | u64 sprg_vdso; /* Saved user-visible sprg */ |
| 150 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | 150 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM |
| 151 | u64 tm_scratch; /* TM scratch area for reclaim */ | 151 | u64 tm_scratch; /* TM scratch area for reclaim */ |
| 152 | #endif | 152 | #endif |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index bf0fb4db0855..f7251c2dc049 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
| @@ -577,9 +577,13 @@ | |||
| 577 | #define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ | 577 | #define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ |
| 578 | #define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ | 578 | #define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ |
| 579 | #define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ | 579 | #define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ |
| 580 | #define SPRN_USPRG4 0x104 /* SPRG4 userspace read */ | ||
| 580 | #define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ | 581 | #define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ |
| 582 | #define SPRN_USPRG5 0x105 /* SPRG5 userspace read */ | ||
| 581 | #define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ | 583 | #define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ |
| 584 | #define SPRN_USPRG6 0x106 /* SPRG6 userspace read */ | ||
| 582 | #define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ | 585 | #define SPRN_SPRG7 0x117 /* Special Purpose Register General 7 */ |
| 586 | #define SPRN_USPRG7 0x107 /* SPRG7 userspace read */ | ||
| 583 | #define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ | 587 | #define SPRN_SRR0 0x01A /* Save/Restore Register 0 */ |
| 584 | #define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ | 588 | #define SPRN_SRR1 0x01B /* Save/Restore Register 1 */ |
| 585 | #define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */ | 589 | #define SRR1_ISI_NOPT 0x40000000 /* ISI: Not found in hash */ |
| @@ -879,11 +883,10 @@ | |||
| 879 | * 64-bit embedded | 883 | * 64-bit embedded |
| 880 | * - SPRG0 generic exception scratch | 884 | * - SPRG0 generic exception scratch |
| 881 | * - SPRG2 TLB exception stack | 885 | * - SPRG2 TLB exception stack |
| 882 | * - SPRG3 critical exception scratch and | 886 | * - SPRG3 critical exception scratch (user visible, sorry!) |
| 883 | * CPU and NUMA node for VDSO getcpu (user visible) | ||
| 884 | * - SPRG4 unused (user visible) | 887 | * - SPRG4 unused (user visible) |
| 885 | * - SPRG6 TLB miss scratch (user visible, sorry !) | 888 | * - SPRG6 TLB miss scratch (user visible, sorry !) |
| 886 | * - SPRG7 critical exception scratch | 889 | * - SPRG7 CPU and NUMA node for VDSO getcpu (user visible) |
| 887 | * - SPRG8 machine check exception scratch | 890 | * - SPRG8 machine check exception scratch |
| 888 | * - SPRG9 debug exception scratch | 891 | * - SPRG9 debug exception scratch |
| 889 | * | 892 | * |
| @@ -940,6 +943,8 @@ | |||
| 940 | #define SPRN_SPRG_SCRATCH0 SPRN_SPRG2 | 943 | #define SPRN_SPRG_SCRATCH0 SPRN_SPRG2 |
| 941 | #define SPRN_SPRG_HPACA SPRN_HSPRG0 | 944 | #define SPRN_SPRG_HPACA SPRN_HSPRG0 |
| 942 | #define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1 | 945 | #define SPRN_SPRG_HSCRATCH0 SPRN_HSPRG1 |
| 946 | #define SPRN_SPRG_VDSO_READ SPRN_USPRG3 | ||
| 947 | #define SPRN_SPRG_VDSO_WRITE SPRN_SPRG3 | ||
| 943 | 948 | ||
| 944 | #define GET_PACA(rX) \ | 949 | #define GET_PACA(rX) \ |
| 945 | BEGIN_FTR_SECTION_NESTED(66); \ | 950 | BEGIN_FTR_SECTION_NESTED(66); \ |
| @@ -983,6 +988,8 @@ | |||
| 983 | #define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6 | 988 | #define SPRN_SPRG_TLB_SCRATCH SPRN_SPRG6 |
| 984 | #define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0 | 989 | #define SPRN_SPRG_GEN_SCRATCH SPRN_SPRG0 |
| 985 | #define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH | 990 | #define SPRN_SPRG_GDBELL_SCRATCH SPRN_SPRG_GEN_SCRATCH |
| 991 | #define SPRN_SPRG_VDSO_READ SPRN_USPRG7 | ||
| 992 | #define SPRN_SPRG_VDSO_WRITE SPRN_SPRG7 | ||
| 986 | 993 | ||
| 987 | #define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX | 994 | #define SET_PACA(rX) mtspr SPRN_SPRG_PACA,rX |
| 988 | #define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA | 995 | #define GET_PACA(rX) mfspr rX,SPRN_SPRG_PACA |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index b5aacf72ae6f..dba8140ebc20 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
| @@ -253,7 +253,7 @@ int main(void) | |||
| 253 | DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); | 253 | DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); |
| 254 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); | 254 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); |
| 255 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); | 255 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); |
| 256 | DEFINE(PACA_SPRG3, offsetof(struct paca_struct, sprg3)); | 256 | DEFINE(PACA_SPRG_VDSO, offsetof(struct paca_struct, sprg_vdso)); |
| 257 | #endif /* CONFIG_PPC64 */ | 257 | #endif /* CONFIG_PPC64 */ |
| 258 | 258 | ||
| 259 | /* RTAS */ | 259 | /* RTAS */ |
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 41380a424108..89e1133b0185 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S | |||
| @@ -55,7 +55,6 @@ | |||
| 55 | mfspr r13,SPRN_SPRG_PACA; /* get PACA */ \ | 55 | mfspr r13,SPRN_SPRG_PACA; /* get PACA */ \ |
| 56 | std r10,PACA_EX##type+EX_R10(r13); \ | 56 | std r10,PACA_EX##type+EX_R10(r13); \ |
| 57 | std r11,PACA_EX##type+EX_R11(r13); \ | 57 | std r11,PACA_EX##type+EX_R11(r13); \ |
| 58 | PROLOG_STORE_RESTORE_SCRATCH_##type; \ | ||
| 59 | mfcr r10; /* save CR */ \ | 58 | mfcr r10; /* save CR */ \ |
| 60 | mfspr r11,SPRN_##type##_SRR1;/* what are we coming from */ \ | 59 | mfspr r11,SPRN_##type##_SRR1;/* what are we coming from */ \ |
| 61 | DO_KVM intnum,SPRN_##type##_SRR1; /* KVM hook */ \ | 60 | DO_KVM intnum,SPRN_##type##_SRR1; /* KVM hook */ \ |
| @@ -116,20 +115,6 @@ | |||
| 116 | #define GDBELL_EXCEPTION_PROLOG(n, intnum, addition) \ | 115 | #define GDBELL_EXCEPTION_PROLOG(n, intnum, addition) \ |
| 117 | EXCEPTION_PROLOG(n, intnum, GDBELL, addition##_GDBELL(n)) | 116 | EXCEPTION_PROLOG(n, intnum, GDBELL, addition##_GDBELL(n)) |
| 118 | 117 | ||
| 119 | /* | ||
| 120 | * Store user-visible scratch in PACA exception slots and restore proper value | ||
| 121 | */ | ||
| 122 | #define PROLOG_STORE_RESTORE_SCRATCH_GEN | ||
| 123 | #define PROLOG_STORE_RESTORE_SCRATCH_GDBELL | ||
| 124 | #define PROLOG_STORE_RESTORE_SCRATCH_DBG | ||
| 125 | #define PROLOG_STORE_RESTORE_SCRATCH_MC | ||
| 126 | |||
| 127 | #define PROLOG_STORE_RESTORE_SCRATCH_CRIT \ | ||
| 128 | mfspr r10,SPRN_SPRG_CRIT_SCRATCH; /* get r13 */ \ | ||
| 129 | std r10,PACA_EXCRIT+EX_R13(r13); \ | ||
| 130 | ld r11,PACA_SPRG3(r13); \ | ||
| 131 | mtspr SPRN_SPRG_CRIT_SCRATCH,r11; | ||
| 132 | |||
| 133 | /* Variants of the "addition" argument for the prolog | 118 | /* Variants of the "addition" argument for the prolog |
| 134 | */ | 119 | */ |
| 135 | #define PROLOG_ADDITION_NONE_GEN(n) | 120 | #define PROLOG_ADDITION_NONE_GEN(n) |
| @@ -529,7 +514,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | |||
| 529 | mtcr r10 | 514 | mtcr r10 |
| 530 | ld r10,PACA_EXCRIT+EX_R10(r13) /* restore registers */ | 515 | ld r10,PACA_EXCRIT+EX_R10(r13) /* restore registers */ |
| 531 | ld r11,PACA_EXCRIT+EX_R11(r13) | 516 | ld r11,PACA_EXCRIT+EX_R11(r13) |
| 532 | ld r13,PACA_EXCRIT+EX_R13(r13) | 517 | mfspr r13,SPRN_SPRG_CRIT_SCRATCH |
| 533 | rfci | 518 | rfci |
| 534 | 519 | ||
| 535 | /* Normal debug exception */ | 520 | /* Normal debug exception */ |
| @@ -542,7 +527,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) | |||
| 542 | /* Now we mash up things to make it look like we are coming on a | 527 | /* Now we mash up things to make it look like we are coming on a |
| 543 | * normal exception | 528 | * normal exception |
| 544 | */ | 529 | */ |
| 545 | ld r15,PACA_EXCRIT+EX_R13(r13) | 530 | mfspr r15,SPRN_SPRG_CRIT_SCRATCH |
| 546 | mtspr SPRN_SPRG_GEN_SCRATCH,r15 | 531 | mtspr SPRN_SPRG_GEN_SCRATCH,r15 |
| 547 | mfspr r14,SPRN_DBSR | 532 | mfspr r14,SPRN_DBSR |
| 548 | EXCEPTION_COMMON(0xd00, PACA_EXCRIT, INTS_DISABLE) | 533 | EXCEPTION_COMMON(0xd00, PACA_EXCRIT, INTS_DISABLE) |
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 094e45c16a17..ce74c335a6a4 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
| @@ -715,8 +715,8 @@ int vdso_getcpu_init(void) | |||
| 715 | unsigned long cpu, node, val; | 715 | unsigned long cpu, node, val; |
| 716 | 716 | ||
| 717 | /* | 717 | /* |
| 718 | * SPRG3 contains the CPU in the bottom 16 bits and the NUMA node in | 718 | * SPRG_VDSO contains the CPU in the bottom 16 bits and the NUMA node |
| 719 | * the next 16 bits. The VDSO uses this to implement getcpu(). | 719 | * in the next 16 bits. The VDSO uses this to implement getcpu(). |
| 720 | */ | 720 | */ |
| 721 | cpu = get_cpu(); | 721 | cpu = get_cpu(); |
| 722 | WARN_ON_ONCE(cpu > 0xffff); | 722 | WARN_ON_ONCE(cpu > 0xffff); |
| @@ -725,8 +725,8 @@ int vdso_getcpu_init(void) | |||
| 725 | WARN_ON_ONCE(node > 0xffff); | 725 | WARN_ON_ONCE(node > 0xffff); |
| 726 | 726 | ||
| 727 | val = (cpu & 0xfff) | ((node & 0xffff) << 16); | 727 | val = (cpu & 0xfff) | ((node & 0xffff) << 16); |
| 728 | mtspr(SPRN_SPRG3, val); | 728 | mtspr(SPRN_SPRG_VDSO_WRITE, val); |
| 729 | get_paca()->sprg3 = val; | 729 | get_paca()->sprg_vdso = val; |
| 730 | 730 | ||
| 731 | put_cpu(); | 731 | put_cpu(); |
| 732 | 732 | ||
diff --git a/arch/powerpc/kernel/vdso32/getcpu.S b/arch/powerpc/kernel/vdso32/getcpu.S index 47afd08c90f7..23eb9a9441bd 100644 --- a/arch/powerpc/kernel/vdso32/getcpu.S +++ b/arch/powerpc/kernel/vdso32/getcpu.S | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | V_FUNCTION_BEGIN(__kernel_getcpu) | 30 | V_FUNCTION_BEGIN(__kernel_getcpu) |
| 31 | .cfi_startproc | 31 | .cfi_startproc |
| 32 | mfspr r5,SPRN_USPRG3 | 32 | mfspr r5,SPRN_SPRG_VDSO_READ |
| 33 | cmpdi cr0,r3,0 | 33 | cmpdi cr0,r3,0 |
| 34 | cmpdi cr1,r4,0 | 34 | cmpdi cr1,r4,0 |
| 35 | clrlwi r6,r5,16 | 35 | clrlwi r6,r5,16 |
diff --git a/arch/powerpc/kernel/vdso64/getcpu.S b/arch/powerpc/kernel/vdso64/getcpu.S index 47afd08c90f7..23eb9a9441bd 100644 --- a/arch/powerpc/kernel/vdso64/getcpu.S +++ b/arch/powerpc/kernel/vdso64/getcpu.S | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | V_FUNCTION_BEGIN(__kernel_getcpu) | 30 | V_FUNCTION_BEGIN(__kernel_getcpu) |
| 31 | .cfi_startproc | 31 | .cfi_startproc |
| 32 | mfspr r5,SPRN_USPRG3 | 32 | mfspr r5,SPRN_SPRG_VDSO_READ |
| 33 | cmpdi cr0,r3,0 | 33 | cmpdi cr0,r3,0 |
| 34 | cmpdi cr1,r4,0 | 34 | cmpdi cr1,r4,0 |
| 35 | clrlwi r6,r5,16 | 35 | clrlwi r6,r5,16 |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index e66d4ec04d95..fbfca5778b0b 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
| @@ -75,8 +75,8 @@ BEGIN_FTR_SECTION | |||
| 75 | END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) | 75 | END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_207S) |
| 76 | 76 | ||
| 77 | /* Restore SPRG3 */ | 77 | /* Restore SPRG3 */ |
| 78 | ld r3,PACA_SPRG3(r13) | 78 | ld r3,PACA_SPRG_VDSO(r13) |
| 79 | mtspr SPRN_SPRG3,r3 | 79 | mtspr SPRN_SPRG_VDSO_WRITE,r3 |
| 80 | 80 | ||
| 81 | /* Reload the host's PMU registers */ | 81 | /* Reload the host's PMU registers */ |
| 82 | ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */ | 82 | ld r3, PACALPPACAPTR(r13) /* is the host using the PMU? */ |
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S index f779450cb07c..3533c999194a 100644 --- a/arch/powerpc/kvm/book3s_interrupts.S +++ b/arch/powerpc/kvm/book3s_interrupts.S | |||
| @@ -153,8 +153,8 @@ kvm_start_lightweight: | |||
| 153 | * Reload kernel SPRG3 value. | 153 | * Reload kernel SPRG3 value. |
| 154 | * No need to save guest value as usermode can't modify SPRG3. | 154 | * No need to save guest value as usermode can't modify SPRG3. |
| 155 | */ | 155 | */ |
| 156 | ld r3, PACA_SPRG3(r13) | 156 | ld r3, PACA_SPRG_VDSO(r13) |
| 157 | mtspr SPRN_SPRG3, r3 | 157 | mtspr SPRN_SPRG_VDSO_WRITE, r3 |
| 158 | #endif /* CONFIG_PPC_BOOK3S_64 */ | 158 | #endif /* CONFIG_PPC_BOOK3S_64 */ |
| 159 | 159 | ||
| 160 | /* R7 = vcpu */ | 160 | /* R7 = vcpu */ |
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index e4185f6b3309..99635a37c78c 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S | |||
| @@ -229,11 +229,7 @@ | |||
| 229 | stw r10, VCPU_CR(r4) | 229 | stw r10, VCPU_CR(r4) |
| 230 | PPC_STL r11, VCPU_GPR(R4)(r4) | 230 | PPC_STL r11, VCPU_GPR(R4)(r4) |
| 231 | PPC_STL r5, VCPU_GPR(R5)(r4) | 231 | PPC_STL r5, VCPU_GPR(R5)(r4) |
| 232 | .if \type == EX_CRIT | ||
| 233 | PPC_LL r5, (\paca_ex + EX_R13)(r13) | ||
| 234 | .else | ||
| 235 | mfspr r5, \scratch | 232 | mfspr r5, \scratch |
| 236 | .endif | ||
| 237 | PPC_STL r6, VCPU_GPR(R6)(r4) | 233 | PPC_STL r6, VCPU_GPR(R6)(r4) |
| 238 | PPC_STL r8, VCPU_GPR(R8)(r4) | 234 | PPC_STL r8, VCPU_GPR(R8)(r4) |
| 239 | PPC_STL r9, VCPU_GPR(R9)(r4) | 235 | PPC_STL r9, VCPU_GPR(R9)(r4) |
| @@ -435,10 +431,16 @@ _GLOBAL(kvmppc_resume_host) | |||
| 435 | PPC_STL r5, VCPU_LR(r4) | 431 | PPC_STL r5, VCPU_LR(r4) |
| 436 | mfspr r7, SPRN_SPRG5 | 432 | mfspr r7, SPRN_SPRG5 |
| 437 | stw r3, VCPU_VRSAVE(r4) | 433 | stw r3, VCPU_VRSAVE(r4) |
| 434 | #ifdef CONFIG_64BIT | ||
| 435 | PPC_LL r3, PACA_SPRG_VDSO(r13) | ||
| 436 | #endif | ||
| 438 | PPC_STD(r6, VCPU_SHARED_SPRG4, r11) | 437 | PPC_STD(r6, VCPU_SHARED_SPRG4, r11) |
| 439 | mfspr r8, SPRN_SPRG6 | 438 | mfspr r8, SPRN_SPRG6 |
| 440 | PPC_STD(r7, VCPU_SHARED_SPRG5, r11) | 439 | PPC_STD(r7, VCPU_SHARED_SPRG5, r11) |
| 441 | mfspr r9, SPRN_SPRG7 | 440 | mfspr r9, SPRN_SPRG7 |
| 441 | #ifdef CONFIG_64BIT | ||
| 442 | mtspr SPRN_SPRG_VDSO_WRITE, r3 | ||
| 443 | #endif | ||
| 442 | PPC_STD(r8, VCPU_SHARED_SPRG6, r11) | 444 | PPC_STD(r8, VCPU_SHARED_SPRG6, r11) |
| 443 | mfxer r3 | 445 | mfxer r3 |
| 444 | PPC_STD(r9, VCPU_SHARED_SPRG7, r11) | 446 | PPC_STD(r9, VCPU_SHARED_SPRG7, r11) |
