]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/mm/init_32.c
x86: convert CPA users to the new set_page_ API
[linux-2.6-omap-h63xx.git] / arch / x86 / mm / init_32.c
index 016c8ccd1d8de56c45f0ba5dd833c9b6c792e3d6..7c9bb3076b8a13c8c52f96e1329f4e977db6dfb0 100644 (file)
@@ -770,34 +770,30 @@ void mark_rodata_ro(void)
        if (num_possible_cpus() <= 1)
 #endif
        {
-               change_page_attr(virt_to_page(start),
-                                size >> PAGE_SHIFT, PAGE_KERNEL_RX);
+               set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
                printk("Write protecting the kernel text: %luk\n", size >> 10);
 
 #ifdef CONFIG_CPA_DEBUG
                global_flush_tlb();
 
                printk("Testing CPA: Reverting %lx-%lx\n", start, start+size);
-               change_page_attr(virt_to_page(start), size>>PAGE_SHIFT,
-                                PAGE_KERNEL_EXEC);
+               set_pages_rw(virt_to_page(start), size>>PAGE_SHIFT);
                global_flush_tlb();
 
                printk("Testing CPA: write protecting again\n");
-               change_page_attr(virt_to_page(start), size>>PAGE_SHIFT,
-                               PAGE_KERNEL_RX);
+               set_pages_ro(virt_to_page(start), size>>PAGE_SHIFT);
                global_flush_tlb();
 #endif
        }
 #endif
        start += size;
        size = (unsigned long)__end_rodata - start;
-       change_page_attr(virt_to_page(start),
-                        size >> PAGE_SHIFT, PAGE_KERNEL_RO);
+       set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
        printk("Write protecting the kernel read-only data: %luk\n",
               size >> 10);
 
        /*
-        * change_page_attr() requires a global_flush_tlb() call after it.
+        * set_pages_*() requires a global_flush_tlb() call after it.
         * We do this after the printk so that if something went wrong in the
         * change, the printk gets out at least to give a better debug hint
         * of who is the culprit.
@@ -806,13 +802,11 @@ void mark_rodata_ro(void)
 
 #ifdef CONFIG_CPA_DEBUG
        printk("Testing CPA: undo %lx-%lx\n", start, start + size);
-       change_page_attr(virt_to_page(start), size >> PAGE_SHIFT,
-                               PAGE_KERNEL);
+       set_pages_rw(virt_to_page(start), size >> PAGE_SHIFT);
        global_flush_tlb();
 
        printk("Testing CPA: write protecting again\n");
-       change_page_attr(virt_to_page(start), size >> PAGE_SHIFT,
-                               PAGE_KERNEL_RO);
+       set_pages_ro(virt_to_page(start), size >> PAGE_SHIFT);
        global_flush_tlb();
 #endif
 }