linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	linuxppc-dev@ozlabs.org, Eric DeVolder <eric.devolder@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Valentin Schneider <vschneid@redhat.com>,
	x86@kernel.org, "Aneesh Kumar K . V" <aneesh.kumar@kernel.org>,
	Laurent Dufour <laurent.dufour@fr.ibm.com>,
	Dave Young <dyoung@redhat.com>, Vivek Goyal <vgoyal@redhat.com>,
	Naveen N Rao <naveen@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Hari Bathini <hbathini@linux.ibm.com>,
	Oscar Salvador <osalvador@suse.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kexec@lists.infradead.org,
	Mahesh Salgaonkar <mahesh@linux.ibm.com>,
	Akhil Raj <lf32.dev@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v17 2/6] crash: add a new kexec flag for hotplug support
Date: Thu, 29 Feb 2024 15:28:42 +0800	[thread overview]
Message-ID: <ZeAyKj5b2HN90ija@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20240226084118.16310-3-sourabhjain@linux.ibm.com>

On 02/26/24 at 02:11pm, Sourabh Jain wrote:
......snip...
> diff --git a/kernel/crash_core.c b/kernel/crash_core.c
> index 70fa8111a9d6..630c4fd7ea39 100644
> --- a/kernel/crash_core.c
> +++ b/kernel/crash_core.c
> @@ -496,7 +496,7 @@ static DEFINE_MUTEX(__crash_hotplug_lock);
>   * It reflects the kernel's ability/permission to update the crash
>   * elfcorehdr directly.
     ~~~~~~~~~ this should be updated too.

>   */
> -int crash_check_update_elfcorehdr(void)
> +int crash_check_hotplug_support(void)
>  {
>  	int rc = 0;
>  
> @@ -508,10 +508,7 @@ int crash_check_update_elfcorehdr(void)
>  		return 0;
>  	}
>  	if (kexec_crash_image) {
> -		if (kexec_crash_image->file_mode)
> -			rc = 1;
> -		else
> -			rc = kexec_crash_image->update_elfcorehdr;
> +		rc = kexec_crash_image->hotplug_support;
>  	}
>  	/* Release lock now that update complete */
>  	kexec_unlock();
> @@ -552,8 +549,8 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu,
>  
>  	image = kexec_crash_image;
>  
> -	/* Check that updating elfcorehdr is permitted */
> -	if (!(image->file_mode || image->update_elfcorehdr))
> +	/* Check that kexec segments update is permitted */
> +	if (!image->hotplug_support)
>  		goto out;
>  
>  	if (hp_action == KEXEC_CRASH_HP_ADD_CPU ||
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index bab542fc1463..a6b3f96bb50c 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -135,8 +135,8 @@ static int do_kexec_load(unsigned long entry, unsigned long nr_segments,
>  		image->preserve_context = 1;
>  
>  #ifdef CONFIG_CRASH_HOTPLUG
> -	if (flags & KEXEC_UPDATE_ELFCOREHDR)
> -		image->update_elfcorehdr = 1;
> +	if ((flags & KEXEC_ON_CRASH) && arch_crash_hotplug_support(image, flags))
> +		image->hotplug_support = 1;
>  #endif
>  
>  	ret = machine_kexec_prepare(image);
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index 2d1db05fbf04..3d64290d24c9 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -376,6 +376,11 @@ SYSCALL_DEFINE5(kexec_file_load, int, kernel_fd, int, initrd_fd,
>  	if (ret)
>  		goto out;
>  
> +#ifdef CONFIG_CRASH_HOTPLUG
> +	if ((flags & KEXEC_FILE_ON_CRASH) && arch_crash_hotplug_support(image, flags))
> +		image->hotplug_support = 1;
> +#endif
> +
>  	ret = machine_kexec_prepare(image);
>  	if (ret)
>  		goto out;

Other than the tiny part, the overall looks good to me.

Acked-by: Baoquan He <bhe@redhat.com>


  parent reply	other threads:[~2024-02-29  7:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  8:41 [PATCH v17 0/6] powerpc/crash: Kernel handling of CPU and memory hotplug Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 1/6] crash: forward memory_notify arg to arch crash hotplug handler Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 2/6] crash: add a new kexec flag for hotplug support Sourabh Jain
2024-02-29  5:05   ` Sourabh Jain
2024-02-29  5:56     ` Baoquan He
2024-02-29  7:58       ` Sourabh Jain
2024-02-29  7:28   ` Baoquan He [this message]
2024-02-29  8:14     ` Sourabh Jain
2024-02-29  8:34     ` Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 3/6] powerpc/kexec: move *_memory_ranges functions to ranges.c Sourabh Jain
2024-02-29  8:11   ` Baoquan He
2024-02-29  8:16     ` Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 4/6] PowerPC/kexec: make the update_cpus_node() function public Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 5/6] powerpc/crash: add crash CPU hotplug support Sourabh Jain
2024-02-26  8:41 ` [PATCH v17 6/6] powerpc/crash: add crash memory " Sourabh Jain
2024-02-29 13:51 ` [PATCH v17 0/6] powerpc/crash: Kernel handling of CPU and memory hotplug Baoquan He
2024-03-01  5:13   ` Sourabh Jain
  -- strict thread matches above, loose matches on Subject: below --
2024-03-02 13:17 [PATCH v17 2/6] crash: add a new kexec flag for hotplug support Hari Bathini
2024-03-04  4:46 ` 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=ZeAyKj5b2HN90ija@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@kernel.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=eric.devolder@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hbathini@linux.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=laurent.dufour@fr.ibm.com \
    --cc=lf32.dev@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.ibm.com \
    --cc=naveen@kernel.org \
    --cc=osalvador@suse.de \
    --cc=sourabhjain@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vgoyal@redhat.com \
    --cc=vschneid@redhat.com \
    --cc=x86@kernel.org \
    --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).