From: Hari Bathini <hbathini@linux.ibm.com>
To: Dave Young <dyoung@redhat.com>
Cc: Thiago Jung Bauermann <bauerman@linux.ibm.com>,
Pingfan Liu <piliu@redhat.com>, Petr Tesarik <ptesarik@suse.cz>,
Kexec-ml <kexec@lists.infradead.org>,
Mahesh J Salgaonkar <mahesh@linux.ibm.com>,
Mimi Zohar <zohar@linux.ibm.com>,
lkml <linux-kernel@vger.kernel.org>,
linuxppc-dev <linuxppc-dev@ozlabs.org>,
Sourabh Jain <sourabhjain@linux.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Vivek Goyal <vgoyal@redhat.com>,
Eric Biederman <ebiederm@xmission.com>
Subject: Re: [PATCH 01/11] kexec_file: allow archs to handle special regions while locating memory hole
Date: Thu, 2 Jul 2020 00:01:31 +0530 [thread overview]
Message-ID: <0e145e84-a6cf-4da3-1a1a-331a7e1ac1fa@linux.ibm.com> (raw)
In-Reply-To: <20200701074659.GA3878@dhcp-128-65.nay.redhat.com>
On 01/07/20 1:16 pm, Dave Young wrote:
> On 06/29/20 at 05:26pm, Hari Bathini wrote:
>> Hi Petr,
>>
>> On 29/06/20 5:09 pm, Petr Tesarik wrote:
>>> Hi Hari,
>>>
>>> is there any good reason to add two more functions with a very similar
>>> name to an existing function? AFAICS all you need is a way to call a
>>> PPC64-specific function from within kexec_add_buffer (PATCH 4/11), so
>>> you could add something like this:
>>>
>>> int __weak arch_kexec_locate_mem_hole(struct kexec_buf *kbuf)
>>> {
>>> return 0;
>>> }
>>>
>>> Call this function from kexec_add_buffer where appropriate and then
>>> override it for PPC64 (it roughly corresponds to your
>>> kexec_locate_mem_hole_ppc64() from PATCH 4/11).
>>>
>>> FWIW it would make it easier for me to follow the resulting code.
>>
>> Right, Petr.
>>
>> I was trying out a few things before I ended up with what I sent here.
>> Bu yeah.. I did realize arch_kexec_locate_mem_hole() would have been better
>> after sending out v1. Will take care of that in v2.
>
> Another way is use arch private function to locate mem hole, then set
> kbuf->mem, and then call kexec_add_buf, it will skip the common locate
> hole function.
Dave, I did think about it. But there are a couple of places this can get
tricky. One is ima_add_kexec_buffer() and the other is kexec_elf_load().
These call sites could be updated to set kbuf->mem before kexec_add_buffer().
But the current approach seemed like the better option for it creates a
single point of control in setting up segment buffers and also, makes adding
any new segments simpler, arch-specific segments or otherwise.
Thanks
Hari
next prev parent reply other threads:[~2020-07-01 18:33 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-26 19:04 [PATCH 00/11] ppc64: enable kdump support for kexec_file_load syscall Hari Bathini
2020-06-26 19:04 ` [PATCH 01/11] kexec_file: allow archs to handle special regions while locating memory hole Hari Bathini
2020-06-27 6:30 ` Christophe Leroy
2020-06-28 2:28 ` piliu
2020-06-29 6:00 ` Hari Bathini
2020-06-29 11:39 ` Petr Tesarik
2020-06-29 11:56 ` Hari Bathini
2020-07-01 7:46 ` Dave Young
2020-07-01 18:31 ` Hari Bathini [this message]
2020-07-02 11:47 ` Dave Young
2020-06-26 19:04 ` [PATCH 02/11] powerpc/kexec_file: mark PPC64 specific code Hari Bathini
2020-06-27 6:42 ` Christophe Leroy
2020-06-29 6:23 ` Hari Bathini
2020-06-26 19:05 ` [PATCH 03/11] powerpc/kexec_file: add helper functions for getting memory ranges Hari Bathini
2020-06-26 19:05 ` [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions Hari Bathini
2020-06-28 2:14 ` piliu
2020-06-29 5:55 ` Hari Bathini
2020-06-30 3:30 ` piliu
2020-06-30 6:10 ` Hari Bathini
2020-06-30 8:13 ` piliu
2020-07-01 7:40 ` Dave Young
2020-07-01 12:53 ` piliu
2020-07-02 11:59 ` Dave Young
2020-07-01 18:18 ` Hari Bathini
2020-07-02 11:54 ` Dave Young
2020-06-26 19:05 ` [PATCH 05/11] powerpc/drmem: make lmb walk a bit more flexible Hari Bathini
2020-06-26 19:05 ` [PATCH 06/11] ppc64/kexec_file: restrict memory usage of kdump kernel Hari Bathini
2020-06-26 19:05 ` [PATCH 07/11] ppc64/kexec_file: add support to relocate purgatory Hari Bathini
2020-06-26 19:05 ` [PATCH 08/11] ppc64/kexec_file: setup the stack for purgatory Hari Bathini
2020-06-26 19:05 ` [PATCH 09/11] ppc64/kexec_file: setup backup region for kdump kernel Hari Bathini
2020-06-26 19:06 ` [PATCH 10/11] ppc64/kexec_file: prepare elfcore header for crashing kernel Hari Bathini
2020-06-26 19:06 ` [PATCH 11/11] ppc64/kexec_file: add appropriate regions for memory reserve map Hari Bathini
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=0e145e84-a6cf-4da3-1a1a-331a7e1ac1fa@linux.ibm.com \
--to=hbathini@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=bauerman@linux.ibm.com \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=piliu@redhat.com \
--cc=ptesarik@suse.cz \
--cc=sourabhjain@linux.ibm.com \
--cc=vgoyal@redhat.com \
--cc=zohar@linux.ibm.com \
/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).