1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0 245a98fc6SHorms /* 345a98fc6SHorms * kernel/crash_dump.c - Memory preserving reboot related code. 445a98fc6SHorms * 545a98fc6SHorms * Created by: Simon Horman <horms@verge.net.au> 645a98fc6SHorms * Original code moved from kernel/crash.c 745a98fc6SHorms * Original code comment copied from the i386 version of this file 845a98fc6SHorms */ 945a98fc6SHorms 1045a98fc6SHorms #include <linux/errno.h> 1145a98fc6SHorms #include <linux/types.h> 1257cac4d1SVivek Goyal #include <linux/crash_dump.h> 13*5d8de293SMatthew Wilcox (Oracle) #include <linux/uio.h> 148a697d0aSHorms #include <asm/page.h> 1545a98fc6SHorms copy_oldmem_page(struct iov_iter * iter,unsigned long pfn,size_t csize,unsigned long offset)16*5d8de293SMatthew Wilcox (Oracle)ssize_t copy_oldmem_page(struct iov_iter *iter, unsigned long pfn, 17*5d8de293SMatthew Wilcox (Oracle) size_t csize, unsigned long offset) 1845a98fc6SHorms { 1945a98fc6SHorms void *vaddr; 2045a98fc6SHorms 2145a98fc6SHorms if (!csize) 2245a98fc6SHorms return 0; 2345a98fc6SHorms vaddr = __va(pfn<<PAGE_SHIFT); 24*5d8de293SMatthew Wilcox (Oracle) csize = copy_to_iter(vaddr + offset, csize, iter); 2545a98fc6SHorms return csize; 2645a98fc6SHorms } 2745a98fc6SHorms 28