[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080103152443.CA76214E23@wotan.suse.de>
Date: Thu, 3 Jan 2008 16:24:43 +0100 (CET)
From: Andi Kleen <ak@...e.de>
To: linux-kernel@...r.kernel.org
Subject: [PATCH CPA] [28/28] Make kernel_text test match boot mapping initialization
The boot direct mapping initialization used a different test to check if a
page was part of the kernel mapping than c_p_a(). Fix that. Also
round up to a large page size to be sure.
Signed-off-by: Andi Kleen <ak@...e.de>
---
arch/x86/mm/pageattr_32.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Index: linux/arch/x86/mm/pageattr_32.c
===================================================================
--- linux.orig/arch/x86/mm/pageattr_32.c
+++ linux/arch/x86/mm/pageattr_32.c
@@ -183,6 +183,12 @@ static int cache_attr_changed(pte_t pte,
return a != (pgprot_val(prot) & _PAGE_CACHE);
}
+static int text_address(unsigned long addr)
+{
+ unsigned long end = ((unsigned long)__init_end & LARGE_PAGE_MASK);
+ return addr < end + LARGE_PAGE_SIZE;
+}
+
/*
* Mark the address for flushing later in global_tlb_flush().
*
@@ -237,7 +243,7 @@ __change_page_attr(struct page *page, pg
set_tlb_flush(address, cache_attr_changed(*kpte, prot, level),
level < 3);
- if ((address & LARGE_PAGE_MASK) < (unsigned long)&_etext)
+ if (text_address(address))
ref_prot = PAGE_KERNEL_EXEC;
if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists