[PATCH 5/5 V4] Help to dump the old memory encrypted into vmcore file

kbuild test robot lkp at intel.com
Thu Jun 28 05:15:30 PDT 2018


Hi Lianbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.18-rc2 next-20180628]
[cannot apply to tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Lianbo-Jiang/Add-a-function-ioremap_encrypted-for-kdump-when-AMD-sme-enabled/20180628-173357
config: arm64-defconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   fs/proc/vmcore.c: In function 'elfcorehdr_read':
>> fs/proc/vmcore.c:180:9: error: implicit declaration of function 'memremap'; did you mean 'memset_p'? [-Werror=implicit-function-declaration]
     kbuf = memremap(offset, count, MEMREMAP_WB);
            ^~~~~~~~
            memset_p
   fs/proc/vmcore.c:180:33: error: 'MEMREMAP_WB' undeclared (first use in this function)
     kbuf = memremap(offset, count, MEMREMAP_WB);
                                    ^~~~~~~~~~~
   fs/proc/vmcore.c:180:33: note: each undeclared identifier is reported only once for each function it appears in
   fs/proc/vmcore.c:185:2: error: implicit declaration of function 'memunmap'; did you mean 'vm_munmap'? [-Werror=implicit-function-declaration]
     memunmap(kbuf);
     ^~~~~~~~
     vm_munmap
   cc1: some warnings being treated as errors

vim +180 fs/proc/vmcore.c

   158	
   159	/*
   160	 * Architectures may override this function to read from ELF header.
   161	 * The kexec-tools will allocated the memory and build the elf header
   162	 * in the first kernel, subsequently, we will copy the data in the
   163	 * memory to the reserved crash memory. In kdump mode, we will read the
   164	 * elf header from the reserved crash memory, from this point of view,
   165	 * which is not an old memory, the original function called may mislead
   166	 * and do unnecessary things.
   167	 * For SME, it copies the elf header from the memory encrypted(user space)
   168	 * to the memory unencrypted(kernel space) when SME is activated in the
   169	 * first kernel, this operation just leads to decryption.
   170	 */
   171	ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos)
   172	{
   173		char *kbuf;
   174		resource_size_t offset;
   175	
   176		if (!count)
   177			return 0;
   178	
   179		offset = (resource_size_t)*ppos;
 > 180		kbuf = memremap(offset, count, MEMREMAP_WB);
   181		if (!kbuf)
   182			return 0;
   183	
   184		memcpy(buf, kbuf, count);
   185		memunmap(kbuf);
   186	
   187		return count;
   188	}
   189	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 38918 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/kexec/attachments/20180628/cce6dd13/attachment-0001.gz>


More information about the kexec mailing list