qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Zuepke <azuepke@sysgo.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] ARM: BKPT instructions should raise prefetch aborts with IFSR type 00010
Date: Wed, 18 May 2011 12:00:46 +0200	[thread overview]
Message-ID: <4DD398CE.9040603@sysgo.com> (raw)
In-Reply-To: <AANLkTimB_OYKtjCOXrSe5RSNKiYTR6YUN7paVU=gELEf@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

Hi,

Peter Maydell schrieb:
> On 25 March 2011 10:54, Alex Zuepke <azuepke@sysgo.com> 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

[-- Attachment #2: qemu_arm_bkpt_ifsr_update_v2.patch --]
[-- Type: text/x-diff, Size: 518 bytes --]

 target-arm: BKPT instructions should raise prefetch aborts with IFSR type 00010
 diff against qemu 0.14.1
 Signed-off-by: Alex Zuepke <azuepke@sysgo.com>
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;

  parent reply	other threads:[~2011-05-18 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 10:54 [Qemu-devel] ARM: BKPT instructions should raise prefetch aborts with IFSR type 00010 Alex Zuepke
2011-03-25 11:39 ` Peter Maydell
2011-03-25 14:01   ` Alex Zuepke
2011-05-18 10:00   ` Alex Zuepke [this message]
2011-05-18 17:44     ` Peter Maydell
2011-06-03 16:42     ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD398CE.9040603@sysgo.com \
    --to=azuepke@sysgo.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).