Received: from eggs.gnu.org ([2001:4830:134:3::10]:39828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBeR1-0002lG-LC for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBeR0-0001aw-7C for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:47:31 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBeQz-0001OF-UR for qemu-devel@nongnu.org; Thu, 26 Apr 2018 06:47:30 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fBeQn-0002zd-Sp for qemu-devel@nongnu.org; Thu, 26 Apr 2018 11:47:17 +0100 From: Peter Maydell Date: Thu, 26 Apr 2018 11:46:58 +0100 Message-Id: <20180426104715.21702-3-peter.maydell@linaro.org> In-Reply-To: <20180426104715.21702-1-peter.maydell@linaro.org> References: <20180426104715.21702-1-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 02/19] arm: always start from first_cpu when registering loader cpu reset callback List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Igor Mammedov if arm_load_kernel() were passed non first_cpu, QEMU would end up with partially set do_cpu_reset() callback leaving some CPUs without it. Make sure that do_cpu_reset() is registered for all CPUs by enumerating CPUs from first_cpu. (In practice every board that we have was passing us the first CPU as the boot CPU, either directly or indirectly, so this wasn't causing incorrect behaviour.) Signed-off-by: Igor Mammedov Reviewed-by: Peter Maydell [PMM: added a note that this isn't a behaviour change] Signed-off-by: Peter Maydell --- hw/arm/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 26184bcd7c..9ae6ab2689 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -1188,7 +1188,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) * actually loading a kernel, the handler is also responsible for * arranging that we start it correctly. */ - for (cs = CPU(cpu); cs; cs = CPU_NEXT(cs)) { + for (cs = first_cpu; cs; cs = CPU_NEXT(cs)) { qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); } } -- 2.17.0