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>
This commit is contained in:
parent
c61e211d99
commit
b406ac61e9
1 changed files with 3 additions and 8 deletions
|
@ -92,18 +92,13 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
|
||||||
unsigned char *max_instr;
|
unsigned char *max_instr;
|
||||||
|
|
||||||
#ifdef CONFIG_X86_32
|
#ifdef CONFIG_X86_32
|
||||||
# ifdef CONFIG_X86_PAE
|
if (!(__supported_pte_mask & _PAGE_NX))
|
||||||
/* If it was a exec fault on NX page, ignore */
|
|
||||||
if (nx_enabled && (error_code & PF_INSTR))
|
|
||||||
return 0;
|
return 0;
|
||||||
# else
|
#endif
|
||||||
return 0;
|
|
||||||
# endif
|
|
||||||
#else /* CONFIG_X86_64 */
|
|
||||||
/* If it was a exec fault on NX page, ignore */
|
/* If it was a exec fault on NX page, ignore */
|
||||||
if (error_code & PF_INSTR)
|
if (error_code & PF_INSTR)
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
instr = (unsigned char *)convert_ip_to_linear(current, regs);
|
instr = (unsigned char *)convert_ip_to_linear(current, regs);
|
||||||
max_instr = instr + 15;
|
max_instr = instr + 15;
|
||||||
|
|
Loading…
Reference in a new issue