Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=895bdc29956e5c9e9e101b2b1c2f0ed34130f945
Commit:     895bdc29956e5c9e9e101b2b1c2f0ed34130f945
Parent:     3c868823413d76bdd80c643603be8ab09dcb4d65
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:52 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:52 2008 +0100

    x86: c_p_a() make it more robust against use of PAT bits
    
    Use the page table level instead of the PSE bit to check if the PTE
    is for a 4K page or not. This makes the code more robust when the PAT
    bit is changed because the PAT bit on 4K pages is in the same position
    as the PSE bit.
    
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Acked-by: Jan Beulich <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/mm/pageattr_32.c |    4 ++--
 arch/x86/mm/pageattr_64.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c
index 5cb5c71..66688a6 100644
--- a/arch/x86/mm/pageattr_32.c
+++ b/arch/x86/mm/pageattr_32.c
@@ -172,7 +172,7 @@ static int __change_page_attr(struct page *page, pgprot_t 
prot)
        BUG_ON(PageCompound(kpte_page));
 
        if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) {
-               if (!pte_huge(*kpte)) {
+               if (level == 3) {
                        set_pte_atomic(kpte, mk_pte(page, prot));
                } else {
                        struct page *split;
@@ -190,7 +190,7 @@ static int __change_page_attr(struct page *page, pgprot_t 
prot)
                }
                page_private(kpte_page)++;
        } else {
-               if (!pte_huge(*kpte)) {
+               if (level == 3) {
                        set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL));
                        BUG_ON(page_private(kpte_page) == 0);
                        page_private(kpte_page)--;
diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c
index 3ccdb14..73dbbb4 100644
--- a/arch/x86/mm/pageattr_64.c
+++ b/arch/x86/mm/pageattr_64.c
@@ -153,7 +153,7 @@ __change_page_attr(unsigned long address, unsigned long 
pfn, pgprot_t prot,
        BUG_ON(PageLRU(kpte_page));
        BUG_ON(PageCompound(kpte_page));
        if (pgprot_val(prot) != pgprot_val(ref_prot)) {
-               if (!pte_huge(*kpte)) {
+               if (level == 4) {
                        set_pte(kpte, pfn_pte(pfn, prot));
                } else {
                        /*
@@ -172,7 +172,7 @@ __change_page_attr(unsigned long address, unsigned long 
pfn, pgprot_t prot,
                }
                page_private(kpte_page)++;
        } else {
-               if (!pte_huge(*kpte)) {
+               if (level == 4) {
                        set_pte(kpte, pfn_pte(pfn, ref_prot));
                        BUG_ON(page_private(kpte_page) == 0);
                        page_private(kpte_page)--;
-
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