kexec on arm fails, possibly due to memdup_user
Russell King (Oracle)
linux at armlinux.org.uk
Tue Jul 4 13:53:32 PDT 2023
On Tue, Jul 04, 2023 at 06:48:26PM +0100, Amr Bekhit wrote:
> > It could be:
> >
> > /*
> > * Validate that if the current HW supports SMP, then the SW supports
> > * and implements CPU hotplug for the current HW. If not, we won't be
> > * able to kexec reliably, so fail the prepare operation.
> > */
> > if (num_possible_cpus() > 1 && platform_can_secondary_boot() &&
> > !platform_can_cpu_hotplug())
> > return -EINVAL;
>
> Thanks - this was exactly the issue. memdup_user was a red herring
> caused by some missing printk's due to me not adding newlines. It's
> now clear that for my CPU (IPQ4019), the cpu_kill function is not
> implemented in the smp_operations struct.
>
> Looking online, I was able to see that kexec does work on my cpu as
> long as nr_cpus=1 is specified in the kernel command line (see
> https://patchwork.kernel.org/project/linux-arm-msm/patch/CAAGQ2nQNQ-aFkcrQHNA6H5TZ1tTovtfO_0Ohfndn9jXy13Hc6A@mail.gmail.com/#22064531).
>
> I've tried this myself, and indeed setting this option allows the
> kexec load to perform successfully. However, when I run kexec -e,
> after the "Bye!" message the system just hangs and reboots after a
> while, presumably due to a watchdog timeout:
>
> ~ # kexec -d --dtb=/data/image-qcom-ipq4019-nerd.dtb -l /data/zImage-openwrt
...
> Any pointers as to what could be wrong at this point?
Try without --dtb
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
More information about the linux-arm-kernel
mailing list