aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Ellerman <michaele@au1.ibm.com>2013-06-25 03:47:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-25 17:07:21 -0400
commit8e0af91a12c135f6c22e472660f3400d46ed78ac (patch)
treedc5fa78f6962adcc8cf6420c6674951656356c35
parent77d8caacd2924ca7cbb989c30709503e93c7f026 (diff)
powerpc: Rename and flesh out the facility unavailable exception handler
commit 021424a1fce335e05807fd770eb8e1da30a63eea upstream. The exception at 0xf60 is not the TM (Transactional Memory) unavailable exception, it is the "Facility Unavailable Exception", rename it as such. Flesh out the handler to acknowledge the fact that it can be called for many reasons, one of which is TM being unavailable. Use STD_EXCEPTION_COMMON() for the exception body, for some reason we had it open-coded, I've checked the generated code is identical. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S21
-rw-r--r--arch/powerpc/kernel/traps.c33
2 files changed, 32 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 6bd676391a6d..d55a63c3559a 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -341,10 +341,11 @@ vsx_unavailable_pSeries_1:
341 EXCEPTION_PROLOG_0(PACA_EXGEN) 341 EXCEPTION_PROLOG_0(PACA_EXGEN)
342 b vsx_unavailable_pSeries 342 b vsx_unavailable_pSeries
343 343
344facility_unavailable_trampoline:
344 . = 0xf60 345 . = 0xf60
345 SET_SCRATCH0(r13) 346 SET_SCRATCH0(r13)
346 EXCEPTION_PROLOG_0(PACA_EXGEN) 347 EXCEPTION_PROLOG_0(PACA_EXGEN)
347 b tm_unavailable_pSeries 348 b facility_unavailable_pSeries
348 349
349#ifdef CONFIG_CBE_RAS 350#ifdef CONFIG_CBE_RAS
350 STD_EXCEPTION_HV(0x1200, 0x1202, cbe_system_error) 351 STD_EXCEPTION_HV(0x1200, 0x1202, cbe_system_error)
@@ -522,7 +523,7 @@ denorm_done:
522 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf20) 523 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf20)
523 STD_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable) 524 STD_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable)
524 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf40) 525 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf40)
525 STD_EXCEPTION_PSERIES_OOL(0xf60, tm_unavailable) 526 STD_EXCEPTION_PSERIES_OOL(0xf60, facility_unavailable)
526 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf60) 527 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xf60)
527 528
528/* 529/*
@@ -829,11 +830,11 @@ vsx_unavailable_relon_pSeries_1:
829 EXCEPTION_PROLOG_0(PACA_EXGEN) 830 EXCEPTION_PROLOG_0(PACA_EXGEN)
830 b vsx_unavailable_relon_pSeries 831 b vsx_unavailable_relon_pSeries
831 832
832tm_unavailable_relon_pSeries_1: 833facility_unavailable_relon_trampoline:
833 . = 0x4f60 834 . = 0x4f60
834 SET_SCRATCH0(r13) 835 SET_SCRATCH0(r13)
835 EXCEPTION_PROLOG_0(PACA_EXGEN) 836 EXCEPTION_PROLOG_0(PACA_EXGEN)
836 b tm_unavailable_relon_pSeries 837 b facility_unavailable_relon_pSeries
837 838
838 STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint) 839 STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint)
839#ifdef CONFIG_PPC_DENORMALISATION 840#ifdef CONFIG_PPC_DENORMALISATION
@@ -1159,15 +1160,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_VSX)
1159 bl .vsx_unavailable_exception 1160 bl .vsx_unavailable_exception
1160 b .ret_from_except 1161 b .ret_from_except
1161 1162
1162 .align 7 1163 STD_EXCEPTION_COMMON(0xf60, facility_unavailable, .facility_unavailable_exception)
1163 .globl tm_unavailable_common
1164tm_unavailable_common:
1165 EXCEPTION_PROLOG_COMMON(0xf60, PACA_EXGEN)
1166 bl .save_nvgprs
1167 DISABLE_INTS
1168 addi r3,r1,STACK_FRAME_OVERHEAD
1169 bl .tm_unavailable_exception
1170 b .ret_from_except
1171 1164
1172 .align 7 1165 .align 7
1173 .globl __end_handlers 1166 .globl __end_handlers
@@ -1180,7 +1173,7 @@ __end_handlers:
1180 STD_RELON_EXCEPTION_PSERIES_OOL(0xf00, performance_monitor) 1173 STD_RELON_EXCEPTION_PSERIES_OOL(0xf00, performance_monitor)
1181 STD_RELON_EXCEPTION_PSERIES_OOL(0xf20, altivec_unavailable) 1174 STD_RELON_EXCEPTION_PSERIES_OOL(0xf20, altivec_unavailable)
1182 STD_RELON_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable) 1175 STD_RELON_EXCEPTION_PSERIES_OOL(0xf40, vsx_unavailable)
1183 STD_RELON_EXCEPTION_PSERIES_OOL(0xf60, tm_unavailable) 1176 STD_RELON_EXCEPTION_PSERIES_OOL(0xf60, facility_unavailable)
1184 1177
1185#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) 1178#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
1186/* 1179/*
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index c0e5caf8ccc7..2053bbd26a06 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1282,25 +1282,42 @@ void vsx_unavailable_exception(struct pt_regs *regs)
1282 die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT); 1282 die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT);
1283} 1283}
1284 1284
1285void tm_unavailable_exception(struct pt_regs *regs) 1285void facility_unavailable_exception(struct pt_regs *regs)
1286{ 1286{
1287 static char *facility_strings[] = {
1288 "FPU",
1289 "VMX/VSX",
1290 "DSCR",
1291 "PMU SPRs",
1292 "BHRB",
1293 "TM",
1294 "AT",
1295 "EBB",
1296 "TAR",
1297 };
1298 char *facility;
1299 u64 value;
1300
1301 value = mfspr(SPRN_FSCR) >> 56;
1302
1287 /* We restore the interrupt state now */ 1303 /* We restore the interrupt state now */
1288 if (!arch_irq_disabled_regs(regs)) 1304 if (!arch_irq_disabled_regs(regs))
1289 local_irq_enable(); 1305 local_irq_enable();
1290 1306
1291 /* Currently we never expect a TMU exception. Catch 1307 if (value < ARRAY_SIZE(facility_strings))
1292 * this and kill the process! 1308 facility = facility_strings[value];
1293 */ 1309 else
1294 printk(KERN_EMERG "Unexpected TM unavailable exception at %lx " 1310 facility = "unknown";
1295 "(msr %lx)\n", 1311
1296 regs->nip, regs->msr); 1312 pr_err("Facility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
1313 facility, regs->nip, regs->msr);
1297 1314
1298 if (user_mode(regs)) { 1315 if (user_mode(regs)) {
1299 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 1316 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
1300 return; 1317 return;
1301 } 1318 }
1302 1319
1303 die("Unexpected TM unavailable exception", regs, SIGABRT); 1320 die("Unexpected facility unavailable exception", regs, SIGABRT);
1304} 1321}
1305 1322
1306#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1323#ifdef CONFIG_PPC_TRANSACTIONAL_MEM