aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2008-01-30 07:34:06 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:34:06 -0500
commit6d238cc4dc8a36a3915c26202fe49f58a0683fb9 (patch)
treef17d1b7d27ab48ba3b5f998a8a286c198b052ce2 /arch/x86/mm/init_64.c
parent75cbade8ea3127a84e3da7c2c15808e54f0df7e8 (diff)
x86: convert CPA users to the new set_page_ API
This patch converts various users of change_page_attr() to the new, more intent driven set_page_*/set_memory_* API set. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index c250580a9432..05bb12db0b09 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -556,8 +556,6 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
556 init_page_count(virt_to_page(addr)); 556 init_page_count(virt_to_page(addr));
557 memset((void *)(addr & ~(PAGE_SIZE-1)), 557 memset((void *)(addr & ~(PAGE_SIZE-1)),
558 POISON_FREE_INITMEM, PAGE_SIZE); 558 POISON_FREE_INITMEM, PAGE_SIZE);
559 if (addr >= __START_KERNEL_map)
560 change_page_attr_addr(addr, 1, __pgprot(0));
561 free_page(addr); 559 free_page(addr);
562 totalram_pages++; 560 totalram_pages++;
563 } 561 }
@@ -594,13 +592,13 @@ void mark_rodata_ro(void)
594 if (end <= start) 592 if (end <= start)
595 return; 593 return;
596 594
597 change_page_attr_addr(start, (end - start) >> PAGE_SHIFT, PAGE_KERNEL_RO); 595 set_memory_ro(start, (end - start) >> PAGE_SHIFT);
598 596
599 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n", 597 printk(KERN_INFO "Write protecting the kernel read-only data: %luk\n",
600 (end - start) >> 10); 598 (end - start) >> 10);
601 599
602 /* 600 /*
603 * change_page_attr_addr() requires a global_flush_tlb() call after it. 601 * set_memory_*() requires a global_flush_tlb() call after it.
604 * We do this after the printk so that if something went wrong in the 602 * We do this after the printk so that if something went wrong in the
605 * change, the printk gets out at least to give a better debug hint 603 * change, the printk gets out at least to give a better debug hint
606 * of who is the culprit. 604 * of who is the culprit.
@@ -609,11 +607,11 @@ void mark_rodata_ro(void)
609 607
610#ifdef CONFIG_CPA_DEBUG 608#ifdef CONFIG_CPA_DEBUG
611 printk("Testing CPA: undo %lx-%lx\n", start, end); 609 printk("Testing CPA: undo %lx-%lx\n", start, end);
612 change_page_attr_addr(start, (end - start) >> PAGE_SHIFT, PAGE_KERNEL); 610 set_memory_rw(start, (end-start) >> PAGE_SHIFT);
613 global_flush_tlb(); 611 global_flush_tlb();
614 612
615 printk("Testing CPA: again\n"); 613 printk("Testing CPA: again\n");
616 change_page_attr_addr(start, (end - start) >> PAGE_SHIFT, PAGE_KERNEL_RO); 614 set_memory_ro(start, (end-start) >> PAGE_SHIFT);
617 global_flush_tlb(); 615 global_flush_tlb();
618#endif 616#endif
619} 617}