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

    x86: don't drop NX bit in pte modifier functions on 32-bit
    
    The pte_* modifier functions that cleared bits dropped the NX bit on 32bit
    PAE because they only worked in int, but NX is in bit 63. Fix that
    by adding appropiate casts so that the arithmetic happens as long long
    on PAE kernels.
    
    I decided to just use 64bit arithmetic instead of open coding like
    pte_modify() because gcc should generate good enough code for that now.
    
    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]>
---
 include/asm-x86/pgtable.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index b4ee593..2f93723 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -147,17 +147,17 @@ static inline int pmd_large(pmd_t pte) {
                (_PAGE_PSE|_PAGE_PRESENT);
 }
 
-static inline pte_t pte_mkclean(pte_t pte)     { return __pte(pte_val(pte) & 
~_PAGE_DIRTY); }
-static inline pte_t pte_mkold(pte_t pte)       { return __pte(pte_val(pte) & 
~_PAGE_ACCESSED); }
-static inline pte_t pte_wrprotect(pte_t pte)   { return __pte(pte_val(pte) & 
~_PAGE_RW); }
-static inline pte_t pte_mkexec(pte_t pte)      { return __pte(pte_val(pte) & 
~_PAGE_NX); }
+static inline pte_t pte_mkclean(pte_t pte)     { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_DIRTY); }
+static inline pte_t pte_mkold(pte_t pte)       { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_ACCESSED); }
+static inline pte_t pte_wrprotect(pte_t pte)   { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_RW); }
+static inline pte_t pte_mkexec(pte_t pte)      { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_NX); }
 static inline pte_t pte_mkdirty(pte_t pte)     { return __pte(pte_val(pte) | 
_PAGE_DIRTY); }
 static inline pte_t pte_mkyoung(pte_t pte)     { return __pte(pte_val(pte) | 
_PAGE_ACCESSED); }
 static inline pte_t pte_mkwrite(pte_t pte)     { return __pte(pte_val(pte) | 
_PAGE_RW); }
 static inline pte_t pte_mkhuge(pte_t pte)      { return __pte(pte_val(pte) | 
_PAGE_PSE); }
-static inline pte_t pte_clrhuge(pte_t pte)     { return __pte(pte_val(pte) & 
~_PAGE_PSE); }
+static inline pte_t pte_clrhuge(pte_t pte)     { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_PSE); }
 static inline pte_t pte_mkglobal(pte_t pte)    { return __pte(pte_val(pte) | 
_PAGE_GLOBAL); }
-static inline pte_t pte_clrglobal(pte_t pte)   { return __pte(pte_val(pte) & 
~_PAGE_GLOBAL); }
+static inline pte_t pte_clrglobal(pte_t pte)   { return __pte(pte_val(pte) & 
~(pteval_t)_PAGE_GLOBAL); }
 
 extern pteval_t __supported_pte_mask;
 
-
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