aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-19 13:45:04 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-20 02:10:03 -0400
commited79ba9e15f84cef05aba5cbfe6e93f9b43c31f4 (patch)
tree7df9a2dc61e5c43e426562adc4367cb7e32380a0 /arch/powerpc/kernel
parenta125e0928c736bc50cdd9a13151d4f4ee7821266 (diff)
powerpc/powernv: Machine check and other system interrupts
OPAL can handle various interrupt for us such as Machine Checks (it performs all sorts of recovery tasks and passes back control to us with informations about the error), Hardware Management Interrupts and Softpatch interrupts. This wires up the mechanisms and prints out specific informations returned by HAL when a machine check occurs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/asm-offsets.c10
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S27
2 files changed, 33 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 5f078bc2063e..536ffa897c6c 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -48,6 +48,9 @@
48#ifdef CONFIG_PPC_ISERIES 48#ifdef CONFIG_PPC_ISERIES
49#include <asm/iseries/alpaca.h> 49#include <asm/iseries/alpaca.h>
50#endif 50#endif
51#ifdef CONFIG_PPC_POWERNV
52#include <asm/opal.h>
53#endif
51#if defined(CONFIG_KVM) || defined(CONFIG_KVM_GUEST) 54#if defined(CONFIG_KVM) || defined(CONFIG_KVM_GUEST)
52#include <linux/kvm_host.h> 55#include <linux/kvm_host.h>
53#endif 56#endif
@@ -609,5 +612,12 @@ int main(void)
609 arch.timing_last_enter.tv32.tbl)); 612 arch.timing_last_enter.tv32.tbl));
610#endif 613#endif
611 614
615#ifdef CONFIG_PPC_POWERNV
616 DEFINE(OPAL_MC_GPR3, offsetof(struct opal_machine_check_event, gpr3));
617 DEFINE(OPAL_MC_SRR0, offsetof(struct opal_machine_check_event, srr0));
618 DEFINE(OPAL_MC_SRR1, offsetof(struct opal_machine_check_event, srr1));
619 DEFINE(PACA_OPAL_MC_EVT, offsetof(struct paca_struct, opal_mc_evt));
620#endif
621
612 return 0; 622 return 0;
613} 623}
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 41b02c792aa3..d51458fa8dee 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1143,7 +1143,7 @@ _GLOBAL(do_stab_bolted)
1143 rfid 1143 rfid
1144 b . /* prevent speculative execution */ 1144 b . /* prevent speculative execution */
1145 1145
1146#ifdef CONFIG_PPC_PSERIES 1146#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1147/* 1147/*
1148 * Data area reserved for FWNMI option. 1148 * Data area reserved for FWNMI option.
1149 * This address (0x7000) is fixed by the RPA. 1149 * This address (0x7000) is fixed by the RPA.
@@ -1151,7 +1151,7 @@ _GLOBAL(do_stab_bolted)
1151 .= 0x7000 1151 .= 0x7000
1152 .globl fwnmi_data_area 1152 .globl fwnmi_data_area
1153fwnmi_data_area: 1153fwnmi_data_area:
1154#endif /* CONFIG_PPC_PSERIES */ 1154#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
1155 1155
1156 /* iSeries does not use the FWNMI stuff, so it is safe to put 1156 /* iSeries does not use the FWNMI stuff, so it is safe to put
1157 * this here, even if we later allow kernels that will boot on 1157 * this here, even if we later allow kernels that will boot on
@@ -1176,9 +1176,12 @@ xLparMap:
1176 1176
1177#endif /* CONFIG_PPC_ISERIES */ 1177#endif /* CONFIG_PPC_ISERIES */
1178 1178
1179#ifdef CONFIG_PPC_PSERIES 1179#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1180 /* pseries and powernv need to keep the whole page from
1181 * 0x7000 to 0x8000 free for use by the firmware
1182 */
1180 . = 0x8000 1183 . = 0x8000
1181#endif /* CONFIG_PPC_PSERIES */ 1184#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
1182 1185
1183/* 1186/*
1184 * Space for CPU0's segment table. 1187 * Space for CPU0's segment table.
@@ -1193,3 +1196,19 @@ xLparMap:
1193 .globl initial_stab 1196 .globl initial_stab
1194initial_stab: 1197initial_stab:
1195 .space 4096 1198 .space 4096
1199#ifdef CONFIG_PPC_POWERNV
1200_GLOBAL(opal_mc_secondary_handler)
1201 HMT_MEDIUM
1202 SET_SCRATCH0(r13)
1203 GET_PACA(r13)
1204 clrldi r3,r3,2
1205 tovirt(r3,r3)
1206 std r3,PACA_OPAL_MC_EVT(r13)
1207 ld r13,OPAL_MC_SRR0(r3)
1208 mtspr SPRN_SRR0,r13
1209 ld r13,OPAL_MC_SRR1(r3)
1210 mtspr SPRN_SRR1,r13
1211 ld r3,OPAL_MC_GPR3(r3)
1212 GET_SCRATCH0(r13)
1213 b machine_check_pSeries
1214#endif /* CONFIG_PPC_POWERNV */