[PATCH 1/2] powerpc/lib: Implement PMEM API

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3186d

7 messages, 3 authors, 2017-11-14 · open the first message on its own page

[PATCH 1/2] powerpc/lib: Implement PMEM API

From: Oliver O'Halloran <oohall@gmail.com>
Date: 2017-10-19 07:14:10

Implement the architecture specific cache maintence functions that make
up the "PMEM API". Currently the writeback and invalidate functions
are the same since the function of the DCBST (data cache block store)
instruction is typically interpreted as "writeback to the point of
coherency" rather than to memory. As a result implementing the API
requires a full cache flush rather than just a cache write back. This
will probably change in the not-too-distant future.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/Kconfig      |  1 +
 arch/powerpc/lib/Makefile |  2 +-
 arch/powerpc/lib/pmem.c   | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 arch/powerpc/lib/pmem.c
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 809c468edab1..0996add8a572 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -138,6 +138,7 @@ config PPC
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_HAS_GCOV_PROFILE_ALL
+	select ARCH_HAS_PMEM_API                if PPC64
 	select ARCH_HAS_SCALED_CPUTIME		if VIRT_CPU_ACCOUNTING_NATIVE
 	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_TICK_BROADCAST		if GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 50d5bf954cff..7aa237d10546 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -23,7 +23,7 @@ endif
 
 obj64-y	+= copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
 	   copyuser_power7.o string_64.o copypage_power7.o memcpy_power7.o \
-	   memcpy_64.o memcmp_64.o
+	   memcpy_64.o memcmp_64.o pmem.o
 
 obj64-$(CONFIG_SMP)	+= locks.o
 obj64-$(CONFIG_ALTIVEC)	+= vmx-helper.o
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
new file mode 100644
index 000000000000..0fa09262ca13
--- /dev/null
+++ b/arch/powerpc/lib/pmem.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright(c) 2017 IBM Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/string.h>
+#include <linux/export.h>
+
+#include <asm/cacheflush.h>
+
+/*
+ * CONFIG_ARCH_HAS_PMEM_API symbols
+ */
+void arch_wb_cache_pmem(void *addr, size_t size)
+{
+	unsigned long start = (unsigned long) addr;
+	flush_inval_dcache_range(start, start + size);
+}
+EXPORT_SYMBOL(arch_wb_cache_pmem);
+
+void arch_invalidate_pmem(void *addr, size_t size)
+{
+	unsigned long start = (unsigned long) addr;
+	flush_inval_dcache_range(start, start + size);
+}
+EXPORT_SYMBOL(arch_invalidate_pmem);
-- 
2.9.5

[PATCH 2/2] powerpc/lib: Implement UACCESS_FLUSHCACHE API

From: Oliver O'Halloran <oohall@gmail.com>
Date: 2017-10-19 07:14:13

Implement the architecture specific portitions of the UACCESS_FLUSHCACHE
API. This provides functions for the copy_user_flushcache iterator that
ensure that when the copy is finished the destination buffer contains
a copy of the original and that the destination buffer is clean in the
processor caches.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 arch/powerpc/Kconfig               |  1 +
 arch/powerpc/include/asm/string.h  |  2 ++
 arch/powerpc/include/asm/uaccess.h |  5 +++++
 arch/powerpc/lib/pmem.c            | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 41 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0996add8a572..09a207468f8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -142,6 +142,7 @@ config PPC
 	select ARCH_HAS_SCALED_CPUTIME		if VIRT_CPU_ACCOUNTING_NATIVE
 	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_TICK_BROADCAST		if GENERIC_CLOCKEVENTS_BROADCAST
+	select ARCH_HAS_UACCESS_FLUSHCACHE	if PPC64
 	select ARCH_HAS_UBSAN_SANITIZE_ALL
 	select ARCH_HAS_ZONE_DEVICE		if PPC_BOOK3S_64
 	select ARCH_HAVE_NMI_SAFE_CMPXCHG
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index cc9addefb51c..2796eda17d92 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -11,6 +11,7 @@
 #define __HAVE_ARCH_MEMCMP
 #define __HAVE_ARCH_MEMCHR
 #define __HAVE_ARCH_MEMSET16
