diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-09 18:41:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 18:41:02 -0500 |
commit | 92e2d508464b6293ad274fb606f766a458894142 (patch) | |
tree | 39bf383364530e5cdeacb205d32d69a4b78e253d /arch/x86/include/asm/pgtable.h | |
parent | 5d96218b4a5ee0c5ff0ac87f3ba90cfa86ca0ca1 (diff) | |
parent | d315760ffa261c15ff92699ac6f514112543d7ca (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.h | 26 |
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 | ||
317 | extern pteval_t __supported_pte_mask; | 317 | extern 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 | */ | ||
323 | static 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 | |||
319 | static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | 333 | static 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 | ||
325 | static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) | 339 | static 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 | ||
331 | static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | 345 | static 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 | ||
358 | static inline int is_new_memtype_allowed(unsigned long flags, | 372 | static inline int is_new_memtype_allowed(unsigned long flags, |
359 | unsigned long new_flags) | 373 | unsigned long new_flags) |