devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	Stephen Warren <swarren@nvidia.com>,
	linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: kexec: Relax SMP validation to improve DT compatibility
Date: Thu, 26 Feb 2015 17:42:06 +0000	[thread overview]
Message-ID: <20150226174206.GL8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1424947028-7438-1-git-send-email-geert+renesas@glider.be>

On Thu, Feb 26, 2015 at 11:37:08AM +0100, Geert Uytterhoeven wrote:
> When trying to kexec into a new kernel on a platform where multiple CPU
> cores are present, but no SMP bringup code is available yet, the
> kexec_load system call fails with:
> 
>     kexec_load failed: Invalid argument
> 
> The SMP test added to machine_kexec_prepare() in commit 2103f6cba61a8b8b
> ("ARM: 7807/1: kexec: validate CPU hotplug support") wants to prohibit
> kexec on SMP platforms where it cannot disable secondary CPUs.
> However, this test is too strict: if the secondary CPUs couldn't be
> enabled in the first place, there's no need to disable them later at
> kexec time.  Hence skip the test in the absence of SMP bringup code.

Hmm.  I don't think we should relax it in this manner - I think there's
an easier solution to this.

> diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
> index de2b085ad7535da7..8bf3b7c098881b95 100644
> --- a/arch/arm/kernel/machine_kexec.c
> +++ b/arch/arm/kernel/machine_kexec.c
> @@ -46,7 +46,8 @@ int machine_kexec_prepare(struct kimage *image)
>  	 * 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_cpu_hotplug())
> +	if (num_possible_cpus() > 1 && platform_can_secondary_boot() &&
> +	    !platform_can_cpu_hotplug())

	if (num_online_cpus() > 1 && !platform_can_cpu_hotplug())

>  		return -EINVAL;

Neither test is actually accurate though: when we have implementations
where the secondary CPUs spin inside the kernel when they're "unplugged"
that is not sufficient to be able to kexec.

We should probably fix that, and make platform_can_cpu_hotplug() report
whether it really is possible to hotplug all secondary CPUs into such
a state that kexec can work.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2015-02-26 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 10:37 [PATCH] ARM: kexec: Relax SMP validation to improve DT compatibility Geert Uytterhoeven
2015-02-26 17:21 ` Stephen Warren
2015-02-26 17:42 ` Russell King - ARM Linux [this message]
2015-02-26 19:00   ` Stephen Warren
2015-02-26 19:26     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150226174206.GL8656@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=swarren@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).