Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5508a7489659f1eed108d3ae7c2d36c8794ee330
Commit:     5508a7489659f1eed108d3ae7c2d36c8794ee330
Parent:     bb5c2dbd57d93a36b0386dd783dd95e0cbaaa23f
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:56 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:56 2008 +0100

    x86: cpa self-test fixes
    
    cpa self-test fixes. change_page_attr_addr() was buggy, it
    passed in a virtual address as a physical one.
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr-test.c |    8 --------
 arch/x86/mm/pageattr_32.c   |   10 +++++++---
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
index 91e05a2..a12dabb 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -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];
 
@@ -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");
diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c
index 14c923b..ad0868b 100644
--- a/arch/x86/mm/pageattr_32.c
+++ b/arch/x86/mm/pageattr_32.c
@@ -79,8 +79,10 @@ split_large_page(pte_t *kpte, unsigned long address, 
pgprot_t ref_prot)
         * up for us already:
         */
        tmp = lookup_address(address, &level);
-       if (tmp != kpte)
+       if (tmp != kpte) {
+               WARN_ON_ONCE(1);
                goto out_unlock;
+       }
 
        address = __pa(address);
        addr = address & LARGE_PAGE_MASK;
@@ -181,17 +183,19 @@ EXPORT_SYMBOL(change_page_attr);
 int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot)
 {
        int i;
-       unsigned long pfn = (addr >> PAGE_SHIFT);
+       unsigned long pfn = (__pa(addr) >> PAGE_SHIFT);
 
        for (i = 0; i < numpages; i++) {
                if (!pfn_valid(pfn + i)) {
+                       WARN_ON_ONCE(1);
                        break;
                } else {
                        int level;
                        pte_t *pte = lookup_address(addr + i*PAGE_SIZE, &level);
-                       BUG_ON(pte && !pte_none(*pte));
+                       BUG_ON(pte && pte_none(*pte));
                }
        }
+
        return change_page_attr(virt_to_page(addr), i, prot);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to