[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0cecda76-0c1b-c11a-08be-f99cf7214d12@redhat.com>
Date: Tue, 9 Oct 2018 10:54:50 +0800
From: lijiang <lijiang@...hat.com>
To: Borislav Petkov <bp@...e.de>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org, tglx@...utronix.de,
hpa@...or.com, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/mm] kdump, proc/vmcore: Enable kdumping encrypted memory
with SME enabled
在 2018年10月08日 21:43, Borislav Petkov 写道:
> On Mon, Oct 08, 2018 at 10:59:09AM +0200, Borislav Petkov wrote:
>> On Mon, Oct 08, 2018 at 04:47:34PM +0800, lijiang wrote:
>>> 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.
>>
>> Yap, just realized that and looking at the rest of fs/proc/vmcore.c -
>> such functions are defined with the __weak attribute. Lemme see if that
>> works better.
>
> Seems so. I'll hammer on it more today:
>
Great! Thank you, Borislav.
Regards,
Lianbo
> ---
> fs/proc/vmcore.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c
> index 42c32d06f7da..91ae16fbd7d5 100644
> --- a/fs/proc/vmcore.c
> +++ b/fs/proc/vmcore.c
> @@ -187,6 +187,16 @@ int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma,
> return remap_pfn_range(vma, from, pfn, size, prot);
> }
>
> +/*
> + * Architectures which support memory encryption override this.
> + */
> +ssize_t __weak
> +copy_oldmem_page_encrypted(unsigned long pfn, char *buf, size_t csize,
> + unsigned long offset, int userbuf)
> +{
> + return copy_oldmem_page(pfn, buf, csize, offset, userbuf);
> +}
> +
> /*
> * Copy to either kernel or user space
> */
>
Powered by blists - more mailing lists