diff options
author | Jan Beulich <jbeulich@novell.com> | 2007-05-02 19:27:10 +0200 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2007-05-02 19:27:10 +0200 |
commit | d01ad8dd56527be72947b4b9997bb2c05783c3ed (patch) | |
tree | 4bb9ad792fae974101d0baec755202eebc8181aa /arch/i386/mm | |
parent | 90a0a06aa81692028864c21f981905fda46b1208 (diff) | |
download | op-kernel-dev-d01ad8dd56527be72947b4b9997bb2c05783c3ed.zip op-kernel-dev-d01ad8dd56527be72947b4b9997bb2c05783c3ed.tar.gz |
[PATCH] x86: Improve handling of kernel mappings in change_page_attr
Fix various broken corner cases in i386 and x86-64 change_page_attr.
AK: split off from tighten kernel image access rights
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/mm')
-rw-r--r-- | arch/i386/mm/pageattr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/i386/mm/pageattr.c b/arch/i386/mm/pageattr.c index 412ebbd..ea6b6d4a 100644 --- a/arch/i386/mm/pageattr.c +++ b/arch/i386/mm/pageattr.c @@ -142,7 +142,7 @@ __change_page_attr(struct page *page, pgprot_t prot) return -EINVAL; kpte_page = virt_to_page(kpte); if (pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { - if ((pte_val(*kpte) & _PAGE_PSE) == 0) { + if (!pte_huge(*kpte)) { set_pte_atomic(kpte, mk_pte(page, prot)); } else { pgprot_t ref_prot; @@ -158,7 +158,7 @@ __change_page_attr(struct page *page, pgprot_t prot) kpte_page = split; } page_private(kpte_page)++; - } else if ((pte_val(*kpte) & _PAGE_PSE) == 0) { + } else if (!pte_huge(*kpte)) { set_pte_atomic(kpte, mk_pte(page, PAGE_KERNEL)); BUG_ON(page_private(kpte_page) == 0); page_private(kpte_page)--; |