Subject: + s390-vmcore-implement-remap_oldmem_pfn_range-for-s390.patch added to -mm tree To: willeke@xxxxxxxxxx,d.hatayama@xxxxxxxxxxxxxx,holzheu@xxxxxxxxxxxxxxxxxx,vgoyal@xxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Fri, 26 Jul 2013 13:20:56 -0700 The patch titled Subject: s390/vmcore: implement remap_oldmem_pfn_range for s390 has been added to the -mm tree. Its filename is s390-vmcore-implement-remap_oldmem_pfn_range-for-s390.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/s390-vmcore-implement-remap_oldmem_pfn_range-for-s390.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/s390-vmcore-implement-remap_oldmem_pfn_range-for-s390.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jan Willeke <willeke@xxxxxxxxxx> Subject: s390/vmcore: implement remap_oldmem_pfn_range for s390 Introduce the s390 specific way to map pages from oldmem. The memory area below OLDMEM_SIZE is mapped with offset OLDMEM_BASE. The other old memory is mapped directly. Signed-off-by: Jan Willeke <willeke@xxxxxxxxxx> Signed-off-by: Michael Holzheu <holzheu@xxxxxxxxxxxxxxxxxx> Cc: HATAYAMA Daisuke <d.hatayama@xxxxxxxxxxxxxx> Cc: Vivek Goyal <vgoyal@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/s390/kernel/crash_dump.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff -puN arch/s390/kernel/crash_dump.c~s390-vmcore-implement-remap_oldmem_pfn_range-for-s390 arch/s390/kernel/crash_dump.c --- a/arch/s390/kernel/crash_dump.c~s390-vmcore-implement-remap_oldmem_pfn_range-for-s390 +++ a/arch/s390/kernel/crash_dump.c @@ -99,6 +99,32 @@ ssize_t copy_oldmem_page(unsigned long p } /* + * Remap "oldmem" + * + * For the kdump reserved memory this functions performs a swap operation: + * [0 - OLDMEM_SIZE] is mapped to [OLDMEM_BASE - OLDMEM_BASE + OLDMEM_SIZE] + */ +int remap_oldmem_pfn_range(struct vm_area_struct *vma, unsigned long from, + unsigned long pfn, unsigned long size, pgprot_t prot) +{ + unsigned long size_old; + int rc; + + if (pfn < OLDMEM_SIZE >> PAGE_SHIFT) { + size_old = min(size, OLDMEM_SIZE - (pfn << PAGE_SHIFT)); + rc = remap_pfn_range(vma, from, + pfn + (OLDMEM_BASE >> PAGE_SHIFT), + size_old, prot); + if (rc || size == size_old) + return rc; + size -= size_old; + from += size_old; + pfn += size_old >> PAGE_SHIFT; + } + return remap_pfn_range(vma, from, pfn, size, prot); +} + +/* * Copy memory from old kernel */ int copy_from_oldmem(void *dest, void *src, size_t count) _ Patches currently in -mm which might be from willeke@xxxxxxxxxx are vmcore-introduce-elf-header-in-new-memory-feature.patch s390-vmcore-use-elf-header-in-new-memory-feature.patch vmcore-introduce-remap_oldmem_pfn_range.patch s390-vmcore-implement-remap_oldmem_pfn_range-for-s390.patch vmcore-enable-proc-vmcore-mmap-for-s390.patch s390-vmcore-use-vmcore-for-zfcpdump.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html