+#define __HAVE_ARCH_MEMCPY_FLUSHCACHE
 
 extern char * strcpy(char *,const char *);
 extern char * strncpy(char *,const char *, __kernel_size_t);
@@ -23,6 +24,7 @@ extern void * memcpy(void *,const void *,__kernel_size_t);
 extern void * memmove(void *,const void *,__kernel_size_t);
 extern int memcmp(const void *,const void *,__kernel_size_t);
 extern void * memchr(const void *,int,__kernel_size_t);
+extern void * memcpy_flushcache(void *,const void *,__kernel_size_t);
 
 #ifdef CONFIG_PPC64
 #define __HAVE_ARCH_MEMSET32
diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index 9c0e60ca1666..e9c88b72584f 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -339,4 +339,9 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size)
 extern long strncpy_from_user(char *dst, const char __user *src, long count);
 extern __must_check long strnlen_user(const char __user *str, long n);
 
+extern long __copy_from_user_flushcache(void *dst, const void __user *src,
+		unsigned size);
+extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
+			   size_t len);
+
 #endif	/* _ARCH_POWERPC_UACCESS_H */
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
index 0fa09262ca13..53c018762e1c 100644
--- a/arch/powerpc/lib/pmem.c
+++ b/arch/powerpc/lib/pmem.c
@@ -13,6 +13,7 @@
 
 #include <linux/string.h>
 #include <linux/export.h>
+#include <linux/uaccess.h>
 
 #include <asm/cacheflush.h>
 
@@ -32,3 +33,35 @@ void arch_invalidate_pmem(void *addr, size_t size)
 	flush_inval_dcache_range(start, start + size);
 }
 EXPORT_SYMBOL(arch_invalidate_pmem);
+
+/*
+ * CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE symbols
+ */
+long __copy_from_user_flushcache(void *dest, const void __user *src,
+		unsigned size)
+{
+	unsigned long copied, start = (unsigned long) dest;
+
+	copied = __copy_from_user(dest, src, size);
+	flush_inval_dcache_range(start, start + size);
+
+	return copied;
+}
+
+void *memcpy_flushcache(void *dest, const void *src, size_t size)
+{
+	unsigned long start = (unsigned long) dest;
+
+	memcpy(dest, src, size);
+	flush_inval_dcache_range(start, start + size);
+
+	return dest;
+}
+EXPORT_SYMBOL(memcpy_flushcache);
+
+void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
+	size_t len)
+{
+	memcpy_flushcache(to, page_to_virt(page) + offset, len);
+}
+EXPORT_SYMBOL(memcpy_page_flushcache);
-- 
2.9.5

Re: [PATCH 1/2] powerpc/lib: Implement PMEM API

From: Christophe LEROY <hidden>
Date: 2017-10-19 11:13:38


Le 19/10/2017 à 09:13, Oliver O'Halloran a écrit :
quoted hunk
Implement the architecture specific cache maintence functions that make
up the "PMEM API". Currently the writeback and invalidate functions
are the same since the function of the DCBST (data cache block store)
instruction is typically interpreted as "writeback to the point of
coherency" rather than to memory. As a result implementing the API
requires a full cache flush rather than just a cache write back. This
will probably change in the not-too-distant future.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
  arch/powerpc/Kconfig      |  1 +
  arch/powerpc/lib/Makefile |  2 +-
  arch/powerpc/lib/pmem.c   | 34 ++++++++++++++++++++++++++++++++++
  3 files changed, 36 insertions(+), 1 deletion(-)
  create mode 100644 arch/powerpc/lib/pmem.c
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 809c468edab1..0996add8a572 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -138,6 +138,7 @@ config PPC
  	select ARCH_HAS_ELF_RANDOMIZE
  	select ARCH_HAS_FORTIFY_SOURCE
  	select ARCH_HAS_GCOV_PROFILE_ALL
