Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74084
b: refs/heads/master
c: 0f1a394
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mundt committed Nov 19, 2007
1 parent 80ac76f commit 91b2125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 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: 1c6b2ca5e0939bf8b5d1a11f1646f25189ecd447
refs/heads/master: 0f1a394ba68c4bbdedb1dbfdf6784ba54c07bbe4
25 changes: 7 additions & 18 deletions trunk/arch/sh/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
pmd_t *pmd;
pte_t *pte;
pte_t entry;
struct mm_struct *mm = current->mm;
spinlock_t *ptl = NULL;
int ret = 1;

#ifdef CONFIG_SH_KGDB
if (kgdb_nofault && kgdb_bus_err_hook)
Expand All @@ -274,12 +271,11 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
*/
if (address >= P3SEG && address < P3_ADDR_MAX) {
pgd = pgd_offset_k(address);
mm = NULL;
} else {
if (unlikely(address >= TASK_SIZE || !mm))
if (unlikely(address >= TASK_SIZE || !current->mm))
return 1;

pgd = pgd_offset(mm, address);
pgd = pgd_offset(current->mm, address);
}

pud = pud_offset(pgd, address);
Expand All @@ -289,26 +285,19 @@ asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
if (pmd_none_or_clear_bad(pmd))
return 1;

if (mm)
pte = pte_offset_map_lock(mm, pmd, address, &ptl);
else
pte = pte_offset_kernel(pmd, address);

pte = pte_offset_kernel(pmd, address);
entry = *pte;
if (unlikely(pte_none(entry) || pte_not_present(entry)))
goto unlock;
return 1;
if (unlikely(writeaccess && !pte_write(entry)))
goto unlock;
return 1;

if (writeaccess)
entry = pte_mkdirty(entry);
entry = pte_mkyoung(entry);

set_pte(pte, entry);
update_mmu_cache(NULL, address, entry);
ret = 0;
unlock:
if (mm)
pte_unmap_unlock(pte, ptl);
return ret;

return 0;
}

0 comments on commit 91b2125

Please sign in to comment.