[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zd2/CRHtB4kETwtp@MiWiFi-R3L-srv>
Date: Tue, 27 Feb 2024 18:52:57 +0800
From: Baoquan He <bhe@...hat.com>
To: Hari Bathini <hbathini@...ux.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
Kexec-ml <kexec@...ts.infradead.org>,
lkml <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Sourabh Jain <sourabhjain@...ux.ibm.com>,
Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
"Naveen N. Rao" <naveen.n.rao@...ux.ibm.com>,
Nicholas Piggin <npiggin@...il.com>,
Michael Ellerman <mpe@...erman.id.au>,
Dave Young <dyoung@...hat.com>
Subject: Re: [PATCH linux-next v2 1/3] kexec/kdump: make struct crash_mem
available without CONFIG_CRASH_DUMP
On 02/26/24 at 04:00pm, Hari Bathini wrote:
> struct crash_mem defined under include/linux/crash_core.h represents
> a list of memory ranges. While it is used to represent memory ranges
> for kdump kernel, it can also be used for other kind of memory ranges.
> In fact, KEXEC_FILE_LOAD syscall in powerpc uses this structure to
> represent reserved memory ranges and exclude memory ranges needed to
> find the right memory regions to load kexec kernel. So, make the
We may be able to refactor code to make struct crash_mem only used for
crash handling, or get another data structure for loading kexec kernel.
Anyway, for the time being, this is the simplest way we can take. Thanks
for the work on ppc to make crash split out from the kexec code.
Acked-by: Baoquan He <bhe@...hat.com>
> definition of crash_mem structure available for !CONFIG_CRASH_DUMP
> case too.
>
> Signed-off-by: Hari Bathini <hbathini@...ux.ibm.com>
> ---
>
> * No changes in v2.
>
> include/linux/crash_core.h | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h
> index 23270b16e1db..d33352c2e386 100644
> --- a/include/linux/crash_core.h
> +++ b/include/linux/crash_core.h
> @@ -8,6 +8,12 @@
>
> struct kimage;
>
> +struct crash_mem {
> + unsigned int max_nr_ranges;
> + unsigned int nr_ranges;
> + struct range ranges[] __counted_by(max_nr_ranges);
> +};
> +
> #ifdef CONFIG_CRASH_DUMP
>
> int crash_shrink_memory(unsigned long new_size);
> @@ -51,12 +57,6 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; }
> /* Alignment required for elf header segment */
> #define ELF_CORE_HEADER_ALIGN 4096
>
> -struct crash_mem {
> - unsigned int max_nr_ranges;
> - unsigned int nr_ranges;
> - struct range ranges[] __counted_by(max_nr_ranges);
> -};
> -
> extern int crash_exclude_mem_range(struct crash_mem *mem,
> unsigned long long mstart,
> unsigned long long mend);
> --
> 2.43.2
>
Powered by blists - more mailing lists