From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUHa1-0008Ox-Tq for qemu-devel@nongnu.org; Wed, 17 Sep 2014 11:55:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUHZv-0007Ka-Ug for qemu-devel@nongnu.org; Wed, 17 Sep 2014 11:55:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45523 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUHZv-0007KC-HK for qemu-devel@nongnu.org; Wed, 17 Sep 2014 11:55:35 -0400 Message-ID: <5419AEF3.8010101@suse.de> Date: Wed, 17 Sep 2014 17:55:31 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1409930126-28449-1-git-send-email-ard.biesheuvel@linaro.org> <1409930126-28449-5-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/6] hw/arm/boot: register cpu reset handlers if using -bios List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ard Biesheuvel , Peter Maydell Cc: Fu Wei , QEMU Developers , Christoffer Dall Am 17.09.2014 um 17:50 schrieb Ard Biesheuvel: > On 9 September 2014 11:14, Peter Maydell wro= te: >> On 5 September 2014 16:15, Ard Biesheuvel = wrote: >>> When booting with -bios or -pflash rather than -kernel, we need to ma= ke sure >>> reset handlers are registered. >>> >>> Signed-off-by: Ard Biesheuvel >>> --- >>> hw/arm/boot.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/hw/arm/boot.c b/hw/arm/boot.c >>> index 8f5649a250fd..0cfc11d42962 100644 >>> --- a/hw/arm/boot.c >>> +++ b/hw/arm/boot.c >>> @@ -473,6 +473,10 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boo= t_info *info) >>> } >>> } >>> >>> + for (; cs; cs =3D CPU_NEXT(cs)) { >>> + qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); >>> + } >>> + >>> /* If no kernel specified, do nothing; we will start from ad= dress 0 >>> * (typically a boot ROM image) in the same way as hardware. >>> */ >> >> Andreas, with QOM CPUs who is supposed to be responsible >> for causing them to be reset when qemu_system_reset() >> happens? At the moment for ARM it doesn't happen at all >> unless you happened to pass -kernel. This patch makes >> boot.c register the reset handlers, but that seems >> a bit odd to me (among other things, it won't work >> for v7M). >> >=20 > Has there been any discussion on this topic in the mean time? No, thanks for the ping. IIRC each machine is responsible for registering a reset hook that calls - in most cases - cpu_reset(). The thing to look out for here is, does any machine already register a reset hook and would reset twice with this patch? What's the issue with v7-M? Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg