linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Add _PAGE_DEVMAP pte bit for ppc64.
@ 2016-11-07  8:38 Aneesh Kumar K.V
  2016-11-07  9:37 ` Denis Kirjanov
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2016-11-07  8:38 UTC (permalink / raw)
  To: benh, paulus, mpe; +Cc: linuxppc-dev, Aneesh Kumar K.V

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
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));
+}
+
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/mm: Add _PAGE_DEVMAP pte bit for ppc64.
  2016-11-07  8:38 [PATCH] powerpc/mm: Add _PAGE_DEVMAP pte bit for ppc64 Aneesh Kumar K.V
@ 2016-11-07  9:37 ` Denis Kirjanov
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kirjanov @ 2016-11-07  9:37 UTC (permalink / raw)
  To: Aneesh Kumar K.V
  Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au,
	linuxppc-dev@lists.ozlabs.org

[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

On Monday, November 7, 2016, Aneesh Kumar K.V <
aneesh.kumar@linux.vnet.ibm.com> wrote:

> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@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
>
>

[-- Attachment #2: Type: text/html, Size: 2964 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-07  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07  8:38 [PATCH] powerpc/mm: Add _PAGE_DEVMAP pte bit for ppc64 Aneesh Kumar K.V
2016-11-07  9:37 ` Denis Kirjanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).