+	select ARCH_HAS_PMEM_API                if PPC64
Why restrict that to PPC64 ?
quoted hunk
  	select ARCH_HAS_SCALED_CPUTIME		if VIRT_CPU_ACCOUNTING_NATIVE
  	select ARCH_HAS_SG_CHAIN
  	select ARCH_HAS_TICK_BROADCAST		if GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 50d5bf954cff..7aa237d10546 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -23,7 +23,7 @@ endif
  
  obj64-y	+= copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
  	   copyuser_power7.o string_64.o copypage_power7.o memcpy_power7.o \
-	   memcpy_64.o memcmp_64.o
+	   memcpy_64.o memcmp_64.o pmem.o
  
  obj64-$(CONFIG_SMP)	+= locks.o
  obj64-$(CONFIG_ALTIVEC)	+= vmx-helper.o
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
new file mode 100644
index 000000000000..0fa09262ca13
--- /dev/null
+++ b/arch/powerpc/lib/pmem.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright(c) 2017 IBM Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/string.h>
+#include <linux/export.h>
+
+#include <asm/cacheflush.h>
+
+/*
+ * CONFIG_ARCH_HAS_PMEM_API symbols
+ */
+void arch_wb_cache_pmem(void *addr, size_t size)
+{
+	unsigned long start = (unsigned long) addr;
+	flush_inval_dcache_range(start, start + size);
That function seems to only exist in PPC64, however a quite similar one, 
called flush_dcache_range() does the same on PPC32 (defined in 
arch/powerpc/include/asm/cacheflush.h)

In the meantime, I see that PPC64 also has a function called 
flush_dcache_range(), which does the same as PPC32 function 
clean_dcache_range()

Maybe she should re-unify the names ?

Christophe
+}
+EXPORT_SYMBOL(arch_wb_cache_pmem);
+
+void arch_invalidate_pmem(void *addr, size_t size)
+{
+	unsigned long start = (unsigned long) addr;
+	flush_inval_dcache_range(start, start + size);
+}
+EXPORT_SYMBOL(arch_invalidate_pmem);

Re: [PATCH 2/2] powerpc/lib: Implement UACCESS_FLUSHCACHE API

From: Christophe LEROY <hidden>
Date: 2017-10-19 11:14:58


Le 19/10/2017 à 09:13, Oliver O'Halloran a écrit :
quoted hunk
Implement the architecture specific portitions of the UACCESS_FLUSHCACHE
API. This provides functions for the copy_user_flushcache iterator that
ensure that when the copy is finished the destination buffer contains
a copy of the original and that the destination buffer is clean in the
processor caches.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
  arch/powerpc/Kconfig               |  1 +
  arch/powerpc/include/asm/string.h  |  2 ++
  arch/powerpc/include/asm/uaccess.h |  5 +++++
  arch/powerpc/lib/pmem.c            | 33 +++++++++++++++++++++++++++++++++
  4 files changed, 41 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0996add8a572..09a207468f8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -142,6 +142,7 @@ config PPC
  	select ARCH_HAS_SCALED_CPUTIME		if VIRT_CPU_ACCOUNTING_NATIVE
  	select ARCH_HAS_SG_CHAIN
  	select ARCH_HAS_TICK_BROADCAST		if GENERIC_CLOCKEVENTS_BROADCAST
+	select ARCH_HAS_UACCESS_FLUSHCACHE	if PPC64
Same as previous patch in the serye, why restrict it to PPC64 ?

Christophe
quoted hunk
  	select ARCH_HAS_UBSAN_SANITIZE_ALL
  	select ARCH_HAS_ZONE_DEVICE		if PPC_BOOK3S_64
  	select ARCH_HAVE_NMI_SAFE_CMPXCHG
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index cc9addefb51c..2796eda17d92 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -11,6 +11,7 @@
  #define __HAVE_ARCH_MEMCMP
  #define __HAVE_ARCH_MEMCHR
  #define __HAVE_ARCH_MEMSET16
+#define __HAVE_ARCH_MEMCPY_FLUSHCACHE
  
  extern char * strcpy(char *,const char *);
  extern char * strncpy(char *,const char *, __kernel_size_t);
