Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric DeVolder <eric.devolder@oracle.com>
To: kexec@lists.infradead.org
Subject: [RFC v3 PATCH 5/5] powerpc/crash hp: add crash hotplug support for kexec_load
Date: Wed, 23 Mar 2022 13:33:04 -0500	[thread overview]
Message-ID: <02d339bc-b7fd-4a11-19ec-7a8fc05a77fc@oracle.com> (raw)
In-Reply-To: <20220321080422.56255-6-sourabhjain@linux.ibm.com>

Some minor nits below.
eric

On 3/21/22 03:04, Sourabh Jain wrote:
> The kernel changes needed to add support for crash hotplug support for
> kexec_load system calls are similar to kexec_file_load (which has already
> been implemented in earlier patches). Since kexec segment array is
> prepared by kexec tool in the userspace, the kernel does aware of which
s/kernel does aware/ kernel is not aware/ ?

> index FDT segment is present.
> 
> The only change was done to enabled crash hotplug support for kexec_load is
s/was done to enabled/to enable/ ?
> updated the crash hotplug handler to identify the FDT segment from kexec
s/updated/ to update/ ?
> segment array.
> 
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
>   arch/powerpc/kexec/core_64.c | 21 ++++++++++++++++++++-
>   1 file changed, 20 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kexec/core_64.c b/arch/powerpc/kexec/core_64.c
> index a470fe6904e3..2c248dfb169b 100644
> --- a/arch/powerpc/kexec/core_64.c
> +++ b/arch/powerpc/kexec/core_64.c
> @@ -480,7 +480,9 @@ int update_cpus_node(void *fdt)
>   void arch_crash_hotplug_handler(struct kimage *image, unsigned int hp_action,
>   				unsigned long a, unsigned long b)
>   {
> -	void *fdt;
> +	void *fdt, *ptr;
> +	unsigned int n;
> +	unsigned long mem, memsz;
>   
>   	/* No action needed for CPU hot-unplug */
>   	if (hp_action == KEXEC_CRASH_HP_REMOVE_CPU)
> @@ -492,6 +494,23 @@ void arch_crash_hotplug_handler(struct kimage *image, unsigned int hp_action,
>   		return;
>   	}
>   
> +	/* Sine kexec segments for kexec_load system call is prepred by
s/Sine/Since/
s/is prepred/are prepared/
> +	 * kexec tool in userspace we need loop through all the segments
> +	 * to find out segment index corresponds FDT segment. In case of
> +	 * kexec_file_load it is discovered during the load itself.
> +	 */
> +	if (!image->arch.fdt_index_valid) {
> +		for (n = 0; n < image->nr_segments; n++) {
> +			mem = image->segment[n].mem;
> +			memsz = image->segment[n].memsz;
> +			ptr = __va(mem);
> +			if (ptr && fdt_magic(ptr) == FDT_MAGIC) {
> +				image->arch.fdt_index = n;
> +				image->arch.fdt_index_valid = true;
How about adding a break; statement to early exit?
> +			}
> +		}
> +	}
> +
>   	/* Must have valid FDT index */
>   	if (!image->arch.fdt_index_valid) {
>   		pr_err("crash hp: unable to locate FDT segment");
> 


  reply	other threads:[~2022-03-23 18:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21  8:04 [RFC v3 PATCH 0/5] In kernel handling of CPU hotplug events for crash kernel Sourabh Jain
2022-03-21  8:04 ` [RFC v3 PATCH 1/5] powerpc/kexec: make update_cpus_node non-static Sourabh Jain
2022-03-21  8:04 ` [RFC v3 PATCH 2/5] powerpc/crash hp: introduce a new config option CRASH_HOTPLUG Sourabh Jain
2022-03-23 18:32   ` Eric DeVolder
2022-03-21  8:04 ` [RFC v3 PATCH 3/5] powrepc/crash hp: update kimage struct Sourabh Jain
2022-03-23 18:32   ` Eric DeVolder
2022-03-24  6:07     ` Sourabh Jain
2022-03-21  8:04 ` [RFC v3 PATCH 4/5] powerpc/crash hp: add crash hotplug support for kexec_file_load Sourabh Jain
2022-03-23 18:32   ` Eric DeVolder
2022-03-25 11:32     ` Sourabh Jain
2022-03-25 18:03   ` Laurent Dufour
2022-03-31  9:00     ` Sourabh Jain
2022-03-21  8:04 ` [RFC v3 PATCH 5/5] powerpc/crash hp: add crash hotplug support for kexec_load Sourabh Jain
2022-03-23 18:33   ` Eric DeVolder [this message]
2022-03-23 18:32 ` [RFC v3 PATCH 0/5] In kernel handling of CPU hotplug events for crash kernel Eric DeVolder
2022-03-25  8:32   ` Sourabh Jain
2022-03-25 17:04 ` Laurent Dufour
2022-03-31  9:05   ` Sourabh Jain

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=02d339bc-b7fd-4a11-19ec-7a8fc05a77fc@oracle.com \
    --to=eric.devolder@oracle.com \
    --cc=kexec@lists.infradead.org \
    /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