From: Thomas Gleixner Date: Mon, 4 Feb 2008 15:48:08 +0000 (+0100) Subject: x86: fix page-present check in cpa_flush_range X-Git-Tag: v2.6.25-rc1~1057^2~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bfb72e847c201fe32271fb13f75d060671d8890;p=linux-2.6 x86: fix page-present check in cpa_flush_range pte_present() might return true for PROT_NONE mappings. Explicitely check the present bit. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index 0b029c9717..9be684e61d 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -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); } }