From patchwork Mon Jun 15 17:24:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 49897 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D1900211FD for ; Mon, 15 Jun 2015 17:28:33 +0000 (UTC) Received: by wgv5 with SMTP id 5sf26578084wgv.0 for ; Mon, 15 Jun 2015 10:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=ScHY1tF3AklINwBVj1YAhZP6gRqJj751lHQmzfl+AtY=; b=ZnP8Y+Nbj0QaCzLraGxKluiTsMu3+GCgza6uBPb3K8xjbqsLS5YfD+BNf0sc+LuXwu CwckU78zFNAtBSyx7zeA4RPDR1JLfDLN7Tm1BssAf+N59JlXSwu6RH8Tvw5DcQK1McjI yLzhKs+Pc94aSlrNOuUbnbSs3q0syUwdq00Ic8PBlb76dmGYiAQl+zc8DNRYbNR5lZVZ to3iYDTLR8WEml3xbOnf4uxBF0NWSmY+YIKRC6IUjyvqFl6dOxtNIv+bQEIpzC7VtY8M 8WXv1AKeTyYrkl+7MWHG0vYQAsAzIEszbUF7ERBz4wcF2Ro2HjNxCMRumv99hN4YoFUB WMzQ== X-Gm-Message-State: ALoCoQnJGwwZtD2xPl1ArL7Vdc1UUaTn8RfnlKQhtGjhVo4Fxnof+P+os38dlRMrMUobRgXcq48+ X-Received: by 10.112.28.111 with SMTP id a15mr1061352lbh.21.1434389312108; Mon, 15 Jun 2015 10:28:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.6 with SMTP id o6ls837239lah.56.gmail; Mon, 15 Jun 2015 10:28:31 -0700 (PDT) X-Received: by 10.112.27.238 with SMTP id w14mr1300699lbg.80.1434389311954; Mon, 15 Jun 2015 10:28:31 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id r5si11016509lbp.16.2015.06.15.10.28.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 10:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lblr1 with SMTP id r1so31503444lbl.0 for ; Mon, 15 Jun 2015 10:28:31 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr28227565lae.19.1434389311848; Mon, 15 Jun 2015 10:28:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1564027lbb; Mon, 15 Jun 2015 10:28:31 -0700 (PDT) X-Received: by 10.140.100.162 with SMTP id s31mr36992274qge.36.1434389310639; Mon, 15 Jun 2015 10:28:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c42si5190066qge.119.2015.06.15.10.28.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Jun 2015 10:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4YBR-0004KC-Km for patch@linaro.org; Mon, 15 Jun 2015 13:28:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Y8C-0007Vd-Gi for qemu-devel@nongnu.org; Mon, 15 Jun 2015 13:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Y8B-0001Pq-Dz for qemu-devel@nongnu.org; Mon, 15 Jun 2015 13:25:08 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Y8A-0001AA-Uh for qemu-devel@nongnu.org; Mon, 15 Jun 2015 13:25:07 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Z4Y83-0003XH-P9 for qemu-devel@nongnu.org; Mon, 15 Jun 2015 18:24:59 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 15 Jun 2015 18:24:55 +0100 Message-Id: <1434389098-13430-26-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434389098-13430-1-git-send-email-peter.maydell@linaro.org> References: <1434389098-13430-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 25/28] hw/arm/boot: fix rom_reset notifier registration order X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Eric Auger commit ac9d32e39664e060cd1b538ff190980d57ad69e4 had the consequence to register the do_cpu_reset after the rom_reset one. Hence they get executed in the wrong order. This commit restores the registration of do_cpu_reset in arm_load_kernel. Signed-off-by: Eric Auger Reported-by: Peter Crosthwaite Reviewed-by: Peter Crosthwaite Tested-by: Peter Crosthwaite Message-id: 1434111582-9325-1-git-send-email-eric.auger@linaro.org Signed-off-by: Peter Maydell --- hw/arm/boot.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index d036624..1e7fd28 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -574,15 +574,6 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) struct arm_boot_info *info = container_of(n, struct arm_boot_info, load_kernel_notifier); - /* CPU objects (unlike devices) are not automatically reset on system - * reset, so we must always register a handler to do so. If we're - * 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)) { - qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); - } - /* Load the kernel. */ if (!info->kernel_filename || info->firmware_loaded) { @@ -783,7 +774,18 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) { + CPUState *cs; + info->load_kernel_notifier.cpu = cpu; info->load_kernel_notifier.notifier.notify = arm_load_kernel_notify; qemu_add_machine_init_done_notifier(&info->load_kernel_notifier.notifier); + + /* CPU objects (unlike devices) are not automatically reset on system + * reset, so we must always register a handler to do so. If we're + * 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)) { + qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); + } }