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: linuxppc-dev@lists.ozlabs.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Hari Bathini <hbathini@linux.ibm.com>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v1 5/5] crash: option to let arch decide mem range is usable
Date: Wed, 8 Jan 2025 19:38:13 +0800	[thread overview]
Message-ID: <Z35jpYq4GvCAXiII@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20250108101458.406806-6-sourabhjain@linux.ibm.com>

On 01/08/25 at 03:44pm, Sourabh Jain wrote:
...snip...
> diff --git a/include/linux/kexec.h b/include/linux/kexec.h
> index f0e9f8eda7a3..407f8b0346aa 100644
> --- a/include/linux/kexec.h
> +++ b/include/linux/kexec.h
> @@ -205,6 +205,15 @@ static inline int arch_kimage_file_post_load_cleanup(struct kimage *image)
>  }
>  #endif
>  
> +#ifndef arch_check_excluded_range
> +static inline int arch_check_excluded_range(struct kimage *image,
> +					    unsigned long start,
> +					    unsigned long end)
> +{
> +	return 0;
> +}
> +#endif
> +
>  #ifdef CONFIG_KEXEC_SIG
>  #ifdef CONFIG_SIGNED_PE_FILE_VERIFICATION
>  int kexec_kernel_verify_pe_sig(const char *kernel, unsigned long kernel_len);
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index 3eedb8c226ad..52e1480dbfa1 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -464,6 +464,12 @@ static int locate_mem_hole_top_down(unsigned long start, unsigned long end,
>  			continue;
>  		}
>  
> +		/* Make sure this does not conflict exclude range */
                                                   ^
                Make sure this doesn't conflict with excluded range?

> +		if (arch_check_excluded_range(image, temp_start, temp_end)) {
> +			temp_start = temp_start - PAGE_SIZE;
> +			continue;
> +		}
> +
>  		/* We found a suitable memory range */
>  		break;
>  	} while (1);
> @@ -498,6 +504,12 @@ static int locate_mem_hole_bottom_up(unsigned long start, unsigned long end,
>  			continue;
>  		}
>  
> +		/* Make sure this does not conflict exclude range */
                                                   ^
                                                 Ditto.

> +		if (arch_check_excluded_range(image, temp_start, temp_end)) {
> +			temp_start = temp_start + PAGE_SIZE;
> +			continue;
> +		}
> +
>  		/* We found a suitable memory range */
>  		break;
>  	} while (1);
> -- 
> 2.47.1
> 



  reply	other threads:[~2025-01-08 11:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 10:14 [PATCH RESEND v1 0/5] powerpc/crash: use generic crashkernel reservation Sourabh Jain
2025-01-08 10:14 ` [PATCH RESEND v1 1/5] crash: remove an unused argument from reserve_crashkernel_generic() Sourabh Jain
2025-01-08 11:16   ` Baoquan he
2025-01-09  3:48     ` Sourabh Jain
2025-01-08 10:14 ` [PATCH RESEND v1 2/5] crash: let arch decide crash memory export to iomem_resource Sourabh Jain
2025-01-08 11:25   ` Baoquan he
2025-01-08 12:02     ` Sourabh Jain
2025-01-08 10:14 ` [PATCH RESEND v1 3/5] powerpc/kdump: preserve user-specified memory limit Sourabh Jain
2025-01-08 17:06   ` Mahesh J Salgaonkar
2025-01-09  3:24     ` Sourabh Jain
2025-01-08 10:14 ` [PATCH RESEND v1 4/5] powerpc/crash: use generic crashkernel reservation Sourabh Jain
2025-01-08 17:05   ` Mahesh J Salgaonkar
2025-01-09  3:43     ` Sourabh Jain
2025-01-08 10:14 ` [PATCH RESEND v1 5/5] crash: option to let arch decide mem range is usable Sourabh Jain
2025-01-08 11:38   ` Baoquan he [this message]
2025-01-08 12:03     ` 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=Z35jpYq4GvCAXiII@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hbathini@linux.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=sourabhjain@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).