From patchwork Fri Oct 10 11:35:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 38551 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9F89C202DB for ; Fri, 10 Oct 2014 11:36:55 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id a1sf1978145wgh.9 for ; Fri, 10 Oct 2014 04:36:54 -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:cc: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=pJxPLXUNg/Nkc1/vuqhM9MGk9T/kZx9DbfqyDZ7LS/o=; b=RZPM/u89hAxrl6iGVND9YTc8idxoGbQbllsJHixZt6lrHt+EYiyH42gWPq68oTwiZu 05fLaq4NbJKaqUcYGxFao5g+rfzRE6EDTFF1FgA3E8AyDqkIK77DnEix0/A6tZljDxci gff+4pIWJ5rKh1fB3D/Vd03BYAcDa2wtt1Mx3QjkKS932MlwBn7IRZTiJBWPb6YJLpH+ ApPOdqVjeZk9Upb80g8xQPf8A8VI1GHcxscw+EhOOMrUuBfXNucWnjnFWo/tQFkA2JBt vtbIZxsU2gal8jxzBmEeuI6XPFiJL32+XyLKOQEp9t+OH89Waz3hn07mTQufY358Si+K kU6g== X-Gm-Message-State: ALoCoQlYk+EfV163bqbEwvbt3SJTUA5bbwjhQY5kZvS4rVmEdPlsfOXlUgptGN2ANJ5RSolGjFOS X-Received: by 10.194.87.35 with SMTP id u3mr869047wjz.3.1412941014197; Fri, 10 Oct 2014 04:36:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.226 with SMTP id q2ls265610lae.15.gmail; Fri, 10 Oct 2014 04:36:53 -0700 (PDT) X-Received: by 10.152.203.204 with SMTP id ks12mr4219006lac.65.1412941013943; Fri, 10 Oct 2014 04:36:53 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id nb4si8837081lbb.35.2014.10.10.04.36.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id 10so2914481lbg.0 for ; Fri, 10 Oct 2014 04:36:50 -0700 (PDT) X-Received: by 10.113.10.9 with SMTP id dw9mr4134290lbd.46.1412941010023; Fri, 10 Oct 2014 04:36:50 -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.84.229 with SMTP id c5csp409647lbz; Fri, 10 Oct 2014 04:36:49 -0700 (PDT) X-Received: by 10.224.71.206 with SMTP id i14mr7852594qaj.100.1412941008695; Fri, 10 Oct 2014 04:36:48 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z74si8024146qgz.53.2014.10.10.04.36.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:36:48 -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]:47492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYV5-0003SS-Uj for patch@linaro.org; Fri, 10 Oct 2014 07:36:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYUP-0002zq-GX for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcYUJ-0000Vg-Fg for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:36:05 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:40682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYUJ-0000VS-B0 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:35:59 -0400 Received: by mail-wg0-f52.google.com with SMTP id a1so3633056wgh.35 for ; Fri, 10 Oct 2014 04:35:55 -0700 (PDT) X-Received: by 10.194.209.207 with SMTP id mo15mr4047682wjc.6.1412940955024; Fri, 10 Oct 2014 04:35:55 -0700 (PDT) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id gw6sm2347767wib.8.2014.10.10.04.35.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 10 Oct 2014 04:35:54 -0700 (PDT) From: Ard Biesheuvel To: peter.maydell@linaro.org Date: Fri, 10 Oct 2014 13:35:44 +0200 Message-Id: <1412940944-19107-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.52 Cc: Ard Biesheuvel , qemu-devel@nongnu.org, greg.bellows@linaro.org Subject: [Qemu-devel] [PATCH v2] hw/arm/boot: register cpu reset handlers if using -bios 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: ard.biesheuvel@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.169 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 Move the registering of CPU reset handlers to before the point where we leave the function in the -bios (not -kernel) case, so CPU reset works correctly with -bios as well. Signed-off-by: Ard Biesheuvel --- hw/arm/boot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index c8dc34f0865b..fc6a3ebf853d 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -488,6 +488,12 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) int big_endian; static const ARMInsnFixup *primary_loader; + for (; cs; cs = CPU_NEXT(cs)) { + cpu = ARM_CPU(cs); + cpu->env.boot_info = info; + qemu_register_reset(do_cpu_reset, cpu); + } + /* Load the kernel. */ if (!info->kernel_filename) { @@ -651,10 +657,4 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) } } info->is_linux = is_linux; - - for (; cs; cs = CPU_NEXT(cs)) { - cpu = ARM_CPU(cs); - cpu->env.boot_info = info; - qemu_register_reset(do_cpu_reset, cpu); - } }