@@ -23,6 +24,7 @@ extern void * memcpy(void *,const void *,__kernel_size_t);
  extern void * memmove(void *,const void *,__kernel_size_t);
  extern int memcmp(const void *,const void *,__kernel_size_t);
  extern void * memchr(const void *,int,__kernel_size_t);
+extern void * memcpy_flushcache(void *,const void *,__kernel_size_t);
  
  #ifdef CONFIG_PPC64
  #define __HAVE_ARCH_MEMSET32
diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index 9c0e60ca1666..e9c88b72584f 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -339,4 +339,9 @@ static inline unsigned long clear_user(void __user *addr, unsigned long size)
  extern long strncpy_from_user(char *dst, const char __user *src, long count);
  extern __must_check long strnlen_user(const char __user *str, long n);
  
+extern long __copy_from_user_flushcache(void *dst, const void __user *src,
+		unsigned size);
+extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
+			   size_t len);
+
  #endif	/* _ARCH_POWERPC_UACCESS_H */
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
index 0fa09262ca13..53c018762e1c 100644
--- a/arch/powerpc/lib/pmem.c
+++ b/arch/powerpc/lib/pmem.c
@@ -13,6 +13,7 @@
  
  #include <linux/string.h>
  #include <linux/export.h>
+#include <linux/uaccess.h>
  
  #include <asm/cacheflush.h>
  
@@ -32,3 +33,35 @@ void arch_invalidate_pmem(void *addr, size_t size)
  	flush_inval_dcache_range(start, start + size);
  }
  EXPORT_SYMBOL(arch_invalidate_pmem);
+
+/*
+ * CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE symbols
+ */
+long __copy_from_user_flushcache(void *dest, const void __user *src,
+		unsigned size)
+{
+	unsigned long copied, start = (unsigned long) dest;
+
+	copied = __copy_from_user(dest, src, size);
+	flush_inval_dcache_range(start, start + size);
+
+	return copied;
+}
+
+void *memcpy_flushcache(void *dest, const void *src, size_t size)
+{
+	unsigned long start = (unsigned long) dest;
+
+	memcpy(dest, src, size);
+	flush_inval_dcache_range(start, start + size);
+
+	return dest;
+}
+EXPORT_SYMBOL(memcpy_flushcache);
+
+void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
+	size_t len)
+{
+	memcpy_flushcache(to, page_to_virt(page) + offset, len);
+}
+EXPORT_SYMBOL(memcpy_page_flushcache);

Re: [PATCH 1/2] powerpc/lib: Implement PMEM API

From: Oliver <oohall@gmail.com>
Date: 2017-10-20 03:54:16

On Thu, Oct 19, 2017 at 10:13 PM, Christophe LEROY
[off-list ref] wrote:

Le 19/10/2017 =C3=A0 09:13, Oliver O'Halloran a =C3=A9crit :
quoted
Implement the architecture specific cache maintence functions that make
up the "PMEM API". Currently the writeback and invalidate functions
are the same since the function of the DCBST (data cache block store)
instruction is typically interpreted as "writeback to the point of
coherency" rather than to memory. As a result implementing the API
requires a full cache flush rather than just a cache write back. This
will probably change in the not-too-distant future.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
  arch/powerpc/Kconfig      |  1 +
  arch/powerpc/lib/Makefile |  2 +-
  arch/powerpc/lib/pmem.c   | 34 ++++++++++++++++++++++++++++++++++
  3 files changed, 36 insertions(+), 1 deletion(-)
  create mode 100644 arch/powerpc/lib/pmem.c
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 809c468edab1..0996add8a572 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -138,6 +138,7 @@ config PPC
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FORTIFY_SOURCE
        select ARCH_HAS_GCOV_PROFILE_ALL
+       select ARCH_HAS_PMEM_API                if PPC64

Why restrict that to PPC64 ?
Currently I'm only developing and testing on PPC64 and I'd rather not
be enabling features for platforms that I haven't tested them on.
quoted
        select ARCH_HAS_SCALED_CPUTIME          if
VIRT_CPU_ACCOUNTING_NATIVE
        select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST          if
GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 50d5bf954cff..7aa237d10546 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -23,7 +23,7 @@ endif
    obj64-y     +=3D copypage_64.o copyuser_64.o mem_64.o hweight_64.o \
           copyuser_power7.o string_64.o copypage_power7.o memcpy_power7=
.o
quoted
\
-          memcpy_64.o memcmp_64.o
+          memcpy_64.o memcmp_64.o pmem.o
    obj64-$(CONFIG_SMP) +=3D locks.o
  obj64-$(CONFIG_ALTIVEC)       +=3D vmx-helper.o
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
new file mode 100644
index 000000000000..0fa09262ca13
--- /dev/null
+++ b/arch/powerpc/lib/pmem.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright(c) 2017 IBM Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+
+#include <linux/string.h>
+#include <linux/export.h>
+
+#include <asm/cacheflush.h>
+
+/*
+ * CONFIG_ARCH_HAS_PMEM_API symbols
+ */
+void arch_wb_cache_pmem(void *addr, size_t size)
+{
+       unsigned long start =3D (unsigned long) addr;
+       flush_inval_dcache_range(start, start + size);

That function seems to only exist in PPC64, however a quite similar one,
called flush_dcache_range() does the same on PPC32 (defined in
arch/powerpc/include/asm/cacheflush.h)

In the meantime, I see that PPC64 also has a function called
flush_dcache_range(), which does the same as PPC32 function
clean_dcache_range()

Maybe she should re-unify the names ?
It wouldn't hurt. The problem is that there are a few drivers using
the two though so
we would need to go through those and fix them as needed.
Christophe

quoted
+}
+EXPORT_SYMBOL(arch_wb_cache_pmem);
+
+void arch_invalidate_pmem(void *addr, size_t size)
+{
+       unsigned long start =3D (unsigned long) addr;
+       flush_inval_dcache_range(start, start + size);
+}
+EXPORT_SYMBOL(arch_invalidate_pmem);

Re: [PATCH 2/2] powerpc/lib: Implement UACCESS_FLUSHCACHE API

From: Oliver <oohall@gmail.com>
Date: 2017-10-20 04:05:47

On Thu, Oct 19, 2017 at 10:14 PM, Christophe LEROY
[off-list ref] wrote:

Le 19/10/2017 =C3=A0 09:13, Oliver O'Halloran a =C3=A9crit :
quoted
Implement the architecture specific portitions of the UACCESS_FLUSHCACHE
API. This provides functions for the copy_user_flushcache iterator that
ensure that when the copy is finished the destination buffer contains
a copy of the original and that the destination buffer is clean in the
processor caches.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
  arch/powerpc/Kconfig               |  1 +
  arch/powerpc/include/asm/string.h  |  2 ++
  arch/powerpc/include/asm/uaccess.h |  5 +++++
  arch/powerpc/lib/pmem.c            | 33
+++++++++++++++++++++++++++++++++
  4 files changed, 41 insertions(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 0996add8a572..09a207468f8b 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -142,6 +142,7 @@ config PPC
        select ARCH_HAS_SCALED_CPUTIME          if
VIRT_CPU_ACCOUNTING_NATIVE
        select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST          if
GENERIC_CLOCKEVENTS_BROADCAST
+       select ARCH_HAS_UACCESS_FLUSHCACHE      if PPC64

Same as previous patch in the serye, why restrict it to PPC64 ?
It's not highmem aware and as I said  in the previous reply I'd rather
not enable it on platforms where no one has tested it.


Oliver

Re: [1/2] powerpc/lib: Implement PMEM API

From: Michael Ellerman <hidden>
Date: 2017-11-14 11:12:07

On Thu, 2017-10-19 at 07:13:54 UTC, Oliver O'Halloran wrote:
Implement the architecture specific cache maintence functions that make
up the "PMEM API". Currently the writeback and invalidate functions
are the same since the function of the DCBST (data cache block store)
instruction is typically interpreted as "writeback to the point of
coherency" rather than to memory. As a result implementing the API
requires a full cache flush rather than just a cache write back. This
will probably change in the not-too-distant future.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/32ce3862af3c42a3890e99846a8d1a

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help