From: lijiang <lijiang@redhat.com>
To: Borislav Petkov <bp@suse.de>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
tglx@linutronix.de, hpa@zytor.com,
linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/mm] kdump, proc/vmcore: Enable kdumping encrypted memory with SME enabled
Date: Mon, 8 Oct 2018 16:47:34 +0800 [thread overview]
Message-ID: <8147597a-f8e0-7f1a-bd2b-e914b18c5c74@redhat.com> (raw)
In-Reply-To: <20181008080013.GB6490@zn.tnic>
在 2018年10月08日 16:00, Borislav Petkov 写道:
> 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);
> +}
> +
It looks like a good way to avoid the 'ifdefined', and it's also good enough for i386.
But for other architectures, such as POWERPC/ARM..., we will also have to add the same
function for every architecture. Otherwise, i guess that they also have a same compile
error on other architectures.
Sometimes, it's hard to make a choice.
Regards,
Lianbo
> static int __init kdump_buf_page_init(void)
> {
> int ret = 0;
>
>
>
next prev parent reply other threads:[~2018-10-08 8:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-30 3:10 [PATCH v8 RESEND 0/4] Support kdump for AMD secure memory encryption(SME) Lianbo Jiang
2018-09-30 3:10 ` [PATCH v8 RESEND 1/4] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory Lianbo Jiang
2018-09-30 3:10 ` [PATCH v8 RESEND 2/4] kexec: allocate decrypted control pages for kdump in case SME is enabled Lianbo Jiang
2018-10-06 11:46 ` [tip:x86/mm] kexec: Allocate decrypted control pages for kdump if " tip-bot for Lianbo Jiang
2018-09-30 3:10 ` [PATCH v8 RESEND 3/4] iommu/amd: Remap the device table of IOMMU with the memory encryption mask for kdump Lianbo Jiang
2018-10-06 11:47 ` [tip:x86/mm] iommu/amd: Remap the IOMMU device table " tip-bot for Lianbo Jiang
2018-09-30 3:10 ` [PATCH v8 RESEND 4/4] kdump/vmcore: support encrypted old memory with SME enabled Lianbo Jiang
2018-09-30 4:22 ` kbuild test robot
2018-09-30 8:37 ` [PATCH v9 " lijiang
2018-10-01 20:22 ` Borislav Petkov
2018-10-06 11:47 ` [tip:x86/mm] kdump, proc/vmcore: Enable kdumping encrypted " tip-bot for Lianbo Jiang
2018-10-07 5:55 ` lijiang
2018-10-07 8:47 ` Borislav Petkov
2018-10-08 3:30 ` lijiang
2018-10-08 5:37 ` Borislav Petkov
2018-10-08 7:11 ` lijiang
2018-10-08 8:00 ` Borislav Petkov
2018-10-08 8:47 ` lijiang [this message]
2018-10-08 8:59 ` Borislav Petkov
2018-10-08 13:43 ` Borislav Petkov
2018-10-09 2:54 ` lijiang
2018-10-09 10:30 ` [tip:x86/mm] proc/vmcore: Fix i386 build error of missing copy_oldmem_page_encrypted() tip-bot for Borislav Petkov
2018-10-02 11:40 ` [PATCH v8 RESEND 0/4] Support kdump for AMD secure memory encryption(SME) Borislav Petkov
2018-10-03 3:57 ` lijiang
2018-10-03 11:34 ` Borislav Petkov
2018-10-04 9:33 ` lijiang
2018-10-04 19:02 ` Borislav Petkov
2018-10-05 5:52 ` lijiang
2018-10-06 9:56 ` Borislav Petkov
2018-10-07 6:09 ` lijiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8147597a-f8e0-7f1a-bd2b-e914b18c5c74@redhat.com \
--to=lijiang@redhat.com \
--cc=bp@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).