Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130891
b: refs/heads/master
c: eeabac7
h: refs/heads/master
i:
  130889: ac63d42
  130887: 171e040
v: v3
  • Loading branch information
David S. Miller committed Feb 3, 2009
1 parent 11ccf4d commit 6314cf2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 802c64b310e5b9dfda6cb50b850b962ed96a9e81
refs/heads/master: eeabac7386ca13bfe1a58afeb04326a9e1a3a20e
25 changes: 18 additions & 7 deletions trunk/arch/sparc/mm/fault_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/interrupt.h>
#include <linux/kprobes.h>
#include <linux/kdebug.h>
#include <linux/percpu.h>

#include <asm/page.h>
#include <asm/pgtable.h>
Expand Down Expand Up @@ -244,8 +245,14 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
(fault_code & FAULT_CODE_DTLB))
BUG();

if (test_thread_flag(TIF_32BIT)) {
if (!(regs->tstate & TSTATE_PRIV))
regs->tpc &= 0xffffffff;
address &= 0xffffffff;
}

if (regs->tstate & TSTATE_PRIV) {
unsigned long tpc = regs->tpc;
unsigned long eaddr, tpc = regs->tpc;

/* Sanity check the PC. */
if ((tpc >= KERNBASE && tpc < (unsigned long) __init_end) ||
Expand All @@ -255,6 +262,16 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
bad_kernel_pc(regs, address);
return;
}

insn = get_fault_insn(regs, insn);
eaddr = compute_effective_address(regs, insn, 0);
if (WARN_ON_ONCE((eaddr & PAGE_MASK) != (address & PAGE_MASK))){
printk(KERN_ERR "FAULT: Mismatch kernel fault "
"address: addr[%lx] eaddr[%lx] TPC[%lx]\n",
address, eaddr, tpc);
show_regs(regs);
goto handle_kernel_fault;
}
}

/*
Expand All @@ -264,12 +281,6 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs)
if (in_atomic() || !mm)
goto intr_or_no_mm;

if (test_thread_flag(TIF_32BIT)) {
if (!(regs->tstate & TSTATE_PRIV))
regs->tpc &= 0xffffffff;
address &= 0xffffffff;
}

if (!down_read_trylock(&mm->mmap_sem)) {
if ((regs->tstate & TSTATE_PRIV) &&
!search_exception_tables(regs->tpc)) {
Expand Down

0 comments on commit 6314cf2

Please sign in to comment.