[PATCH] powerpc/mm: Add _PAGE_DEVMAP pte bit for ppc64.
Denis Kirjanov
kda at linux-powerpc.org
Mon Nov 7 20:37:40 AEDT 2016
On Monday, November 7, 2016, Aneesh Kumar K.V <
aneesh.kumar at linux.vnet.ibm.com> wrote:
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com
> <javascript:;>>
Hi Aneesh,
> ---
> NOTE: We need other patches to enable pmem on ppc64. I am waiting
> for dax pmd fault handling cleanup to hit upstream before I send
> the changes. Meanwhile reserve the pte bit.
>
> arch/powerpc/include/asm/book3s/64/pgtable.h | 24
> ++++++++++++++++++++++++
> 1 file changed, 24 insertions(+)
>
> diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h
> b/arch/powerpc/include/asm/book3s/64/pgtable.h
> index 9eed9d66d24f..af9e1a150ae7 100644
> --- a/arch/powerpc/include/asm/book3s/64/pgtable.h
> +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h
> @@ -32,6 +32,8 @@
> #define _PAGE_SOFT_DIRTY 0x00000
> #endif
> #define _PAGE_SPECIAL _RPAGE_SW2 /* software: special page */
> +#define _PAGE_DEVMAP _RPAGE_SW1
> +#define __HAVE_ARCH_PTE_DEVMAP
>
>
> #define _PAGE_PTE (1ul << 62) /* distinguishes PTEs from
> pointers */
> @@ -485,6 +487,16 @@ static inline pte_t pte_mkhuge(pte_t pte)
> return pte;
> }
>
> +static inline pte_t pte_mkdevmap(pte_t pte)
> +{
> + return __pte(pte_val(pte) | _PAGE_SPECIAL|_PAGE_DEVMAP);
> +}
> +
> +static inline int pte_devmap(pte_t pte)
> +{
> + return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP));
> +}
>
> This could be bool, right?
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
> {
> /* FIXME!! check whether this need to be a conditional */
> @@ -1030,6 +1042,18 @@ static inline bool arch_needs_pgtable_deposit(void)
> return true;
> }
>
> +static inline pmd_t pmd_mkdevmap(pmd_t pmd)
> +{
> + /*
> + * No special ptes at pmd level.
> + */
> + return __pmd(pmd_val(pmd) | _PAGE_DEVMAP);
> +}
> +
> +static inline int pmd_devmap(pmd_t pmd)
> +{
> + return pte_devmap(pmd_pte(pmd));
> +}
> #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
> #endif /* __ASSEMBLY__ */
> #endif /* _ASM_POWERPC_BOOK3S_64_PGTABLE_H_ */
> --
> 2.10.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20161107/cc374784/attachment.html>
More information about the Linuxppc-dev
mailing list