Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754556AbbBZS7t (ORCPT ); Thu, 26 Feb 2015 13:59:49 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:45575 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754058AbbBZS7r (ORCPT ); Thu, 26 Feb 2015 13:59:47 -0500 Message-ID: <54EF6D4A.6000603@wwwdotorg.org> Date: Thu, 26 Feb 2015 12:00:26 -0700 From: Stephen Warren User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Russell King - ARM Linux , Geert Uytterhoeven CC: Magnus Damm , Stephen Warren , 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 References: <1424947028-7438-1-git-send-email-geert+renesas@glider.be> <20150226174206.GL8656@n2100.arm.linux.org.uk> In-Reply-To: <20150226174206.GL8656@n2100.arm.linux.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2360 Lines: 52 On 02/26/2015 10:42 AM, Russell King - ARM Linux wrote: > 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()) I can't remember the call stack here. Is num_online_cpus() guaranteed not to change from this point through to when the kexec actually happens? > >> 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. > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/