From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJo2P-0001wm-3A for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:21:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJo2K-0001lr-Sy for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:21:41 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:43137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJo2K-0001lb-FD for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:21:36 -0400 Received: by mail-la0-f43.google.com with SMTP id gi9so3763031lab.16 for ; Tue, 19 Aug 2014 11:21:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 19 Aug 2014 15:21:35 -0300 Message-ID: From: Martin Galvan Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] target-arm: Fix resetting issues on ARMv7-M CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On Tue, Aug 19, 2014 at 11:16 AM, Peter Maydell wrote: > On 19 August 2014 14:25, Martin Galvan > wrote: >> On Tue, Aug 19, 2014 at 10:06 AM, Peter Maydell >> wrote: >>> I'm afraid this looks like the wrong fix for the problem you're seeing. >>> The bug you need to fix is that the ROM contents got zeroed. >>> The reset code is correct to reload SP and PC from memory -- >>> this is what the hardware does. >> >> Indeed, but aren't the ROM contents supposed to get zeroed? Otherwise, >> why would we call cpu_flish_icache_range? I'm afraid "fixing" that may >> have some unwanted side effects. > > Why do you think cpu_flush_icache_range has anything to do > with this? All that does is ensure that the host's instruction > cache has no stale contents for the ROM region. It doesn't > zero anything. (It's mostly there for the benefit of KVM, not TCG.) > Indeed, I missed the g_free just above the call to cpu_flush_icache_range in rom_reset. Is there any particular reason why we're doing that g_free?