diff options
Diffstat (limited to 'arch/ia64/kernel/mca.c')
-rw-r--r-- | arch/ia64/kernel/mca.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 1ae512910870..e51bced3b0fa 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -98,6 +98,7 @@ | |||
98 | 98 | ||
99 | #include <asm/irq.h> | 99 | #include <asm/irq.h> |
100 | #include <asm/hw_irq.h> | 100 | #include <asm/hw_irq.h> |
101 | #include <asm/tlb.h> | ||
101 | 102 | ||
102 | #include "mca_drv.h" | 103 | #include "mca_drv.h" |
103 | #include "entry.h" | 104 | #include "entry.h" |
@@ -113,6 +114,7 @@ DEFINE_PER_CPU(u64, ia64_mca_data); /* == __per_cpu_mca[smp_processor_id()] */ | |||
113 | DEFINE_PER_CPU(u64, ia64_mca_per_cpu_pte); /* PTE to map per-CPU area */ | 114 | DEFINE_PER_CPU(u64, ia64_mca_per_cpu_pte); /* PTE to map per-CPU area */ |
114 | DEFINE_PER_CPU(u64, ia64_mca_pal_pte); /* PTE to map PAL code */ | 115 | DEFINE_PER_CPU(u64, ia64_mca_pal_pte); /* PTE to map PAL code */ |
115 | DEFINE_PER_CPU(u64, ia64_mca_pal_base); /* vaddr PAL code granule */ | 116 | DEFINE_PER_CPU(u64, ia64_mca_pal_base); /* vaddr PAL code granule */ |
117 | DEFINE_PER_CPU(u64, ia64_mca_tr_reload); /* Flag for TR reload */ | ||
116 | 118 | ||
117 | unsigned long __per_cpu_mca[NR_CPUS]; | 119 | unsigned long __per_cpu_mca[NR_CPUS]; |
118 | 120 | ||
@@ -1184,6 +1186,49 @@ all_in: | |||
1184 | return; | 1186 | return; |
1185 | } | 1187 | } |
1186 | 1188 | ||
1189 | /* mca_insert_tr | ||
1190 | * | ||
1191 | * Switch rid when TR reload and needed! | ||
1192 | * iord: 1: itr, 2: itr; | ||
1193 | * | ||
1194 | */ | ||
1195 | static void mca_insert_tr(u64 iord) | ||
1196 | { | ||
1197 | |||
1198 | int i; | ||
1199 | u64 old_rr; | ||
1200 | struct ia64_tr_entry *p; | ||
1201 | unsigned long psr; | ||
1202 | int cpu = smp_processor_id(); | ||
1203 | |||
1204 | psr = ia64_clear_ic(); | ||
1205 | for (i = IA64_TR_ALLOC_BASE; i < IA64_TR_ALLOC_MAX; i++) { | ||
1206 | p = &__per_cpu_idtrs[cpu][iord-1][i]; | ||
1207 | if (p->pte & 0x1) { | ||
1208 | old_rr = ia64_get_rr(p->ifa); | ||
1209 | if (old_rr != p->rr) { | ||
1210 | ia64_set_rr(p->ifa, p->rr); | ||
1211 | ia64_srlz_d(); | ||
1212 | } | ||
1213 | ia64_ptr(iord, p->ifa, p->itir >> 2); | ||
1214 | ia64_srlz_i(); | ||
1215 | if (iord & 0x1) { | ||
1216 | ia64_itr(0x1, i, p->ifa, p->pte, p->itir >> 2); | ||
1217 | ia64_srlz_i(); | ||
1218 | } | ||
1219 | if (iord & 0x2) { | ||
1220 | ia64_itr(0x2, i, p->ifa, p->pte, p->itir >> 2); | ||
1221 | ia64_srlz_i(); | ||
1222 | } | ||
1223 | if (old_rr != p->rr) { | ||
1224 | ia64_set_rr(p->ifa, old_rr); | ||
1225 | ia64_srlz_d(); | ||
1226 | } | ||
1227 | } | ||
1228 | } | ||
1229 | ia64_set_psr(psr); | ||
1230 | } | ||
1231 | |||
1187 | /* | 1232 | /* |
1188 | * ia64_mca_handler | 1233 | * ia64_mca_handler |
1189 | * | 1234 | * |
@@ -1270,6 +1315,11 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1270 | ia64_mlogbuf_finish(1); | 1315 | ia64_mlogbuf_finish(1); |
1271 | } | 1316 | } |
1272 | 1317 | ||
1318 | if (__get_cpu_var(ia64_mca_tr_reload)) { | ||
1319 | mca_insert_tr(0x1); /*Reload dynamic itrs*/ | ||
1320 | mca_insert_tr(0x2); /*Reload dynamic itrs*/ | ||
1321 | } | ||
1322 | |||
1273 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) | 1323 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) |
1274 | == NOTIFY_STOP) | 1324 | == NOTIFY_STOP) |
1275 | ia64_mca_spin(__func__); | 1325 | ia64_mca_spin(__func__); |