Re: [tip:x86/mm] kdump, proc/vmcore: Enable kdumping encrypted memory with SME enabled

From: Borislav Petkov
Date: Mon Oct 08 2018 - 04:00:24 EST


On Mon, Oct 08, 2018 at 03:11:56PM +0800, lijiang wrote:
> I used this ".config" to compile kernel in the attachment, and got a compile error.
> Would you like to have a try?
>
> [root@hp-dl385g10-03 linux]# make ARCH=i386 -j32
> ......
> LD vmlinux.o
> MODPOST vmlinux.o
> fs/proc/vmcore.oïIn function âread_from_oldmemâï
> /home/linux/fs/proc/vmcore.c:127ïundefined reference to âcopy_oldmem_page_encryptedâ
> make: *** [vmlinux] error 1

Thanks, that triggered here. Ok, I guess something like this, to avoid
the ugly ifdeffery:

---
diff --git a/arch/x86/kernel/crash_dump_32.c b/arch/x86/kernel/crash_dump_32.c
index 33ee47670b99..8696800f2eea 100644
--- a/arch/x86/kernel/crash_dump_32.c
+++ b/arch/x86/kernel/crash_dump_32.c
@@ -80,6 +80,16 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
return csize;
}

+/*
+ * 32-bit parrot version to avoid build errors.
+ */
+ssize_t copy_oldmem_page_encrypted(unsigned long pfn, char *buf, size_t csize,
+ unsigned long offset, int userbuf)
+{
+ WARN_ON_ONCE(1);
+ return copy_oldmem_page(pfn, buf, csize, offset, userbuf);
+}
+
static int __init kdump_buf_page_init(void)
{
int ret = 0;



--
Regards/Gruss,
Boris.

SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)