<br><br>On Monday, November 7, 2016, Aneesh Kumar K.V <<a href="mailto:aneesh.kumar@linux.vnet.ibm.com">aneesh.kumar@linux.vnet.ibm.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Aneesh Kumar K.V <<a href="javascript:;" onclick="_e(event, 'cvml', 'aneesh.kumar@linux.vnet.ibm.com')">aneesh.kumar@linux.vnet.ibm.com</a>></blockquote><div><br></div><div>Hi Aneesh, </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
NOTE: We need other patches to enable pmem on ppc64. I am waiting<br>
for dax pmd fault handling cleanup to hit upstream before I send<br>
the changes. Meanwhile reserve the pte bit.<br>
<br>
arch/powerpc/include/asm/<wbr>book3s/64/pgtable.h | 24 ++++++++++++++++++++++++<br>
1 file changed, 24 insertions(+)<br>
<br>
diff --git a/arch/powerpc/include/asm/<wbr>book3s/64/pgtable.h b/arch/powerpc/include/asm/<wbr>book3s/64/pgtable.h<br>
index 9eed9d66d24f..af9e1a150ae7 100644<br>
--- a/arch/powerpc/include/asm/<wbr>book3s/64/pgtable.h<br>
+++ b/arch/powerpc/include/asm/<wbr>book3s/64/pgtable.h<br>
@@ -32,6 +32,8 @@<br>
#define _PAGE_SOFT_DIRTY 0x00000<br>
#endif<br>
#define _PAGE_SPECIAL _RPAGE_SW2 /* software: special page */<br>
+#define _PAGE_DEVMAP _RPAGE_SW1<br>
+#define __HAVE_ARCH_PTE_DEVMAP<br>
<br>
<br>
#define _PAGE_PTE (1ul << 62) /* distinguishes PTEs from pointers */<br>
@@ -485,6 +487,16 @@ static inline pte_t pte_mkhuge(pte_t pte)<br>
return pte;<br>
}<br>
<br>
+static inline pte_t pte_mkdevmap(pte_t pte)<br>
+{<br>
+ return __pte(pte_val(pte) | _PAGE_SPECIAL|_PAGE_DEVMAP);<br>
+}<br>
+<br>
+static inline int pte_devmap(pte_t pte)<br>
+{<br>
+ return !!(pte_raw(pte) & cpu_to_be64(_PAGE_DEVMAP));<br>
+}<br><br></blockquote><div>This could be bool, right? </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)<br>
{<br>
/* FIXME!! check whether this need to be a conditional */<br>
@@ -1030,6 +1042,18 @@ static inline bool arch_needs_pgtable_deposit(<wbr>void)<br>
return true;<br>
}<br>
<br>
+static inline pmd_t pmd_mkdevmap(pmd_t pmd)<br>
+{<br>
+ /*<br>
+ * No special ptes at pmd level.<br>
+ */<br>
+ return __pmd(pmd_val(pmd) | _PAGE_DEVMAP);<br>
+}<br>
+<br>
+static inline int pmd_devmap(pmd_t pmd)<br>
+{<br>
+ return pte_devmap(pmd_pte(pmd));<br>
+}<br>
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */<br>
#endif /* __ASSEMBLY__ */<br>
#endif /* _ASM_POWERPC_BOOK3S_64_<wbr>PGTABLE_H_ */<br>
--<br>
2.10.2<br>
<br>
</blockquote>