Skip to content

Commit

Permalink
x86: prefetch fix #2
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Mar 27, 2008
1 parent fb8c7fb commit 3085354
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,10 @@ static int is_prefetch(struct pt_regs *regs, unsigned long addr,
int prefetch = 0;
unsigned char *max_instr;

#ifdef CONFIG_X86_32
/* Catch an obscure case of prefetch inside an NX page: */
if ((__supported_pte_mask & _PAGE_NX) && (error_code & 16))
return 0;
#endif

/* If it was a exec fault on NX page, ignore */
/*
* If it was a exec (instruction fetch) fault on NX page, then
* do not ignore the fault:
*/
if (error_code & PF_INSTR)
return 0;

Expand Down

0 comments on commit 3085354

Please sign in to comment.