x86: cpa self-test fixes
[sfrench/cifs-2.6.git] / arch / x86 / mm / pageattr-test.c
index c58fab0617629057b02c7b3ef0049bd14d5cdb0f..a12dabbd5c33e116e18440c1dc5211f2f3437085 100644 (file)
@@ -106,12 +106,6 @@ static __init int print_split(struct split_state *s)
        return err;
 }
 
-static __init int state_same(struct split_state *a, struct split_state *b)
-{
-       return a->lpg == b->lpg && a->gpg == b->gpg && a->spg == b->spg &&
-               a->exec == b->exec;
-}
-
 static unsigned long __initdata addr[NTEST];
 static unsigned int __initdata len[NTEST];
 
@@ -177,7 +171,7 @@ static __init int exercise_pageattr(void)
                        continue;
                }
 
-               err = change_page_attr(virt_to_page(addr[i]), len[i],
+               err = change_page_attr_addr(addr[i], len[i],
                            pte_pgprot(pte_clrhuge(pte_clrglobal(pte0))));
                if (err < 0) {
                        printk(KERN_ERR "CPA %d failed %d\n", i, err);
@@ -212,7 +206,7 @@ static __init int exercise_pageattr(void)
                        failed++;
                        continue;
                }
-               err = change_page_attr(virt_to_page(addr[i]), len[i],
+               err = change_page_attr_addr(addr[i], len[i],
                                          pte_pgprot(pte_mkglobal(*pte)));
                if (err < 0) {
                        printk(KERN_ERR "CPA reverting failed: %d\n", err);
@@ -229,8 +223,6 @@ static __init int exercise_pageattr(void)
        global_flush_tlb();
 
        failed += print_split(&sc);
-       if (!state_same(&sa, &sc))
-               failed++;
 
        if (failed)
                printk(KERN_ERR "CPA selftests NOT PASSED. Please report.\n");