Commit 3085354d authored by Ingo Molnar's avatar Ingo Molnar

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: default avatarIngo Molnar <mingo@elte.hu>
parent fb8c7fb2
...@@ -91,13 +91,10 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr, ...@@ -91,13 +91,10 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
int prefetch = 0; int prefetch = 0;
unsigned char *max_instr; unsigned char *max_instr;
#ifdef CONFIG_X86_32 /*
/* Catch an obscure case of prefetch inside an NX page: */ * If it was a exec (instruction fetch) fault on NX page, then
if ((__supported_pte_mask & _PAGE_NX) && (error_code & 16)) * do not ignore the fault:
return 0; */
#endif
/* If it was a exec fault on NX page, ignore */
if (error_code & PF_INSTR) if (error_code & PF_INSTR)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment