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

    x86: clean up and simplify 64-bit split_large_page()
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr_64.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 107b03c..cbded83 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -46,7 +46,7 @@ pte_t *lookup_address(unsigned long address, int *level)
 }
 
 static struct page *
-split_large_page(unsigned long address, pgprot_t prot, pgprot_t ref_prot)
+split_large_page(unsigned long address, pgprot_t ref_prot)
 {
        unsigned long addr;
        struct page *base;
@@ -60,10 +60,9 @@ split_large_page(unsigned long address, pgprot_t prot, 
pgprot_t ref_prot)
        address = __pa(address);
        addr = address & LARGE_PAGE_MASK;
        pbase = (pte_t *)page_address(base);
-       for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
-               pbase[i] = pfn_pte(addr >> PAGE_SHIFT,
-                                  addr == address ? prot : ref_prot);
-       }
+       for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE)
+               pbase[i] = pfn_pte(addr >> PAGE_SHIFT, ref_prot);
+
        return base;
 }
 
@@ -76,6 +75,7 @@ __change_page_attr(unsigned long address, unsigned long pfn, 
pgprot_t prot,
        pgprot_t ref_prot2, oldprot;
        int level;
 
+repeat:
        kpte = lookup_address(address, &level);
        if (!kpte)
                return 0;
@@ -98,12 +98,12 @@ __change_page_attr(unsigned long address, unsigned long 
pfn, pgprot_t prot,
                        struct page *split;
 
                        ref_prot2 = pte_pgprot(pte_clrhuge(*kpte));
-                       split = split_large_page(address, prot, ref_prot2);
+                       split = split_large_page(address, ref_prot2);
                        if (!split)
                                return -ENOMEM;
                        pgprot_val(ref_prot2) &= ~_PAGE_NX;
                        set_pte(kpte, mk_pte(split, ref_prot2));
-                       kpte_page = split;
+                       goto repeat;
                }
        } else {
                if (level == 4) {
-
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