Hi Dengcheng, On Mon, Jul 23, 2018 at 07:48:19AM -0700, Dengcheng Zhu wrote: > The kexec_prepare method for the generic platform should be applicable to > other platforms. ...only for platforms which use the UHI boot protocol, which is what generic_kexec_prepare() sets up kexec_args for. On any platforms which don't use this boot protocol the new kernel wound find unexpected arguments & in the worst case do something crazy with them. > For those otherwise, like Octeon, they will use their own > _machine_kexec_prepare(). > > Without the default prepare work, platforms other than the generic one will > not be able to automatically set up command line correctly for the new > kernel. So even with this patch they still can't unless they happen to use the UHI boot protocol. If we ever have multiple in-tree platforms which make use of the UHI boot protocol & want to use kexec then I'd be fine with us moving generic_kexec_prepare() & renaming it something like uhi_kexec_prepare() but I prefer that we don't just presume the boot protocol for any platform that doesn't set _machine_kexec_prepare. Hopefully anyone using the UHI boot protocol is doing so because they want to fit in with the generic kernel platform so this won't happen anyway (just need to get EVA supported by the generic platform & then there'd be no reason at all not to use it). Interestingly there's a patch in patchwork from last year which aimed at making the default to pass arguments the current kernel was given to the new kernel [1]. That would seem like a saner default since we'd be making no presumptions about what those arguments should actually be, but I don't think that's safe either because if any of those arguments are pointers we have no guarantees that we haven't overwritten the memory they're pointing at. Thanks, Paul [1] https://patchwork.linux-mips.org/patch/15397/