aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/fault.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-01-11 16:44:00 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-11 22:04:53 -0500
commitf95190b28daa1bebf78ab5ec4129d01a223982c5 (patch)
treed6a022685daf4c27a3583f25937f35d20051ebf7 /arch/x86_64/mm/fault.c
parentc11efdf94d3152443c11334720824bb6c7f6c655 (diff)
[PATCH] x86_64: Remove unnecessary case from the page fault handler
Don't need to do the vmalloc check for the module range because its PML4 is shared with the kernel text. Also removed an unnecessary TLB flush. Pointed out by Jan Beulich Cc: jbeulich@novell.com Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/mm/fault.c')
-rw-r--r--arch/x86_64/mm/fault.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c
index fd07b86c062d..2a9c836133a9 100644
--- a/arch/x86_64/mm/fault.c
+++ b/arch/x86_64/mm/fault.c
@@ -237,7 +237,7 @@ static noinline void pgtable_bad(unsigned long address, struct pt_regs *regs,
237} 237}
238 238
239/* 239/*
240 * Handle a fault on the vmalloc or module mapping area 240 * Handle a fault on the vmalloc area
241 * 241 *
242 * This assumes no large pages in there. 242 * This assumes no large pages in there.
243 */ 243 */
@@ -283,7 +283,6 @@ static int vmalloc_fault(unsigned long address)
283 that. */ 283 that. */
284 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref)) 284 if (!pte_present(*pte) || pte_pfn(*pte) != pte_pfn(*pte_ref))
285 BUG(); 285 BUG();
286 __flush_tlb_all();
287 return 0; 286 return 0;
288} 287}
289 288
@@ -346,9 +345,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
346 * protection error (error_code & 9) == 0. 345 * protection error (error_code & 9) == 0.
347 */ 346 */
348 if (unlikely(address >= TASK_SIZE64)) { 347 if (unlikely(address >= TASK_SIZE64)) {
348 /*
349 * Don't check for the module range here: its PML4
350 * is always initialized because it's shared with the main
351 * kernel text. Only vmalloc may need PML4 syncups.
352 */
349 if (!(error_code & 0xd) && 353 if (!(error_code & 0xd) &&
350 ((address >= VMALLOC_START && address < VMALLOC_END) || 354 ((address >= VMALLOC_START && address < VMALLOC_END))) {
351 (address >= MODULES_VADDR && address < MODULES_END))) {
352 if (vmalloc_fault(address) < 0) 355 if (vmalloc_fault(address) < 0)
353 goto bad_area_nosemaphore; 356 goto bad_area_nosemaphore;
354 return; 357 return;