Skip to content

Commit

Permalink
x86: unify fault_32|64.c
Browse files Browse the repository at this point in the history
Unify includes in moved fault.c.

Modify Makefiles to pick up unified file.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent f8c2ee2 commit c61e211
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 960 deletions.
2 changes: 1 addition & 1 deletion arch/x86/mm/Makefile_32
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the linux i386-specific parts of the memory manager.
#

obj-y := init_32.o pgtable_32.o fault_32.o ioremap.o extable.o pageattr.o mmap.o
obj-y := init_32.o pgtable_32.o fault.o ioremap.o extable.o pageattr.o mmap.o

obj-$(CONFIG_NUMA) += discontig_32.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/Makefile_64
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Makefile for the linux x86_64-specific parts of the memory manager.
#

obj-y := init_64.o fault_64.o ioremap.o extable.o pageattr.o mmap.o
obj-y := init_64.o fault.o ioremap.o extable.o pageattr.o mmap.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
obj-$(CONFIG_NUMA) += numa_64.o
obj-$(CONFIG_K8_NUMA) += k8topology_64.o
Expand Down
21 changes: 12 additions & 9 deletions arch/x86/mm/fault_64.c → arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
#include <linux/tty.h>
#include <linux/vt_kern.h> /* For unblank_screen() */
#include <linux/compiler.h>
#include <linux/highmem.h>
#include <linux/bootmem.h> /* for max_low_pfn */
#include <linux/vmalloc.h>
#include <linux/module.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>
#include <linux/kdebug.h>

#include <asm/system.h>
#include <asm/desc.h>
#include <asm/segment.h>
#include <asm/pgalloc.h>
#include <asm/smp.h>
#include <asm/tlbflush.h>
Expand Down Expand Up @@ -88,16 +92,15 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned char *max_instr;

#ifdef CONFIG_X86_32
if (unlikely(boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
boot_cpu_data.x86 >= 6)) {
/* Catch an obscure case of prefetch inside an NX page. */
if (nx_enabled && (error_code & PF_INSTR))
return 0;
} else {
# ifdef CONFIG_X86_PAE
/* If it was a exec fault on NX page, ignore */
if (nx_enabled && (error_code & PF_INSTR))
return 0;
}
#else
/* If it was a exec fault ignore */
# else
return 0;
# endif
#else /* CONFIG_X86_64 */
/* If it was a exec fault on NX page, ignore */
if (error_code & PF_INSTR)
return 0;
#endif
Expand Down
Loading

0 comments on commit c61e211

Please sign in to comment.