aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorMichael Ellerman <michaele@au1.ibm.com>2013-06-25 03:47:56 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-30 21:49:44 -0400
commit021424a1fce335e05807fd770eb8e1da30a63eea (patch)
treeb09cf27e481ba34cf6e390017014927d60301a36 /arch/powerpc/kernel
parentc9f69518e5f08170bc857984a077f693d63171df (diff)
powerpc: Rename and flesh out the facility unavailable exception handler
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> CC: <stable@vger.kernel.org> [v3.10] Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-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 89eba1fb5bbe..6ee74f8bae2f 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 300daf3e7ab0..11f448812dc1 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1286,25 +1286,42 @@ void vsx_unavailable_exception(struct pt_regs *regs)
1286 die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT); 1286 die("Unrecoverable VSX Unavailable Exception", regs, SIGABRT);
1287} 1287}
1288 1288
1289void tm_unavailable_exception(struct pt_regs *regs) 1289void facility_unavailable_exception(struct pt_regs *regs)
1290{ 1290{
1291 static char *facility_strings[] = {
1292 "FPU",
1293 "VMX/VSX",
1294 "DSCR",
1295 "PMU SPRs",
1296 "BHRB",
1297 "TM",
1298 "AT",
1299 "EBB",
1300 "TAR",
1301 };
1302 char *facility;
1303 u64 value;
1304
1305 value = mfspr(SPRN_FSCR) >> 56;
1306
1291 /* We restore the interrupt state now */ 1307 /* We restore the interrupt state now */
1292 if (!arch_irq_disabled_regs(regs)) 1308 if (!arch_irq_disabled_regs(regs))
1293 local_irq_enable(); 1309 local_irq_enable();
1294 1310
1295 /* Currently we never expect a TMU exception. Catch 1311 if (value < ARRAY_SIZE(facility_strings))
1296 * this and kill the process! 1312 facility = facility_strings[value];
1297 */ 1313 else
1298 printk(KERN_EMERG "Unexpected TM unavailable exception at %lx " 1314 facility = "unknown";
1299 "(msr %lx)\n", 1315
1300 regs->nip, regs->msr); 1316 pr_err("Facility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
1317 facility, regs->nip, regs->msr);
1301 1318
1302 if (user_mode(regs)) { 1319 if (user_mode(regs)) {
1303 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 1320 _exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
1304 return; 1321 return;
1305 } 1322 }
1306 1323
1307 die("Unexpected TM unavailable exception", regs, SIGABRT); 1324 die("Unexpected facility unavailable exception", regs, SIGABRT);
1308} 1325}
1309 1326
1310#ifdef CONFIG_PPC_TRANSACTIONAL_MEM 1327#ifdef CONFIG_PPC_TRANSACTIONAL_MEM