[PATCH 5/9] powerpc/mm: Merge various PTE bits and accessors definitions (v2)
Kumar Gala
galak at kernel.crashing.org
Fri Mar 20 03:16:30 EST 2009
On Mar 10, 2009, at 10:53 PM, Benjamin Herrenschmidt wrote:
> +
> +/* Conversion functions: convert a page and protection to a page
> entry,
> + * and a page entry and page directory to the page they refer to.
> + *
> + * Even if PTEs can be unsigned long long, a PFN is always an
> unsigned
> + * long for now.
> + */
> +static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot) {
> + return __pte((pfn << PTE_RPN_SHIFT) | pgprot_val(pgprot)); }
This needs to be:
return __pte(((pte_basic_t)(pfn) << PTE_RPN_SHIFT) |
pgprot_val(pgprot)); }
Otherwise on ppc32 w/36-bit physical we lose the upper bits of the pfn.
- k
More information about the Linuxppc-dev
mailing list