Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80288
b: refs/heads/master
c: 608566b
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent a67a748 commit 7107143
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 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: f2857ce92023409df1544737d5b3499b4630a183
refs/heads/master: 608566b4edda5079c7812c2108a89c0fcf2894bb
16 changes: 7 additions & 9 deletions trunk/arch/x86/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,18 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
*/
trace_hardirqs_fixup();

tsk = current;
mm = tsk->mm;
prefetchw(&mm->mmap_sem);

/* get the address */
address = read_cr2();

tsk = current;

si_code = SEGV_MAPERR;

if (notify_page_fault(regs))
return;

/*
* We fault-in kernel-space virtual memory on-demand. The
* 'reference' page table is init_mm.pgd.
Expand All @@ -319,25 +324,18 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
if (!(error_code & (PF_RSVD|PF_USER|PF_PROT)) &&
vmalloc_fault(address) >= 0)
return;
if (notify_page_fault(regs))
return;
/*
* Don't take the mm semaphore here. If we fixup a prefetch
* fault we could otherwise deadlock.
*/
goto bad_area_nosemaphore;
}

if (notify_page_fault(regs))
return;

/* It's safe to allow irq's after cr2 has been saved and the vmalloc
fault has been handled. */
if (regs->flags & (X86_EFLAGS_IF|VM_MASK))
local_irq_enable();

mm = tsk->mm;

/*
* If we're in an interrupt, have no user context or are running in an
* atomic region then we must not take the fault.
Expand Down
7 changes: 2 additions & 5 deletions trunk/arch/x86/mm/fault_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,

si_code = SEGV_MAPERR;

if (notify_page_fault(regs))
return;

/*
* We fault-in kernel-space virtual memory on-demand. The
Expand All @@ -380,18 +382,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
if (vmalloc_fault(address) >= 0)
return;
}
if (notify_page_fault(regs))
return;
/*
* Don't take the mm semaphore here. If we fixup a prefetch
* fault we could otherwise deadlock.
*/
goto bad_area_nosemaphore;
}

if (notify_page_fault(regs))
return;

if (likely(regs->flags & X86_EFLAGS_IF))
local_irq_enable();

Expand Down

0 comments on commit 7107143

Please sign in to comment.