aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/fault.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-03-27 16:29:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-03-27 17:00:16 -0400
commit3085354de635179d70c240e6d942bcbd1d93056c (patch)
tree60d67b5d16ea9fc73a0e0d091162c337bc87e5e7 /arch/x86/mm/fault.c
parentfb8c7fb25d7d754a992481e9f763ec0b5889c4d9 (diff)
x86: prefetch fix #2
Linus noticed a second bug and an uncleanliness: - we'd return on any instruction fetch fault - we'd use both the value of 16 and the PF_INSTR symbol which are the same and make no sense the cleanup nicely unifies this piece of logic. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r--arch/x86/mm/fault.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index c0c82bc143c9..ec08d8389850 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -91,13 +91,10 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
91 int prefetch = 0; 91 int prefetch = 0;
92 unsigned char *max_instr; 92 unsigned char *max_instr;
93 93
94#ifdef CONFIG_X86_32 94 /*
95 /* Catch an obscure case of prefetch inside an NX page: */ 95 * If it was a exec (instruction fetch) fault on NX page, then
96 if ((__supported_pte_mask & _PAGE_NX) && (error_code & 16)) 96 * do not ignore the fault:
97 return 0; 97 */
98#endif
99
100 /* If it was a exec fault on NX page, ignore */
101 if (error_code & PF_INSTR) 98 if (error_code & PF_INSTR)
102 return 0; 99 return 0;
103 100