[PATCH] [5/36] CPA: Implement change_page_attr_addr entry point for i386

From: Andi Kleen
Date: Wed Jan 16 2008 - 17:16:59 EST



Similar to 64bit.

Needed by PAT patches. Replaces 5ec5c5a2302ca8794da03f8bedec931a2a814ae9

Note: should probably be put before PAT patches to avoid bisect failures later

Signed-off-by: Andi Kleen <ak@xxxxxxx>

---
arch/x86/mm/pageattr_32.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)

Index: linux/arch/x86/mm/pageattr_32.c
===================================================================
--- linux.orig/arch/x86/mm/pageattr_32.c
+++ linux/arch/x86/mm/pageattr_32.c
@@ -233,6 +233,21 @@ int change_page_attr(struct page *page,
return err;
}

+int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot)
+{
+ int i;
+ unsigned long pfn = (addr >> PAGE_SHIFT);
+ for (i = 0; i < numpages; i++) {
+ if (!pfn_valid(pfn + i)) {
+ break;
+ } else {
+ pte_t *pte = lookup_address(addr + i*PAGE_SIZE);
+ BUG_ON(pte && !pte_none(*pte));
+ }
+ }
+ return change_page_attr(virt_to_page(addr), i, prot);
+}
+
void global_flush_tlb(void)
{
struct list_head l;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/