Skip to content

Commit

Permalink
x86: fix page-present check in cpa_flush_range
Browse files Browse the repository at this point in the history
pte_present() might return true for PROT_NONE mappings.
Explicitely check the present bit.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 4, 2008
1 parent 6ce9fc1 commit 7bfb72e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void cpa_flush_range(unsigned long start, int numpages, int cache)
/*
* Only flush present addresses:
*/
if (pte && pte_present(*pte))
if (pte && (pte_val(*pte) & _PAGE_PRESENT))
clflush_cache_range((void *) addr, PAGE_SIZE);
}
}
Expand Down

0 comments on commit 7bfb72e

Please sign in to comment.