kexec on arm fails, possibly due to memdup_user

Russell King (Oracle) linux at armlinux.org.uk
Sun Jul 2 08:51:57 PDT 2023


On Sat, Jul 01, 2023 at 08:25:46PM +0100, Amr Bekhit wrote:
> I'm trying to get kexec working on my Qualcom IPQ4019-based ARM
> system. My system is built using yocto mickledore, but I'm using the
> kernel from openwrt, so that's 5.15.110 (config:
> https://pastebin.com/KgP2sJLf). I've compiled in kexec support in the
> kernel and included the kexec tools. I'm then trying to load and
> execute a zImage, but the load fails. I've added some debug messages
> to the kexec_load function in the kernel to try and figure out where
> it's failing (see https://pastebin.com/G6AEKakw). Here is the output
> of the kexec commands, with the kernel debug messages interdispersed:

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;

or:

                if (!memblock_is_region_memory(idmap_to_phys(current_segment->mem),
                                               current_segment->memsz))
                        return -EINVAL;

in machine_kexec_prepare().

If it's the former, then it means your platform has more tha one CPU,
but has no way to take the secondary CPUs offline.

-- 
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