aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/pgtable.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-09 18:41:02 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-09 18:41:02 -0500
commit92e2d508464b6293ad274fb606f766a458894142 (patch)
tree39bf383364530e5cdeacb205d32d69a4b78e253d /arch/x86/include/asm/pgtable.h
parent5d96218b4a5ee0c5ff0ac87f3ba90cfa86ca0ca1 (diff)
parentd315760ffa261c15ff92699ac6f514112543d7ca (diff)
Merge branch 'x86/urgent' into core/percpu
Conflicts: arch/x86/kernel/acpi/boot.c
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r--arch/x86/include/asm/pgtable.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 6ceaef08486f..6f7c102018bf 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -316,16 +316,30 @@ static inline pte_t pte_mkspecial(pte_t pte)
316 316
317extern pteval_t __supported_pte_mask; 317extern pteval_t __supported_pte_mask;
318 318
319/*
320 * Mask out unsupported bits in a present pgprot. Non-present pgprots
321 * can use those bits for other purposes, so leave them be.
322 */
323static inline pgprotval_t massage_pgprot(pgprot_t pgprot)
324{
325 pgprotval_t protval = pgprot_val(pgprot);
326
327 if (protval & _PAGE_PRESENT)
328 protval &= __supported_pte_mask;
329
330 return protval;
331}
332
319static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) 333static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
320{ 334{
321 return __pte((((phys_addr_t)page_nr << PAGE_SHIFT) | 335 return __pte(((phys_addr_t)page_nr << PAGE_SHIFT) |
322 pgprot_val(pgprot)) & __supported_pte_mask); 336 massage_pgprot(pgprot));
323} 337}
324 338
325static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) 339static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
326{ 340{
327 return __pmd((((phys_addr_t)page_nr << PAGE_SHIFT) | 341 return __pmd(((phys_addr_t)page_nr << PAGE_SHIFT) |
328 pgprot_val(pgprot)) & __supported_pte_mask); 342 massage_pgprot(pgprot));
329} 343}
330 344
331static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 345static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
@@ -337,7 +351,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
337 * the newprot (if present): 351 * the newprot (if present):
338 */ 352 */
339 val &= _PAGE_CHG_MASK; 353 val &= _PAGE_CHG_MASK;
340 val |= pgprot_val(newprot) & (~_PAGE_CHG_MASK) & __supported_pte_mask; 354 val |= massage_pgprot(newprot) & ~_PAGE_CHG_MASK;
341 355
342 return __pte(val); 356 return __pte(val);
343} 357}
@@ -353,7 +367,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
353 367
354#define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK) 368#define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK)
355 369
356#define canon_pgprot(p) __pgprot(pgprot_val(p) & __supported_pte_mask) 370#define canon_pgprot(p) __pgprot(massage_pgprot(p))
357 371
358static inline int is_new_memtype_allowed(unsigned long flags, 372static inline int is_new_memtype_allowed(unsigned long flags,
359 unsigned long new_flags) 373 unsigned long new_flags)