aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/mm/fault.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-10-31 13:50:46 -0400
committerChris Metcalf <cmetcalf@tilera.com>2014-11-11 15:51:42 -0500
commitf47436734dc89ece62654d4db8d08163a89dd7ca (patch)
tree1977a1e352588c026c87cc1fc34c93fabba6f2b7 /arch/tile/mm/fault.c
parentebd25caf7d511312d1a9724ab5752e9e661dfe60 (diff)
tile: Use the more common pr_warn instead of pr_warning
And other message logging neatening. Other miscellanea: o coalesce formats o realign arguments o standardize a couple of macros o use __func__ instead of embedding the function name Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/mm/fault.c')
-rw-r--r--arch/tile/mm/fault.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c
index 6c0571216a9d..565e25a98334 100644
--- a/arch/tile/mm/fault.c
+++ b/arch/tile/mm/fault.c
@@ -169,8 +169,7 @@ static void wait_for_migration(pte_t *pte)
169 while (pte_migrating(*pte)) { 169 while (pte_migrating(*pte)) {
170 barrier(); 170 barrier();
171 if (++retries > bound) 171 if (++retries > bound)
172 panic("Hit migrating PTE (%#llx) and" 172 panic("Hit migrating PTE (%#llx) and page PFN %#lx still migrating",
173 " page PFN %#lx still migrating",
174 pte->val, pte_pfn(*pte)); 173 pte->val, pte_pfn(*pte));
175 } 174 }
176 } 175 }
@@ -292,11 +291,10 @@ static int handle_page_fault(struct pt_regs *regs,
292 */ 291 */
293 stack_offset = stack_pointer & (THREAD_SIZE-1); 292 stack_offset = stack_pointer & (THREAD_SIZE-1);
294 if (stack_offset < THREAD_SIZE / 8) { 293 if (stack_offset < THREAD_SIZE / 8) {
295 pr_alert("Potential stack overrun: sp %#lx\n", 294 pr_alert("Potential stack overrun: sp %#lx\n", stack_pointer);
296 stack_pointer);
297 show_regs(regs); 295 show_regs(regs);
298 pr_alert("Killing current process %d/%s\n", 296 pr_alert("Killing current process %d/%s\n",
299 tsk->pid, tsk->comm); 297 tsk->pid, tsk->comm);
300 do_group_exit(SIGKILL); 298 do_group_exit(SIGKILL);
301 } 299 }
302 300
@@ -421,7 +419,7 @@ good_area:
421 } else if (write) { 419 } else if (write) {
422#ifdef TEST_VERIFY_AREA 420#ifdef TEST_VERIFY_AREA
423 if (!is_page_fault && regs->cs == KERNEL_CS) 421 if (!is_page_fault && regs->cs == KERNEL_CS)
424 pr_err("WP fault at "REGFMT"\n", regs->eip); 422 pr_err("WP fault at " REGFMT "\n", regs->eip);
425#endif 423#endif
426 if (!(vma->vm_flags & VM_WRITE)) 424 if (!(vma->vm_flags & VM_WRITE))
427 goto bad_area; 425 goto bad_area;
@@ -519,16 +517,15 @@ no_context:
519 pte_t *pte = lookup_address(address); 517 pte_t *pte = lookup_address(address);
520 518
521 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte)) 519 if (pte && pte_present(*pte) && !pte_exec_kernel(*pte))
522 pr_crit("kernel tried to execute" 520 pr_crit("kernel tried to execute non-executable page - exploit attempt? (uid: %d)\n",
523 " non-executable page - exploit attempt?" 521 current->uid);
524 " (uid: %d)\n", current->uid);
525 } 522 }
526#endif 523#endif
527 if (address < PAGE_SIZE) 524 if (address < PAGE_SIZE)
528 pr_alert("Unable to handle kernel NULL pointer dereference\n"); 525 pr_alert("Unable to handle kernel NULL pointer dereference\n");
529 else 526 else
530 pr_alert("Unable to handle kernel paging request\n"); 527 pr_alert("Unable to handle kernel paging request\n");
531 pr_alert(" at virtual address "REGFMT", pc "REGFMT"\n", 528 pr_alert(" at virtual address " REGFMT ", pc " REGFMT "\n",
532 address, regs->pc); 529 address, regs->pc);
533 530
534 show_regs(regs); 531 show_regs(regs);
@@ -575,9 +572,10 @@ do_sigbus:
575#ifndef __tilegx__ 572#ifndef __tilegx__
576 573
577/* We must release ICS before panicking or we won't get anywhere. */ 574/* We must release ICS before panicking or we won't get anywhere. */
578#define ics_panic(fmt, ...) do { \ 575#define ics_panic(fmt, ...) \
579 __insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 0); \ 576do { \
580 panic(fmt, __VA_ARGS__); \ 577 __insn_mtspr(SPR_INTERRUPT_CRITICAL_SECTION, 0); \
578 panic(fmt, ##__VA_ARGS__); \
581} while (0) 579} while (0)
582 580
583/* 581/*
@@ -615,8 +613,7 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num,
615 fault_num != INT_DTLB_ACCESS)) { 613 fault_num != INT_DTLB_ACCESS)) {
616 unsigned long old_pc = regs->pc; 614 unsigned long old_pc = regs->pc;
617 regs->pc = pc; 615 regs->pc = pc;
618 ics_panic("Bad ICS page fault args:" 616 ics_panic("Bad ICS page fault args: old PC %#lx, fault %d/%d at %#lx",
619 " old PC %#lx, fault %d/%d at %#lx\n",
620 old_pc, fault_num, write, address); 617 old_pc, fault_num, write, address);
621 } 618 }
622 619
@@ -669,8 +666,8 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num,
669#endif 666#endif
670 fixup = search_exception_tables(pc); 667 fixup = search_exception_tables(pc);
671 if (!fixup) 668 if (!fixup)
672 ics_panic("ICS atomic fault not in table:" 669 ics_panic("ICS atomic fault not in table: PC %#lx, fault %d",
673 " PC %#lx, fault %d", pc, fault_num); 670 pc, fault_num);
674 regs->pc = fixup->fixup; 671 regs->pc = fixup->fixup;
675 regs->ex1 = PL_ICS_EX1(KERNEL_PL, 0); 672 regs->ex1 = PL_ICS_EX1(KERNEL_PL, 0);
676 } 673 }
@@ -826,8 +823,7 @@ void do_page_fault(struct pt_regs *regs, int fault_num,
826 823
827 set_thread_flag(TIF_ASYNC_TLB); 824 set_thread_flag(TIF_ASYNC_TLB);
828 if (async->fault_num != 0) { 825 if (async->fault_num != 0) {
829 panic("Second async fault %d;" 826 panic("Second async fault %d; old fault was %d (%#lx/%ld)",
830 " old fault was %d (%#lx/%ld)",
831 fault_num, async->fault_num, 827 fault_num, async->fault_num,
832 address, write); 828 address, write);
833 } 829 }