s390/mm: uninline copy_oldmem_kernel() function
authorAlexander Gordeev <agordeev@linux.ibm.com>
Thu, 8 Sep 2022 12:23:02 +0000 (14:23 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 14 Sep 2022 14:46:01 +0000 (16:46 +0200)
Uninline copy_oldmem_kernel() function and make it consistent
with a very similar memcpy_real() implementation, by moving
to code to crash_dump.c, where it actually belongs.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/maccess.h
arch/s390/include/asm/os_info.h
arch/s390/kernel/crash_dump.c
arch/s390/kernel/os_info.c
arch/s390/kernel/smp.c

index 21ebd9b..c7fa838 100644 (file)
@@ -10,5 +10,8 @@ extern unsigned long __memcpy_real_area;
 void memcpy_real_init(void);
 size_t memcpy_real_iter(struct iov_iter *iter, unsigned long src, size_t count);
 int memcpy_real(void *dest, unsigned long src, size_t count);
+#ifdef CONFIG_CRASH_DUMP
+int copy_oldmem_kernel(void *dst, unsigned long src, size_t count);
+#endif
 
 #endif /* __ASM_S390_MACCESS_H */
index 85248d8..0d1c74a 100644 (file)
@@ -41,20 +41,6 @@ u32 os_info_csum(struct os_info *os_info);
 
 #ifdef CONFIG_CRASH_DUMP
 void *os_info_old_entry(int nr, unsigned long *size);
-size_t copy_oldmem_iter(struct iov_iter *iter, unsigned long src, size_t count);
-
-static inline int copy_oldmem_kernel(void *dst, unsigned long src, size_t count)
-{
-       struct iov_iter iter;
-       struct kvec kvec;
-
-       kvec.iov_base = dst;
-       kvec.iov_len = count;
-       iov_iter_kvec(&iter, WRITE, &kvec, 1, count);
-       if (copy_oldmem_iter(&iter, src, count) < count)
-               return -EFAULT;
-       return 0;
-}
 #else
 static inline void *os_info_old_entry(int nr, unsigned long *size)
 {
index 438fe69..dd74fe6 100644 (file)
@@ -115,7 +115,7 @@ void __init save_area_add_vxrs(struct save_area *sa, __vector128 *vxrs)
        memcpy(sa->vxrs_high, vxrs + 16, 16 * sizeof(__vector128));
 }
 
-size_t copy_oldmem_iter(struct iov_iter *iter, unsigned long src, size_t count)
+static size_t copy_oldmem_iter(struct iov_iter *iter, unsigned long src, size_t count)
 {
        size_t len, copied, res = 0;
 
@@ -146,6 +146,19 @@ size_t copy_oldmem_iter(struct iov_iter *iter, unsigned long src, size_t count)
        return res;
 }
 
+int copy_oldmem_kernel(void *dst, unsigned long src, size_t count)
+{
+       struct iov_iter iter;
+       struct kvec kvec;
+
+       kvec.iov_base = dst;
+       kvec.iov_len = count;
+       iov_iter_kvec(&iter, WRITE, &kvec, 1, count);
+       if (copy_oldmem_iter(&iter, src, count) < count)
+               return -EFAULT;
+       return 0;
+}
+
 /*
  * Copy one page from "oldmem"
  */
index 506ccb7..ec0bd94 100644 (file)
@@ -15,6 +15,7 @@
 #include <asm/checksum.h>
 #include <asm/abs_lowcore.h>
 #include <asm/os_info.h>
+#include <asm/maccess.h>
 #include <asm/asm-offsets.h>
 
 /*
index 1460164..0031325 100644 (file)
@@ -55,6 +55,7 @@
 #include <asm/stacktrace.h>
 #include <asm/topology.h>
 #include <asm/vdso.h>
+#include <asm/maccess.h>
 #include "entry.h"
 
 enum {