From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMdYf-0002mu-PR for qemu-devel@nongnu.org; Wed, 18 May 2011 06:00:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMdYe-00070G-MD for qemu-devel@nongnu.org; Wed, 18 May 2011 06:00:49 -0400 Received: from mail.sysgo.com ([195.145.229.155]:56999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMdYe-0006zp-Gk for qemu-devel@nongnu.org; Wed, 18 May 2011 06:00:48 -0400 Message-ID: <4DD398CE.9040603@sysgo.com> Date: Wed, 18 May 2011 12:00:46 +0200 From: Alex Zuepke MIME-Version: 1.0 References: <4D8C745F.2000304@sysgo.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------050201080202010407010008" Subject: Re: [Qemu-devel] ARM: BKPT instructions should raise prefetch aborts with IFSR type 00010 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------050201080202010407010008 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, Peter Maydell schrieb: > On 25 March 2011 10:54, Alex Zuepke wrote: >> while digging through some problems with BKPT exceptions on ARM, I >> discovered that QEMU does not update IFSR on prefetch aborts. This >> should be done since ARMv6 according to ARM docs. Please include. > > This patch is the wrong approach to fixing this bug -- the > updating of the IFSR needs to be done when the exception > is taken, not when we translate the breakpoint instruction. > > I'll put this on my todo list. If you happen to have a convenient > test case demonstrating the problem, that would make a fix happen > faster ;-) > > -- PMM I tried to fix it, new patch attached. But I'm not sure if it is required for semihosting as well. On ARMv7-M bkpt works differently, and debug registers aren't implemented yet, so I didn't touch it. Best Regards, Alex -- Alexander Zuepke azuepke@sysgo.com SYSGO AG ~ Am Pfaffenstein 14 ~ 55270 Klein-Winternheim ~ Germany --------------050201080202010407010008 Content-Type: text/x-diff; name="qemu_arm_bkpt_ifsr_update_v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu_arm_bkpt_ifsr_update_v2.patch" target-arm: BKPT instructions should raise prefetch aborts with IFSR type 00010 diff against qemu 0.14.1 Signed-off-by: Alex Zuepke diff --git a/target-arm/helper.c b/target-arm/helper.c --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -847,6 +849,7 @@ void do_interrupt(CPUARMState *env) return; } } + env->cp15.c5_insn = 2; /* Fall through to prefetch abort. */ case EXCP_PREFETCH_ABORT: new_mode = ARM_CPU_MODE_ABT; --------------050201080202010407010008--