[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z35jpYq4GvCAXiII@MiWiFi-R3L-srv>
Date: Wed, 8 Jan 2025 19:38:13 +0800
From: Baoquan he <bhe@...hat.com>
To: Sourabh Jain <sourabhjain@...ux.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org,
Andrew Morton <akpm@...ux-foundation.org>,
Hari Bathini <hbathini@...ux.ibm.com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, kexec@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND v1 5/5] crash: option to let arch decide mem range
is usable
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
>
Powered by blists - more mailing lists