diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-01-30 07:34:11 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:34:11 -0500 |
commit | b406ac61e94875723540bd56e26f634afdeef489 (patch) | |
tree | 66efba6274ad0c3e45b8d42226a78725173c578c /arch/x86/mm/fault.c | |
parent | c61e211d9989e4c112d3d58db12ad58f9016a3c8 (diff) |
x86: remove nx_enabled from fault.c
On !PAE 32-bit, _PAGE_NX will be 0, making is_prefetch always
return early. The test is sufficient on PAE as __supported_pte_mask
is updated in the same places as nx_enabled in init_32.c which also
takes disable_nx into account.
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>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 14a0c6e541de..99d273dbc758 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -92,18 +92,13 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr, | |||
92 | unsigned char *max_instr; | 92 | unsigned char *max_instr; |
93 | 93 | ||
94 | #ifdef CONFIG_X86_32 | 94 | #ifdef CONFIG_X86_32 |
95 | # ifdef CONFIG_X86_PAE | 95 | if (!(__supported_pte_mask & _PAGE_NX)) |
96 | /* If it was a exec fault on NX page, ignore */ | ||
97 | if (nx_enabled && (error_code & PF_INSTR)) | ||
98 | return 0; | 96 | return 0; |
99 | # else | 97 | #endif |
100 | return 0; | 98 | |
101 | # endif | ||
102 | #else /* CONFIG_X86_64 */ | ||
103 | /* If it was a exec fault on NX page, ignore */ | 99 | /* If it was a exec fault on NX page, ignore */ |
104 | if (error_code & PF_INSTR) | 100 | if (error_code & PF_INSTR) |
105 | return 0; | 101 | return 0; |
106 | #endif | ||
107 | 102 | ||
108 | instr = (unsigned char *)convert_ip_to_linear(current, regs); | 103 | instr = (unsigned char *)convert_ip_to_linear(current, regs); |
109 | max_instr = instr + 15; | 104 | max_instr = instr + 15; |