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

    x86: simplify cpa largepage split, #3
    
    simplify cpa largepage split: push the reference protection bits
    into the largepage-splitting function.
    
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr_32.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c
index ad0868b..0966023 100644
--- a/arch/x86/mm/pageattr_32.c
+++ b/arch/x86/mm/pageattr_32.c
@@ -61,13 +61,13 @@ static void set_pmd_pte(pte_t *kpte, unsigned long address, 
pte_t pte)
        spin_unlock_irqrestore(&pgd_lock, flags);
 }
 
-static int
-split_large_page(pte_t *kpte, unsigned long address, pgprot_t ref_prot)
+static int split_large_page(pte_t *kpte, unsigned long address)
 {
-       int i, level;
+       pgprot_t ref_prot = pte_pgprot(pte_clrhuge(*kpte));
        unsigned long addr;
        pte_t *pbase, *tmp;
        struct page *base;
+       int i, level;
 
        base = alloc_pages(GFP_KERNEL, 0);
        if (!base)
@@ -109,11 +109,9 @@ out_unlock:
 
 static int __change_page_attr(struct page *page, pgprot_t prot)
 {
-       pgprot_t ref_prot = PAGE_KERNEL;
        struct page *kpte_page;
        unsigned long address;
        int level, err = 0;
-       pgprot_t oldprot;
        pte_t *kpte;
 
        BUG_ON(PageHighMem(page));
@@ -124,7 +122,6 @@ repeat:
        if (!kpte)
                return -EINVAL;
 
-       oldprot = pte_pgprot(*kpte);
        kpte_page = virt_to_page(kpte);
        BUG_ON(PageLRU(kpte_page));
        BUG_ON(PageCompound(kpte_page));
@@ -137,16 +134,10 @@ repeat:
                address < (unsigned long)&_etext &&
               (pgprot_val(prot) & _PAGE_NX));
 
-       if ((address & LARGE_PAGE_MASK) < (unsigned long)&_etext)
-               ref_prot = PAGE_KERNEL_EXEC;
-
-       ref_prot = canon_pgprot(ref_prot);
-       prot = canon_pgprot(prot);
-
        if (level == 3) {
-               set_pte_atomic(kpte, mk_pte(page, prot));
+               set_pte_atomic(kpte, mk_pte(page, canon_pgprot(prot)));
        } else {
-               err = split_large_page(kpte, address, ref_prot);
+               err = split_large_page(kpte, address);
                if (!err)
                        goto repeat;
        }
-
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