aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kernel/crash_dump.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
index 0c9a897a1fb5..3e776158b330 100644
--- a/arch/s390/kernel/crash_dump.c
+++ b/arch/s390/kernel/crash_dump.c
@@ -99,6 +99,32 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
99} 99}
100 100
101/* 101/*
102 * Remap "oldmem"
103 *
104 * For the kdump reserved memory this functions performs a swap operation:
105 * [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE]
106 */
107int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from,
108 unsigned long pfn, unsigned long size, pgprot_t prot)
109{
110 unsigned long size_old;
111 int rc;
112
113 if (pfn < OLDMEM_SIZE >> PAGE_SHIFT) {
114 size_old = min(size, OLDMEM_SIZE - (pfn << PAGE_SHIFT));
115 rc = remap_pfn_range(vma, from,
116 pfn + (OLDMEM_BASE >> PAGE_SHIFT),
117 size_old, prot);
118 if (rc || size == size_old)
119 return rc;
120 size -= size_old;
121 from += size_old;
122 pfn += size_old >> PAGE_SHIFT;
123 }
124 return remap_pfn_range(vma, from, pfn, size, prot);
125}
126
127/*
102 * Copy memory from old kernel 128 * Copy memory from old kernel
103 */ 129 */
104int copy_from_oldmem(void *dest, void *src, size_t count) 130int copy_from_oldmem(void *dest, void *src, size_t count)