[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALu+AoQzQGypYRWXLiu1zfipL+H++x2H3pnL1uZgXPCFvumDiw@mail.gmail.com>
Date: Thu, 31 Jul 2025 17:27:27 +0800
From: Dave Young <dyoung@...hat.com>
To: Brian Mak <makb@...iper.net>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>, Baoquan He <bhe@...hat.com>,
Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
"x86@...nel.org" <x86@...nel.org>, "kexec@...ts.infradead.org" <kexec@...ts.infradead.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] x86/kexec: Carry forward the boot DTB on kexec
Hi Brian,
On Thu, 31 Jul 2025 at 01:02, Brian Mak <makb@...iper.net> wrote:
>
> On Jul 30, 2025, at 12:31 AM, Dave Young <dyoung@...hat.com> wrote
>
> >> +#ifdef CONFIG_OF_FLATTREE
> >> + if (initial_boot_params) {
> >> + setup_dtb(params, params_load_addr, setup_data_offset);
> >> + setup_data_offset += sizeof(struct setup_data) +
> >> + fdt_totalsize(initial_boot_params);
> >
> > I suppose current boot dtb should be valid for the current runnning
> > kernel, if you use kexec to load another kernel the next kexec reboot
> > could fail due to unmatching dtb.
> >
> > Make this unconditionally could break the previous working kexec?
>
> Hi Dave,
>
> Thanks for taking the time to look at this change!
>
> The behavior on ARM64 for carrying over the current boot DTB is
> unconditional, which is why I've made it unconditional here as well. I'm
> open to suggestions on this though. Realistically, would there be a case
> where having no DTB wouldn't break, but carrying over the current DTB
> would?
I worry about it since dtb is for providing boot related information,
weird things could happen if the kernel versions are different.
About arm64 and powerpc I think maybe just nobody noticed this
problem. IMO it is wrong as kexec is designed to load different
kernels not limited to current running kernels.
Otherwise the current kexec_file_load syscall only supports passing
kernel_fd, initrd_fd and cmdline, no extra param designed for dtb, I
don't know if there are other ways via attaching dtb to kernel or
initrd.
Probably you can try to add a new flag to the kexec_file_load syscall,
when this flag is set 1 then use the current dtb, otherwise do
nothing. For arm64 and power, ideally doing the same is better, but
I'm not sure if we should change the old behavior, maybe they can go
with default to load the dtb, but users can choose not to do that.
Thanks
Dave
Powered by blists - more mailing lists