diff options
author | Mihai Caraman <mihai.caraman@freescale.com> | 2012-09-05 22:49:44 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-06 19:48:49 -0400 |
commit | 0127262c01f0beb485f917c720d1d95d165dfdbf (patch) | |
tree | 8ea17c81f09dec7c6e8bfdc8f3288ec7cfa439c6 | |
parent | 8b64a9dfb091f1eca8b7e58da82f1e7d1d5fe0ad (diff) |
powerpc: Restore VDSO information on critical exception om BookE
Critical exception on 64-bit booke uses user-visible SPRG3 as scratch.
Restore VDSO information in SPRG3 on exception prolog.
Use a common sprg3 field in PACA for all powerpc64 architectures.
Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s_asm.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/paca.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/exceptions-64e.S | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h index bfcd00c1485d..88609b23b775 100644 --- a/arch/powerpc/include/asm/kvm_book3s_asm.h +++ b/arch/powerpc/include/asm/kvm_book3s_asm.h | |||
@@ -74,7 +74,6 @@ struct kvmppc_host_state { | |||
74 | ulong vmhandler; | 74 | ulong vmhandler; |
75 | ulong scratch0; | 75 | ulong scratch0; |
76 | ulong scratch1; | 76 | ulong scratch1; |
77 | ulong sprg3; | ||
78 | u8 in_guest; | 77 | u8 in_guest; |
79 | u8 restore_hid5; | 78 | u8 restore_hid5; |
80 | u8 napping; | 79 | u8 napping; |
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index daf813fea91f..7796519fd238 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -136,6 +136,7 @@ struct paca_struct { | |||
136 | u8 io_sync; /* writel() needs spin_unlock sync */ | 136 | u8 io_sync; /* writel() needs spin_unlock sync */ |
137 | u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ | 137 | u8 irq_work_pending; /* IRQ_WORK interrupt while soft-disable */ |
138 | u8 nap_state_lost; /* NV GPR values lost in power7_idle */ | 138 | u8 nap_state_lost; /* NV GPR values lost in power7_idle */ |
139 | u64 sprg3; /* Saved user-visible sprg */ | ||
139 | 140 | ||
140 | #ifdef CONFIG_PPC_POWERNV | 141 | #ifdef CONFIG_PPC_POWERNV |
141 | /* Pointer to OPAL machine check event structure set by the | 142 | /* Pointer to OPAL machine check event structure set by the |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 85b05c463fae..72f26166007a 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -205,6 +205,7 @@ int main(void) | |||
205 | DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); | 205 | DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); |
206 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); | 206 | DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); |
207 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); | 207 | DEFINE(PACA_NAPSTATELOST, offsetof(struct paca_struct, nap_state_lost)); |
208 | DEFINE(PACA_SPRG3, offsetof(struct paca_struct, sprg3)); | ||
208 | #endif /* CONFIG_PPC64 */ | 209 | #endif /* CONFIG_PPC64 */ |
209 | 210 | ||
210 | /* RTAS */ | 211 | /* RTAS */ |
@@ -533,7 +534,6 @@ int main(void) | |||
533 | HSTATE_FIELD(HSTATE_VMHANDLER, vmhandler); | 534 | HSTATE_FIELD(HSTATE_VMHANDLER, vmhandler); |
534 | HSTATE_FIELD(HSTATE_SCRATCH0, scratch0); | 535 | HSTATE_FIELD(HSTATE_SCRATCH0, scratch0); |
535 | HSTATE_FIELD(HSTATE_SCRATCH1, scratch1); | 536 | HSTATE_FIELD(HSTATE_SCRATCH1, scratch1); |
536 | HSTATE_FIELD(HSTATE_SPRG3, sprg3); | ||
537 | HSTATE_FIELD(HSTATE_IN_GUEST, in_guest); | 537 | HSTATE_FIELD(HSTATE_IN_GUEST, in_guest); |
538 | HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5); | 538 | HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5); |
539 | HSTATE_FIELD(HSTATE_NAPPING, napping); | 539 | HSTATE_FIELD(HSTATE_NAPPING, napping); |
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 7476b0ae09fb..87a82fbdf05a 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S | |||
@@ -110,7 +110,9 @@ | |||
110 | 110 | ||
111 | #define PROLOG_STORE_RESTORE_SCRATCH_CRIT \ | 111 | #define PROLOG_STORE_RESTORE_SCRATCH_CRIT \ |
112 | mfspr r10,SPRN_SPRG_CRIT_SCRATCH; /* get r13 */ \ | 112 | mfspr r10,SPRN_SPRG_CRIT_SCRATCH; /* get r13 */ \ |
113 | std r10,PACA_EXCRIT+EX_R13(r13) | 113 | std r10,PACA_EXCRIT+EX_R13(r13); \ |
114 | ld r11,PACA_SPRG3(r13); \ | ||
115 | mtspr SPRN_SPRG_CRIT_SCRATCH,r11; | ||
114 | 116 | ||
115 | /* Variants of the "addition" argument for the prolog | 117 | /* Variants of the "addition" argument for the prolog |
116 | */ | 118 | */ |
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index b67db22e102d..1b2076f049ce 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
@@ -723,9 +723,7 @@ int __cpuinit vdso_getcpu_init(void) | |||
723 | 723 | ||
724 | val = (cpu & 0xfff) | ((node & 0xffff) << 16); | 724 | val = (cpu & 0xfff) | ((node & 0xffff) << 16); |
725 | mtspr(SPRN_SPRG3, val); | 725 | mtspr(SPRN_SPRG3, val); |
726 | #ifdef CONFIG_KVM_BOOK3S_HANDLER | 726 | get_paca()->sprg3 = val; |
727 | get_paca()->kvm_hstate.sprg3 = val; | ||
728 | #endif | ||
729 | 727 | ||
730 | put_cpu(); | 728 | put_cpu(); |
731 | 729 | ||
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 5a84c8d3d040..39a21bfb5d4b 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
@@ -1065,7 +1065,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | |||
1065 | mtspr SPRN_DABRX,r6 | 1065 | mtspr SPRN_DABRX,r6 |
1066 | 1066 | ||
1067 | /* Restore SPRG3 */ | 1067 | /* Restore SPRG3 */ |
1068 | ld r3,HSTATE_SPRG3(r13) | 1068 | ld r3,PACA_SPRG3(r13) |
1069 | mtspr SPRN_SPRG3,r3 | 1069 | mtspr SPRN_SPRG3,r3 |
1070 | 1070 | ||
1071 | /* | 1071 | /* |