aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_32.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_32.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_32.c')
-rw-r--r--arch/x86/mm/init_32.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 016c8ccd1d8d..7c9bb3076b8a 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -770,34 +770,30 @@ void mark_rodata_ro(void)
770 if (num_possible_cpus() <= 1) 770 if (num_possible_cpus() <= 1)
771#endif 771#endif
772 { 772 {
773 change_page_attr(virt_to_page(start), 773 set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
774 size >> PAGE_SHIFT, PAGE_KERNEL_RX);
775 printk("Write protecting the kernel text: %luk\n", size >> 10); 774 printk("Write protecting the kernel text: %luk\n", size >> 10);
776 775
777#ifdef CONFIG_CPA_DEBUG 776#ifdef CONFIG_CPA_DEBUG
778 global_flush_tlb(); 777 global_flush_tlb();
779 778
780 printk("Testing CPA: Reverting %lx-%lx\n", start, start+size); 779 printk("Testing CPA: Reverting %lx-%lx\n", start, start+size);
781 change_page_attr(virt_to_page(start), size>>PAGE_SHIFT, 780 set_pages_rw(virt_to_page(start), size>>PAGE_SHIFT);
782 PAGE_KERNEL_EXEC);
783 global_flush_tlb(); 781 global_flush_tlb();
784 782
785 printk("Testing CPA: write protecting again\n"); 783 printk("Testing CPA: write protecting again\n");
786 change_page_attr(virt_to_page(start), size>>PAGE_SHIFT, 784 set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT);
787 PAGE_KERNEL_RX);
788 global_flush_tlb(); 785 global_flush_tlb();
789#endif 786#endif
790 } 787 }
791#endif 788#endif
792 start += size; 789 start += size;
793 size = (unsigned long)__end_rodata - start; 790 size = (unsigned long)__end_rodata - start;
794 change_page_attr(virt_to_page(start), 791 set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
795 size >> PAGE_SHIFT, PAGE_KERNEL_RO);
796 printk("Write protecting the kernel read-only data: %luk\n", 792 printk("Write protecting the kernel read-only data: %luk\n",
797 size >> 10); 793 size >> 10);
798 794
799 /* 795 /*
800 * change_page_attr() requires a global_flush_tlb() call after it. 796 * set_pages_*() requires a global_flush_tlb() call after it.
801 * We do this after the printk so that if something went wrong in the 797 * We do this after the printk so that if something went wrong in the
802 * change, the printk gets out at least to give a better debug hint 798 * change, the printk gets out at least to give a better debug hint
803 * of who is the culprit. 799 * of who is the culprit.
@@ -806,13 +802,11 @@ void mark_rodata_ro(void)
806 802
807#ifdef CONFIG_CPA_DEBUG 803#ifdef CONFIG_CPA_DEBUG
808 printk("Testing CPA: undo %lx-%lx\n", start, start + size); 804 printk("Testing CPA: undo %lx-%lx\n", start, start + size);
809 change_page_attr(virt_to_page(start), size >> PAGE_SHIFT, 805 set_pages_rw(virt_to_page(start), size >> PAGE_SHIFT);
810 PAGE_KERNEL);
811 global_flush_tlb(); 806 global_flush_tlb();
812 807
813 printk("Testing CPA: write protecting again\n"); 808 printk("Testing CPA: write protecting again\n");
814 change_page_attr(virt_to_page(start), size >> PAGE_SHIFT, 809 set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
815 PAGE_KERNEL_RO);
816 global_flush_tlb(); 810 global_flush_tlb();
817#endif 811#endif
818} 812}