From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O1x-00049D-VT for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3O1u-0000LW-O4 for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:25:53 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37263) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3O1u-0000L5-02 for qemu-devel@nongnu.org; Fri, 12 Jun 2015 08:25:50 -0400 Received: by wifx6 with SMTP id x6so15993617wif.0 for ; Fri, 12 Jun 2015 05:25:49 -0700 (PDT) Message-ID: <557ACFBF.9030904@linaro.org> Date: Fri, 12 Jun 2015 14:25:35 +0200 From: Eric Auger MIME-Version: 1.0 References: <1434111582-9325-1-git-send-email-eric.auger@linaro.org> In-Reply-To: <1434111582-9325-1-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/arm/boot: fix rom_reset notifier registration order List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@st.com, qemu-devel@nongnu.org, peter.maydell@linaro.org, peter.crosthwaite@xilinx.com Hi Peter, Please can you test whether this patch fixes the issue on xlnx-ep108 board. I acknowledge I do not feel comfortable with that piece of code and meanwhile I continue looking at boot.c & loader.c files. Thank you in advance Best Regards Eric On 06/12/2015 02:19 PM, Eric Auger wrote: > 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 > --- > 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)); > + } > } >